Menu="OtherSettings"
Type="xmenu"
Title="Identification"
Icon="icon-home"
Tag="home"
---
<?PHP
/* Copyright 2005-2020, Lime Technology
 * Copyright 2012-2020, Bergware International.
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License version 2,
 * as published by the Free Software Foundation.
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 */
?>
<?
$disabled = $var['fsState']!='Stopped' ? 'disabled' : '';
$name_regex = '^[A-Za-z0-9]([A-Za-z0-9\-\.]{0,13}[A-Za-z0-9])?$';
$name_warn = preg_match('/'.$name_regex.'/', $var['NAME']) ? 'none' : 'block';
?>
<form markdown="1" name="NameSettings" method="POST" action="/update.htm" target="progressFrame">
<input type="hidden" name="server_https" value="<?=$_SERVER['HTTPS']?>">
<input type="hidden" name="server_name" value="<?=$_SERVER['HTTP_HOST']?>">
<input type="hidden" name="server_addr" value="<?=$_SERVER['SERVER_ADDR']?>">

_(Server name)_:
: <input type="text" name="NAME" id="NAME" maxlength="15" pattern="<?=$name_regex?>" value="<?=htmlspecialchars($var['NAME'])?>" title="_(Only alphanumeric characters)_ (&quot;A-Z&quot;, &quot;a-z&quot;, and &quot;0-9&quot;), dashes (&quot;-&quot;), and dots (&quot;.&quot;); _(and, the first and last characters must be alphanumeric)_" <?=$disabled?> required> <span id="name_warning" style="display:<?=$name_warn?>"><i class="fa fa-warning icon warning"></i> _(Not compatible with NetBIOS)_</span>

:id_server_name_help:

_(Description)_:
: <input type="text" name="COMMENT" value="<?=htmlspecialchars($var['COMMENT'])?>" <?=$disabled?>>

:id_description_help:

_(Model)_:
: <input type="text" name="SYS_MODEL" value="<?=htmlspecialchars($var['SYS_MODEL'])?>" <?=$disabled?>>

:id_model_help:

&nbsp;
: <input type="submit" name="changeNames" value="_(Apply)_" disabled><input type="button" value="_(Done)_" onclick="done()"><?if ($disabled):?>*_(Array must be **Stopped** to change)_*<?endif;?>
</form>
<script>
$("#NAME").keypress(function(event) {
  return event.key.match(/[A-Za-z0-9\-\.]/)!==null;
});
$("#NAME").on("input change", function() {
  if ($(this).val().match(/<?=$name_regex;?>/) === null) {
    $('#name_warning').fadeIn('fast');
  } else {
    $('#name_warning').fadeOut('fast');
  }
});
</script>
