Merge branch '6.4-wip' of github.com:limetech/webgui into 6.4-wip

This commit is contained in:
Tom Mortensen
2017-10-23 09:46:51 -07:00
3 changed files with 251 additions and 187 deletions

View File

@@ -7,7 +7,7 @@ Tag="docker"
/* Copyright 2005-2017, Lime Technology
* Copyright 2014-2017, Guilherme Jardim, Eric Schultz, Jon Panozzo.
*
* Additional updates by Bergware International (July 2017)
* Additional updates by Bergware International (October 2017)
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License version 2,
@@ -56,18 +56,41 @@ foreach ($custom as $network) {
if ($route = exec("ip -4 route show dev $network|grep -Po '^[12]\S+'")) $include[$network] = $route;
if ($route6 = exec("ip -6 route show dev $network|grep -Po '^[1-9]\S+'")) $include6[$network] = $route6;
}
function base_min($route) {
list($net,$mask) = explode('/',$route);
$mask = 32-$mask;
return explode('.',long2ip((ip2long($net)>>$mask)<<$mask));
}
function base_max($route) {
list($net,$mask) = explode('/',$route);
$mask = 32-$mask;
return explode('.',long2ip(((ip2long($net)>>$mask)<<$mask)+pow(2,$mask)-1));
}
function base_net($route) {
return substr(explode('/',$route)[0],0,-2);
}
?>
<link type="text/css" rel="stylesheet" href="/webGui/styles/jquery.filetree.css">
<link type="text/css" rel="stylesheet" href="/webGui/styles/jquery.switchbutton.css">
<style>
.errortext{color:#EF3D47;display:none;}
.fileTree{width:305px;max-height:150px;overflow:scroll;position:absolute;z-index:100;display:none;}
.basic{display: block;}
.advanced{display:none;white-space: nowrap;}
.errortext{color:#EF3D47;display:none}
.fileTree{width:305px;max-height:150px;overflow:scroll;position:absolute;z-index:100;display:none}
.basic{display:block}
.advanced{display:none;white-space:nowrap}
select.mask{min-width:0;margin:0 10px 0 4px}
select.net{min-width:0;margin:0 4px 0 0}
select option.hide{display:none}
input.net{width:146px;margin:0 4px 0 0}
span.net{margin-right:8px}
<?if (strstr('white,azure',$display['theme'])):?>
span.disabled{color:#B0B0B0}
<?else:?>
span.disabled{color:#404040}
<?endif;?>
</style>
<span class="status"><input type="checkbox" class="advancedview"></span>
<span class="status" style="margin-top:<?=strstr('gray,azure',$display['theme'])?0:-10?>px;"><input type="checkbox" class="advancedview"></span>
<form markdown="1" id="settingsForm" name="settingsForm" method="POST" action="/update.php" target="progressFrame">
<form markdown="1" id="settingsForm" name="settingsForm" method="POST" action="/update.php" target="progressFrame" onsubmit="prepareDocker(this)">
<input type="hidden" name="#file" value="<?=$docker_cfgfile?>">
<input type="hidden" name="#command" value="/plugins/dynamix/scripts/emhttpd_update">
Enable Docker:
@@ -197,10 +220,43 @@ Template Authoring Mode:
<?if ($DockerStopped):?>
DHCPv4 pool of custom network <?=$network?> (optional):
: <input type="text" name="<?=$docker_dhcp?>" value="<?=$dockercfg[$docker_dhcp]?>" class="narrow">Subnet: <span id="<?=$docker_dhcp?>"><?=$route?></span>
<?
$dhcp = $dockercfg[$docker_dhcp] ?? false;
$disabled = $dhcp ? '':'disabled';
$net = base_min($route);
$max = base_max($route);
$mask = explode('/',$route)[1];
$net_user = $dhcp ? base_min($dhcp) : $net;
$mask_user = $dhcp ? explode('/',$dhcp)[1] : $mask;
$size = pow(2,32-$mask_user);
switch (true) {
case ($mask < 16): $prefix = $net[0]; $box = 1; break;
case ($mask < 24): $prefix = $net[0].'.'.$net[1]; $box = 2; break;
case ($mask < 32): $prefix = $net[0].'.'.$net[1].'.'.$net[2]; $box = 3 ;break;
}
?>
: <input type="checkbox" id="<?=$docker_dhcp?>_edit" onchange="changeEdit(this.id)"<?=$dhcp?'checked':''?>>
<span id="<?=$docker_dhcp?>_net" class="net <?=$disabled?>"><?=$prefix?>.</span><?
for ($b=$box; $b<=3; $b++) {
switch ($b) {
case 1: $step = $size/65536%256; break;
case 2: $step = $size/256%256; break;
case 3: $step = $size%256; break;
}
if ($step===0) $step = 256;
echo "<select id=\"{$docker_dhcp}_{$b}\" class=\"net\" $disabled>";
for ($n=$net[$b]; $n<=$max[$b]; $n++) echo mk_option($net_user[$b],$n,$n,$n%$step==0?'':'class="hide"');
echo "</select>";
}
echo "/";
echo "<select id=\"{$docker_dhcp}_mask\" class=\"mask\" onchange=\"changeMask(this.id)\" $disabled>";
for ($m=$mask; $m<=30; $m++) echo mk_option($mask_user,$m,$m);
echo "</select><span id=\"{$docker_dhcp}_size\" style=\"".($dhcp?'':'display:none')."\">($size hosts)</span>";
echo "<input type=\"hidden\" name=\"$docker_dhcp\" value=\"\">";
?>
<?elseif ($dockercfg[$docker_dhcp]):?>
DHCPv4 pool of custom network <?=$network?>:
: <?=$dockercfg[$docker_dhcp]?>
: <?=$dockercfg[$docker_dhcp]?>&nbsp;&nbsp;(<?=pow(2,32-explode('/',$dockercfg[$docker_dhcp])[1])?> hosts)
<?endif;?>
<?endforeach;?>
@@ -211,7 +267,21 @@ DHCPv4 pool of custom network <?=$network?>:
<?if ($DockerStopped):?>
DHCPv6 pool of custom network <?=$network?> (optional):
: <input type="text" name="<?=$docker_dhcp6?>" value="<?=$dockercfg[$docker_dhcp6]?>" class="narrow">Subnet: <span id="<?=$docker_dhcp6?>"><?=$route?></span>
<?
$dhcp = $dockercfg[$docker_dhcp6] ?? false;
$disabled = $dhcp ? '':'disabled';
$net = base_net($route);
$mask = explode('/',$route)[1];
$net_user = $dhcp ? str_replace("$net:","",base_net($dhcp)) : '';
$mask_user = $dhcp ? explode('/',$dhcp)[1] : $mask;
?>
: <input type="checkbox" id="<?=$docker_dhcp6?>_edit" onchange="changeEdit6(this.id)"<?=$dhcp?'checked':''?>>
<span id="<?=$docker_dhcp6?>_net" class="net <?=$disabled?>"><?=$net?>:</span><?
echo "<input type=\"text\" id=\"{$docker_dhcp6}_text\" value=\"$net_user\" class=\"net\" $disabled>/";
echo "<select id=\"{$docker_dhcp6}_mask\" class=\"mask\" $disabled>";
for ($m=$mask; $m<=120; $m+=8) echo mk_option($mask_user,$m,$m);
echo "</select><input type=\"hidden\" name=\"$docker_dhcp6\" value=\"\">";
?>
<?elseif ($dockercfg[$docker_dhcp6]):?>
DHCPv6 pool of custom network <?=$network?>:
: <?=$dockercfg[$docker_dhcp6]?>
@@ -268,6 +338,67 @@ btrfs scrub status:
<script src="/webGui/javascript/jquery.filetree.js"></script>
<script src="/webGui/javascript/jquery.switchbutton.js"></script>
<script>
function prepareDocker(form) {
$(form).find('input:hidden[name^="DOCKER_DHCP_"]').each(function(){
var id = '#'+$(this).attr('name')+'_';
if ($(id+'edit').prop('checked')) {
var net = $(id+'net').text();
for (var b=1; b<=3; b++) if ($(id+b).length>0) net += $(id+b).val()+'.';
net = net.replace(/\.$/,'/')+$(id+'mask').val();
$(this).val(net);
}
});
$(form).find('input:hidden[name^="DOCKER_DHCP6_"]').each(function(){
var id = '#'+$(this).attr('name')+'_';
if ($(id+'edit').prop('checked')) {
var net = $(id+'net').text()+$(id+'text').val();
if (net.substr(-2)!='::') net += '::';
$(this).val(net+'/'+$(id+'mask').val());
}
});
}
function changeEdit(id) {
var checked = $('#'+id).prop('checked');
id = '#'+id.substr(0,id.length-4);
for (var b=1; b<=3; b++) if ($(id+b).length>0) $(id+b).prop('disabled',!checked);
$(id+'mask').prop('disabled',!checked);
if (checked) {
$(id+'size').show();
$(id+'net').removeClass('disabled');
} else {
$(id+'size').hide();
$(id+'net').addClass('disabled','disabled');
}
}
function changeEdit6(id) {
var checked = $('#'+id).prop('checked');
id = '#'+id.substr(0,id.length-4);
$(id+'text').prop('disabled',!checked);
$(id+'mask').prop('disabled',!checked);
if (checked) {
$(id+'net').removeClass('disabled');
} else {
$(id+'net').addClass('disabled','disabled');
}
}
function changeMask(id) {
var mask = Math.pow(2,32-$('#'+id).val());
id = '#'+id.substr(0,id.length-4);
$(id+'size').html('('+mask+' hosts)');
for (var b=1; b<=3; b++) {
var cell = id+b;
switch (b) {
case 1: var step = mask/65536%256; break;
case 2: var step = mask/256%256; break;
case 3: var step = mask%256; break;
}
if (step==0) step = 256;
if ($(cell).length==0) continue;
var max = $(cell+' option').size();
for (var i=0; i < max; i++) if (i%step==0) $(cell+' option:eq('+i+')').removeClass('hide'); else $(cell+' option:eq('+i+')').addClass('hide');
if ($(cell+' option:selected').val()%step!=0) $(cell+' option:selected').removeAttr('selected');
}
}
function ip2int(ip) {
return ip.split('.').reduce(function(ipInt,octet){return (ipInt<<8)+parseInt(octet,10)},0)>>>0;
}
@@ -284,8 +415,8 @@ function checkDHCPv4() {
if (typeof(base[1])=='undefined') base[1] = 32;
var toppool = ip2int(pool[0]);
var topbase = ip2int(base[0]);
var endpool = toppool+2**(32-pool[1]);
var endbase = topbase+2**(32-base[1]);
var endpool = toppool+Math.pow(2,32-pool[1]);
var endbase = topbase+Math.pow(2,32-base[1]);
if (good && (toppool < topbase || endpool > endbase)) {good = false; swal('Invalid pool address','Pool address is out of range','error');}
}
});
@@ -331,7 +462,7 @@ $(function() {
var image = $("#DOCKER_IMAGE_FILE").val();
target = $("#IMAGE_ERROR");
$.getJSON( "/plugins/dynamix.docker.manager/include/UpdateConfig.php?is_dir=" + image).done(function( json ) {
$.getJSON( "/plugins/dynamix.docker.manager/include/UpdateConfig.php?is_dir=" + image).done(function(json) {
if (json.is_dir === true){
target.fadeIn().html('Error: must be a file; directory provided.');
isError = true;
@@ -401,7 +532,7 @@ $(function() {
$('.advancedview').change(function () {
$('.advanced').toggle('slow');
$('.basic').toggle('slow');
$.cookie('dockersettings_view_mode', $('.advancedview').is(':checked') ? 'advanced' : 'basic', { expires: 3650 });
$.cookie('dockersettings_view_mode', $('.advancedview').is(':checked') ? 'advanced':'basic', {expires:3650});
});
showStatus('pid','dockerd');

View File

@@ -70,13 +70,15 @@ $vlan_eth0 = [0];
if (isset($eth0)) foreach ($eth0 as $key => $val) if (strpos($key,$vlan_id)===0) $vlan_eth0[] = substr($key,strlen($vlan_id));
?>
<style>
span.pin i{font-size:16px;cursor:pointer;}
span.red{color:#E68A00;}
span.blue{color:#00529B;}
span.green{color:#4F8A10;}
span.pin i{font-size:16px;cursor:pointer}
span.red{color:#E68A00}
span.blue{color:#00529B}
span.green{color:#4F8A10}
input.gap{margin-right:10px}
div.shade-white{background-color:#F8F8F8;}
div.shade-black{background-color:#0C0C0C;}
div.shade-white{background-color:#F8F8F8}
div.shade-black{background-color:#0C0C0C}
select.slim{min-width:45px}
input.slim{width:32px}
</style>
<script>
<?if ($build):?>
@@ -217,24 +219,15 @@ function checkNetworkSettings(form,index,open) {
var protocol = $(form).find('select[name="PROTOCOL:'+index+'"]').val() || 'ipv4';
if (protocol != 'ipv6') {
$(form).find('input[name="IPADDR:'+index+'"]').prop('disabled',disabled).prop('required',!disabled);
var netmask = $(form).find('select[name="NETMASK:'+index+'"]');
var gateway = $(form).find('input[name="GATEWAY:'+index+'"]');
netmask.prop('disabled',disabled);
gateway.prop('disabled',disabled);
if (!disabled) {
var none = netmask.find('option[value="none"]');
if (none.length) {netmask.val('255.255.255.0'); none.remove();}
}
$(form).find('select[name="NETMASK:'+index+'"]').prop('disabled',disabled);
$(form).find('input[name="GATEWAY:'+index+'"]').prop('disabled',disabled);
}
if (protocol != 'ipv4') {
$(form).find('input[name="IPADDR6:'+index+'"]').prop('disabled',disabled).prop('required',!disabled);
var netmask6 = $(form).find('input[name="NETMASK6:'+index+'"]');
var gateway6 = $(form).find('input[name="GATEWAY6:'+index+'"]');
var privacy6 = $(form).find('select[name="PRIVACY6:'+index+'"]');
netmask6.prop('disabled',disabled).prop('required',!disabled);
gateway6.prop('disabled',disabled);
privacy6.prop('disabled',!disabled);
if (!open) privacy6.val(disabled ? 0 : 2);
$(form).find('input[name="NETMASK6:'+index+'"]').prop('disabled',disabled).prop('required',!disabled);
$(form).find('input[name="GATEWAY6:'+index+'"]').prop('disabled',disabled);
var privacy = $(form).find('select[name="PRIVACY6:'+index+'"]');
privacy.prop('disabled',!disabled); if (!open) privacy.val(disabled ? 0 : 2);
}
if (dns && index==0) {
if (!open) form.DHCP_KEEPRESOLV.value = disabled ? 'no' : 'yes';
@@ -311,9 +304,9 @@ function removeVLAN(element,disabled) {
$(element).remove();
$('#index-'+id[1]+'-0').find('select').first().trigger('change');
}
function disableForm(form,member) {
function disableForm(form) {
$(form).find('input,select').not('input[value="Done"]').prop('disabled',true);
if (member) $(form).find('input[name^="DESCRIPTION"],input[name^="#"]').prop('disabled',false);
$(form).find('input[name^="DESCRIPTION"],input[name^="#"]').prop('disabled',false);
}
var stopEvent = false;
function exitCode(form,key) {
@@ -472,44 +465,34 @@ IP address assignment:
<div class="eth0-ipv4-<?=$i?>" style="display:none" markdown="1">
IPv4 address:
: <input type="text" name="IPADDR:<?=$i?>" maxlength="15" value="<?=$eth0["IPADDR:$i"]?>" class="narrow" pattern="<?=$validIP4?>" title="IPv4 address A.B.C.D">
> Greyed out when using automatic IP assignment. Otherwise specify here the IPv4 address of the system.
IPv4 network mask:
: <select name="NETMASK:<?=$i?>" size="1">
<?=mk_option($eth0["NETMASK:$i"], "255.255.0.0", "255.255.0.0");?>
<?=mk_option($eth0["NETMASK:$i"], "255.255.252.0", "255.255.252.0");?>
<?=mk_option($eth0["NETMASK:$i"], "255.255.254.0", "255.255.254.0");?>
<?=mk_option($eth0["NETMASK:$i"], "255.255.255.0", "255.255.255.0");?>
<?=mk_option($eth0["NETMASK:$i"], "255.255.255.128", "255.255.255.128");?>
<?=mk_option($eth0["NETMASK:$i"], "255.255.255.192", "255.255.255.192");?>
<?=mk_option($eth0["NETMASK:$i"], "255.255.255.224", "255.255.255.224");?>
<?=mk_option($eth0["NETMASK:$i"], "255.255.255.240", "255.255.255.240");?>
<?=mk_option($eth0["NETMASK:$i"], "255.255.255.248", "255.255.255.248");?>
<?=mk_option($eth0["NETMASK:$i"], "255.255.255.252", "255.255.255.252");?>
: <input type="text" name="IPADDR:<?=$i?>" maxlength="15" value="<?=$eth0["IPADDR:$i"]?>" class="narrow" pattern="<?=$validIP4?>" title="IPv4 address A.B.C.D">/ <select name="NETMASK:<?=$i?>" size="1" class="slim">
<?=mk_option($eth0["NETMASK:$i"], "255.255.0.0", "16");?>
<?=mk_option($eth0["NETMASK:$i"], "255.255.252.0", "22");?>
<?=mk_option($eth0["NETMASK:$i"], "255.255.254.0", "23");?>
<?=mk_option($eth0["NETMASK:$i"], "255.255.255.0", "24", $eth0["IPADDR:$i"]?"":"selected");?>
<?=mk_option($eth0["NETMASK:$i"], "255.255.255.128", "25");?>
<?=mk_option($eth0["NETMASK:$i"], "255.255.255.192", "26");?>
<?=mk_option($eth0["NETMASK:$i"], "255.255.255.224", "27");?>
<?=mk_option($eth0["NETMASK:$i"], "255.255.255.240", "28");?>
<?=mk_option($eth0["NETMASK:$i"], "255.255.255.248", "29");?>
<?=mk_option($eth0["NETMASK:$i"], "255.255.255.252", "30");?>
</select>
> Greyed out when using automatic IP assignment. Otherwise specify here the associated network mask, by default 255.255.255.0 is selected.
> Greyed out when using automatic IP assignment. Otherwise specify here the IPv4 address and mask of the system.
IPv4 default gateway:
: <input type="text" name="GATEWAY:<?=$i?>" maxlength="15" value="<?=$eth0["GATEWAY:$i"]?>" class="narrow" pattern="<?=$validIP4?>" title="IPv4 address A.B.C.D">
<input type="text" name="METRIC:<?=$i?>" min="1" max="9999" value="<?=$eth0["METRIC:$i"]?>" class="trim"><i class="fa fa-sort-numeric-asc"></i> <em>optional metric (lowest is preferred)</em>
<input type="text" name="METRIC:<?=$i?>" min="1" max="9999" value="<?=$eth0["METRIC:$i"]?>" class="slim"><i class="fa fa-sort-numeric-asc"></i> <em>optional metric (lowest is preferred)</em>
> Greyed out when using automatic IP assignment. Otherwise specify here the IPv4 address of your router.
</div>
<div class="eth0-ipv6-<?=$i?>" style="display:none" markdown="1">
IPv6 address:
: <input type="text" name="IPADDR6:<?=$i?>" maxlength="39" value="<?=$eth0["IPADDR6:$i"]?>" pattern="<?=$validIP6?>" title="IPv6 address nnnn:xxxx::yyyy">
: <input type="text" name="IPADDR6:<?=$i?>" maxlength="39" value="<?=$eth0["IPADDR6:$i"]?>" pattern="<?=$validIP6?>" title="IPv6 address nnnn:xxxx::yyyy">/ <input type="number" name="NETMASK6:<?=$i?>" min="1" max="128" value="<?=$eth0["NETMASK6:$i"]?>" class="slim">
> Greyed out when using automatic IP assignment. Otherwise specify here the IPv6 address of the system.
IPv6 prefix:
: <input type="number" name="NETMASK6:<?=$i?>" min="1" max="128" value="<?=$eth0["NETMASK6:$i"]?>" class="trim">
> Greyed out when using automatic IP assignment. Otherwise specify here the associated prefix value of 1 to 128.
IPv6 default gateway:
: <input type="text" name="GATEWAY6:<?=$i?>" maxlength="39" value="<?=$eth0["GATEWAY6:$i"]?>" pattern="<?=$validIP6?>" title="IPv6 address nnnn:xxxx::yyyy">
@@ -628,43 +611,33 @@ IP address assignment:
<div class="eth0-ipv4-<?=$i?>" style="display:none" markdown="1">
IPv4 address:
: <input type="text" name="IPADDR:<?=$i?>" maxlength="15" value="<?=$eth0["IPADDR:$i"]?>" class="narrow" pattern="<?=$validIP4?>" title="IPv4 address A.B.C.D">
> Greyed out when using automatic IP assignment. Otherwise specify here the IPv4 address of the system.
IPv4 network mask:
: <select name="NETMASK:<?=$i?>" size="1">
<?=mk_option($eth0["NETMASK:$i"], "255.255.0.0", "255.255.0.0");?>
<?=mk_option($eth0["NETMASK:$i"], "255.255.252.0", "255.255.252.0");?>
<?=mk_option($eth0["NETMASK:$i"], "255.255.254.0", "255.255.254.0");?>
<?=mk_option($eth0["NETMASK:$i"], "255.255.255.0", "255.255.255.0");?>
<?=mk_option($eth0["NETMASK:$i"], "255.255.255.128", "255.255.255.128");?>
<?=mk_option($eth0["NETMASK:$i"], "255.255.255.192", "255.255.255.192");?>
<?=mk_option($eth0["NETMASK:$i"], "255.255.255.224", "255.255.255.224");?>
<?=mk_option($eth0["NETMASK:$i"], "255.255.255.240", "255.255.255.240");?>
<?=mk_option($eth0["NETMASK:$i"], "255.255.255.248", "255.255.255.248");?>
<?=mk_option($eth0["NETMASK:$i"], "255.255.255.252", "255.255.255.252");?>
: <input type="text" name="IPADDR:<?=$i?>" maxlength="15" value="<?=$eth0["IPADDR:$i"]?>" class="narrow" pattern="<?=$validIP4?>" title="IPv4 address A.B.C.D">/ <select name="NETMASK:<?=$i?>" size="1" class="slim">
<?=mk_option($eth0["NETMASK:$i"], "255.255.0.0", "16");?>
<?=mk_option($eth0["NETMASK:$i"], "255.255.252.0", "22");?>
<?=mk_option($eth0["NETMASK:$i"], "255.255.254.0", "23");?>
<?=mk_option($eth0["NETMASK:$i"], "255.255.255.0", "24", $eth0["IPADDR:$i"]?"":"selected");?>
<?=mk_option($eth0["NETMASK:$i"], "255.255.255.128", "25");?>
<?=mk_option($eth0["NETMASK:$i"], "255.255.255.192", "26");?>
<?=mk_option($eth0["NETMASK:$i"], "255.255.255.224", "27");?>
<?=mk_option($eth0["NETMASK:$i"], "255.255.255.240", "28");?>
<?=mk_option($eth0["NETMASK:$i"], "255.255.255.248", "29");?>
<?=mk_option($eth0["NETMASK:$i"], "255.255.255.252", "30");?>
</select>
> Greyed out when using automatic IP assignment. Otherwise specify here the associated network mask, by default 255.255.255.0 is selected.
> Greyed out when using automatic IP assignment. Otherwise specify here the IPv4 address and mask of the system.
IPv4 default gateway:
: <input type="text" name="GATEWAY:<?=$i?>" maxlength="15" value="<?=$eth0["GATEWAY:$i"]?>" class="narrow" pattern="<?=$validIP4?>" title="IPv4 address A.B.C.D">
<input type="text" name="METRIC:<?=$i?>" min="1" max="9999" value="<?=$eth0["METRIC:$i"]?>" class="trim"><i class="fa fa-sort-numeric-asc"></i> <em>optional metric (lowest is preferred)</em>
<input type="text" name="METRIC:<?=$i?>" min="1" max="9999" value="<?=$eth0["METRIC:$i"]?>" class="slim"><i class="fa fa-sort-numeric-asc"></i> <em>optional metric (lowest is preferred)</em>
> Greyed out when using automatic IP assignment. Otherwise specify here the IPv4 address of your router.
</div>
<div class="eth0-ipv6-<?=$i?>" style="display:none" markdown="1">
IPv6 address:
: <input type="text" name="IPADDR6:<?=$i?>" maxlength="39" value="<?=$eth0["IPADDR6:$i"]?>" pattern="<?=$validIP6?>" title="IPv6 address nnnn:xxxx::yyyy">
: <input type="text" name="IPADDR6:<?=$i?>" maxlength="39" value="<?=$eth0["IPADDR6:$i"]?>" pattern="<?=$validIP6?>" title="IPv6 address nnnn:xxxx::yyyy">/ <input type="number" name="NETMASK6:<?=$i?>" min="1" max="128" value="<?=$eth0["NETMASK6:$i"]?>" class="slim">
> Greyed out when using automatic IP assignment. Otherwise specify here the IPv6 address of the system.
IPv6 prefix:
: <input type="number" name="NETMASK6:<?=$i?>" min="1" max="128" value="<?=$eth0["NETMASK6:$i"]?>" class="trim">
> Greyed out when using automatic IP assignment. Otherwise specify here the associated prefix value of 1 to 128.
> Greyed out when using automatic IP assignment. Otherwise specify here the IPv6 address and prefix of the system.
IPv6 default gateway:
: <input type="text" name="GATEWAY6:<?=$i?>" maxlength="39" value="<?=$eth0["GATEWAY6:$i"]?>" pattern="<?=$validIP6?>" title="IPv6 address nnnn:xxxx::yyyy">
@@ -720,43 +693,33 @@ IP address assignment:
<div class="eth0-ipv4-INDEX" style="display:none" markdown="1">
IPv4 address:
: <input type="text" name="IPADDR:INDEX" maxlength="15" value="<?=$eth0["IPADDR:INDEX"]?>" class="narrow" pattern="<?=$validIP4?>" title="IPv4 address A.B.C.D">
> Greyed out when using automatic IP assignment or NONE assignment. Otherwise specify here the IPv4 address of the system.
IPv4 network mask:
: <select name="NETMASK:INDEX" size="1">
<?=mk_option($eth0["NETMASK:INDEX"], "255.255.0.0", "255.255.0.0");?>
<?=mk_option($eth0["NETMASK:INDEX"], "255.255.252.0", "255.255.252.0");?>
<?=mk_option($eth0["NETMASK:INDEX"], "255.255.254.0", "255.255.254.0");?>
<?=mk_option($eth0["NETMASK:INDEX"], "255.255.255.0", "255.255.255.0");?>
<?=mk_option($eth0["NETMASK:INDEX"], "255.255.255.128", "255.255.255.128");?>
<?=mk_option($eth0["NETMASK:INDEX"], "255.255.255.192", "255.255.255.192");?>
<?=mk_option($eth0["NETMASK:INDEX"], "255.255.255.224", "255.255.255.224");?>
<?=mk_option($eth0["NETMASK:INDEX"], "255.255.255.240", "255.255.255.240");?>
<?=mk_option($eth0["NETMASK:INDEX"], "255.255.255.248", "255.255.255.248");?>
<?=mk_option($eth0["NETMASK:INDEX"], "255.255.255.252", "255.255.255.252");?>
: <input type="text" name="IPADDR:INDEX" maxlength="15" value="<?=$eth0["IPADDR:INDEX"]?>" class="narrow" pattern="<?=$validIP4?>" title="IPv4 address A.B.C.D">/ <select name="NETMASK:INDEX" size="1" class="slim">
<?=mk_option($eth0["NETMASK:INDEX"], "255.255.0.0", "16");?>
<?=mk_option($eth0["NETMASK:INDEX"], "255.255.252.0", "22");?>
<?=mk_option($eth0["NETMASK:INDEX"], "255.255.254.0", "23");?>
<?=mk_option($eth0["NETMASK:INDEX"], "255.255.255.0", "24", "selected");?>
<?=mk_option($eth0["NETMASK:INDEX"], "255.255.255.128", "25");?>
<?=mk_option($eth0["NETMASK:INDEX"], "255.255.255.192", "26");?>
<?=mk_option($eth0["NETMASK:INDEX"], "255.255.255.224", "27");?>
<?=mk_option($eth0["NETMASK:INDEX"], "255.255.255.240", "28");?>
<?=mk_option($eth0["NETMASK:INDEX"], "255.255.255.248", "29");?>
<?=mk_option($eth0["NETMASK:INDEX"], "255.255.255.252", "30");?>
</select>
> Greyed out when using automatic IP assignment or NONE assignment. Otherwise specify here the associated network mask, by default 255.255.255.0 is selected.
> Greyed out when using automatic IP assignment or NONE assignment. Otherwise specify here the IPv4 address and mask of the system.
IPv4 default gateway:
: <input type="text" name="GATEWAY:INDEX" maxlength="15" value="<?=$eth0["GATEWAY:INDEX"]?>" class="narrow" pattern="<?=$validIP4?>" title="IPv4 address A.B.C.D">
<input type="text" name="METRIC:INDEX" min="1" max="9999" value="<?=$eth0["METRIC:INDEX"]?>" class="trim"><i class="fa fa-sort-numeric-asc"></i> <em>optional metric (lowest is preferred)</em>
<input type="text" name="METRIC:INDEX" min="1" max="9999" value="<?=$eth0["METRIC:INDEX"]?>" class="slim"><i class="fa fa-sort-numeric-asc"></i> <em>optional metric (lowest is preferred)</em>
> Greyed out when using automatic IP assignment. Otherwise specify here the IPv4 address of your router.
</div>
<div class="eth0-ipv6-INDEX" style="display:none" markdown="1">
IPv6 address:
: <input type="text" name="IPADDR6:INDEX" maxlength="39" value="<?=$eth0["IPADDR6:INDEX"]?>" pattern="<?=$validIP6?>" title="IPv6 address nnnn:xxxx::yyyy">
: <input type="text" name="IPADDR6:INDEX" maxlength="39" value="<?=$eth0["IPADDR6:INDEX"]?>" pattern="<?=$validIP6?>" title="IPv6 address nnnn:xxxx::yyyy">/ <input type="number" name="NETMASK6:INDEX" min="1" max="128" value="<?=$eth0["NETMASK6:INDEX"]?>" class="slim">
> Greyed out when using automatic IP assignment. Otherwise specify here the IPv6 address of the system.
IPv6 prefix:
: <input type="number" name="NETMASK6:INDEX" min="1" max="128" value="<?=$eth0["NETMASK6:INDEX"]?>" class="trim">
> Greyed out when using automatic IP assignment. Otherwise specify here the associated prefix value of 1 to 128.
> Greyed out when using automatic IP assignment. Otherwise specify here the IPv6 address and prefix of the system.
IPv6 default gateway:
: <input type="text" name="GATEWAY6:INDEX" maxlength="39" value="<?=$eth0["GATEWAY6:INDEX"]?>" pattern="<?=$validIP6?>" title="IPv6 address nnnn:xxxx::yyyy">

View File

@@ -72,7 +72,7 @@ $(function() {
});
<?endif;?>
<?if ($locked || $service):?>
disableForm(form,true);
disableForm(form);
<?endif;?>
<?if ($no_eth0):?>
$('input[name="#shut_ethX"]').prop('disabled',true);
@@ -185,43 +185,33 @@ IP address assignment:
<div class="ethX-ipv4-<?=$i?>" style="display:none" markdown="1">
IPv4 address:
: <input type="text" name="IPADDR:<?=$i?>" maxlength="15" value="<?=$ethX["IPADDR:$i"]?>" class="narrow" pattern="<?=$validIP4?>" title="IPv4 address A.B.C.D">
> Greyed out when using automatic IP assignment. Otherwise specify here the IPv4 address of the interface.
IPv4 network mask:
: <select name="NETMASK:<?=$i?>" size="1">
<?=mk_option($ethX["NETMASK:$i"], "255.255.0.0", "255.255.0.0");?>
<?=mk_option($ethX["NETMASK:$i"], "255.255.252.0", "255.255.252.0");?>
<?=mk_option($ethX["NETMASK:$i"], "255.255.254.0", "255.255.254.0");?>
<?=mk_option($ethX["NETMASK:$i"], "255.255.255.0", "255.255.255.0");?>
<?=mk_option($ethX["NETMASK:$i"], "255.255.255.128", "255.255.255.128");?>
<?=mk_option($ethX["NETMASK:$i"], "255.255.255.192", "255.255.255.192");?>
<?=mk_option($ethX["NETMASK:$i"], "255.255.255.224", "255.255.255.224");?>
<?=mk_option($ethX["NETMASK:$i"], "255.255.255.240", "255.255.255.240");?>
<?=mk_option($ethX["NETMASK:$i"], "255.255.255.248", "255.255.255.248");?>
<?=mk_option($ethX["NETMASK:$i"], "255.255.255.252", "255.255.255.252");?>
: <input type="text" name="IPADDR:<?=$i?>" maxlength="15" value="<?=$ethX["IPADDR:$i"]?>" class="narrow" pattern="<?=$validIP4?>" title="IPv4 address A.B.C.D">/ <select name="NETMASK:<?=$i?>" size="1" class="slim">
<?=mk_option($ethX["NETMASK:$i"], "255.255.0.0", "16");?>
<?=mk_option($ethX["NETMASK:$i"], "255.255.252.0", "22");?>
<?=mk_option($ethX["NETMASK:$i"], "255.255.254.0", "23");?>
<?=mk_option($ethX["NETMASK:$i"], "255.255.255.0", "24", $ethX["IPADDR:$i"]?"":"selected");?>
<?=mk_option($ethX["NETMASK:$i"], "255.255.255.128", "25");?>
<?=mk_option($ethX["NETMASK:$i"], "255.255.255.192", "26");?>
<?=mk_option($ethX["NETMASK:$i"], "255.255.255.224", "27");?>
<?=mk_option($ethX["NETMASK:$i"], "255.255.255.240", "28");?>
<?=mk_option($ethX["NETMASK:$i"], "255.255.255.248", "29");?>
<?=mk_option($ethX["NETMASK:$i"], "255.255.255.252", "30");?>
</select>
> Greyed out when using automatic IP assignment. Otherwise specify here the associated network mask, by default 255.255.255.0 is selected.
> Greyed out when using automatic IP assignment. Otherwise specify here the IPv4 address and mask of the interface.
IPv4 default gateway:
: <input type="text" name="GATEWAY:<?=$i?>" maxlength="15" value="<?=$ethX["GATEWAY:$i"]?>" class="narrow" pattern="<?=$validIP4?>" title="IPv4 address A.B.C.D">
<input type="text" name="METRIC:<?=$i?>" min="1" max="9999" value="<?=$ethX["METRIC:$i"]?>" class="trim"><i class="fa fa-sort-numeric-asc"></i> <em>optional metric (lowest is preferred)</em>
<input type="text" name="METRIC:<?=$i?>" min="1" max="9999" value="<?=$ethX["METRIC:$i"]?>" class="slim"><i class="fa fa-sort-numeric-asc"></i> <em>optional metric (lowest is preferred)</em>
> Greyed out when using automatic IP assignment. Otherwise specify here the IPv4 address of your router.
</div>
<div class="ethX-ipv6-<?=$i?>" style="display:none" markdown="1">
IPv6 address:
: <input type="text" name="IPADDR6:<?=$i?>" maxlength="39" value="<?=$ethX["IPADDR6:$i"]?>" pattern="<?=$validIP6?>" title="IPv6 address nnnn:xxxx::yyyy">
: <input type="text" name="IPADDR6:<?=$i?>" maxlength="39" value="<?=$ethX["IPADDR6:$i"]?>" pattern="<?=$validIP6?>" title="IPv6 address nnnn:xxxx::yyyy">/ <input type="number" name="NETMASK6:<?=$i?>" min="1" max="128" value="<?=$ethX["NETMASK6:$i"]?>" class="slim">
> Greyed out when using automatic IP assignment. Otherwise specify here the IPv6 address of the interface.
IPv6 prefix:
: <input type="number" name="NETMASK6:<?=$i?>" min="1" max="128" value="<?=$ethX["NETMASK6:$i"]?>" class="trim">
> Greyed out when using automatic IP assignment. Otherwise specify here the associated prefix value of 1 to 128.
> Greyed out when using automatic IP assignment. Otherwise specify here the IPv6 address and prefix of the interface.
IPv6 default gateway:
: <input type="text" name="GATEWAY6:<?=$i?>" maxlength="39" value="<?=$ethX["GATEWAY6:$i"]?>" pattern="<?=$validIP6?>" title="IPv6 address nnnn:xxxx::yyyy">
@@ -284,43 +274,33 @@ IP address assignment:
<div class="ethX-ipv4-<?=$i?>" style="display:none" markdown="1">
IPv4 address:
: <input type="text" name="IPADDR:<?=$i?>" maxlength="15" value="<?=$ethX["IPADDR:$i"]?>" class="narrow" pattern="<?=$validIP4?>" title="IPv4 address A.B.C.D">
> Greyed out when using automatic IP assignment or NONE assignment. Otherwise specify here the IPv4 address of the interface.
IPv4 network mask:
: <select name="NETMASK:<?=$i?>" size="1">
<?=mk_option($ethX["NETMASK:$i"], "255.255.0.0", "255.255.0.0");?>
<?=mk_option($ethX["NETMASK:$i"], "255.255.252.0", "255.255.252.0");?>
<?=mk_option($ethX["NETMASK:$i"], "255.255.254.0", "255.255.254.0");?>
<?=mk_option($ethX["NETMASK:$i"], "255.255.255.0", "255.255.255.0");?>
<?=mk_option($ethX["NETMASK:$i"], "255.255.255.128", "255.255.255.128");?>
<?=mk_option($ethX["NETMASK:$i"], "255.255.255.192", "255.255.255.192");?>
<?=mk_option($ethX["NETMASK:$i"], "255.255.255.224", "255.255.255.224");?>
<?=mk_option($ethX["NETMASK:$i"], "255.255.255.240", "255.255.255.240");?>
<?=mk_option($ethX["NETMASK:$i"], "255.255.255.248", "255.255.255.248");?>
<?=mk_option($ethX["NETMASK:$i"], "255.255.255.252", "255.255.255.252");?>
: <input type="text" name="IPADDR:<?=$i?>" maxlength="15" value="<?=$ethX["IPADDR:$i"]?>" class="narrow" pattern="<?=$validIP4?>" title="IPv4 address A.B.C.D">/ <select name="NETMASK:<?=$i?>" size="1" class="slim">
<?=mk_option($ethX["NETMASK:$i"], "255.255.0.0", "16");?>
<?=mk_option($ethX["NETMASK:$i"], "255.255.252.0", "22");?>
<?=mk_option($ethX["NETMASK:$i"], "255.255.254.0", "23");?>
<?=mk_option($ethX["NETMASK:$i"], "255.255.255.0", "24", $ethX["IPADDR:$i"]?"":"selected");?>
<?=mk_option($ethX["NETMASK:$i"], "255.255.255.128", "25");?>
<?=mk_option($ethX["NETMASK:$i"], "255.255.255.192", "26");?>
<?=mk_option($ethX["NETMASK:$i"], "255.255.255.224", "27");?>
<?=mk_option($ethX["NETMASK:$i"], "255.255.255.240", "28");?>
<?=mk_option($ethX["NETMASK:$i"], "255.255.255.248", "29");?>
<?=mk_option($ethX["NETMASK:$i"], "255.255.255.252", "30");?>
</select>
> Greyed out when using automatic IP assignment or NONE assignment. Otherwise specify here the associated network mask, by default 255.255.255.0 is selected.
> Greyed out when using automatic IP assignment or NONE assignment. Otherwise specify here the IPv4 address and mask of the interface.
IPv4 default gateway:
: <input type="text" name="GATEWAY:<?=$i?>" maxlength="15" value="<?=$ethX["GATEWAY:$i"]?>" class="narrow" pattern="<?=$validIP4?>" title="IPv4 address A.B.C.D">
<input type="text" name="METRIC:<?=$i?>" min="1" max="9999" value="<?=$ethX["METRIC:$i"]?>" class="trim"><i class="fa fa-sort-numeric-asc"></i> <em>optional metric (lowest is preferred)</em>
<input type="text" name="METRIC:<?=$i?>" min="1" max="9999" value="<?=$ethX["METRIC:$i"]?>" class="slim"><i class="fa fa-sort-numeric-asc"></i> <em>optional metric (lowest is preferred)</em>
> Greyed out when using automatic IP assignment. Otherwise specify here the IPv4 address of your router.
</div>
<div class="ethX-ipv6-<?=$i?>" style="display:none" markdown="1">
IPv6 address:
: <input type="text" name="IPADDR6:<?=$i?>" maxlength="39" value="<?=$ethX["IPADDR6:$i"]?>" pattern="<?=$validIP6?>" title="IPv6 address nnnn:xxxx::yyyy">
: <input type="text" name="IPADDR6:<?=$i?>" maxlength="39" value="<?=$ethX["IPADDR6:$i"]?>" pattern="<?=$validIP6?>" title="IPv6 address nnnn:xxxx::yyyy">/ <input type="number" name="NETMASK6:<?=$i?>" min="1" max="128" value="<?=$ethX["NETMASK6:$i"]?>" class="slim">
> Greyed out when using automatic IP assignment. Otherwise specify here the IPv6 address of the interface.
IPv6 prefix:
: <input type="number" name="NETMASK6:<?=$i?>" min="1" max="128" value="<?=$ethX["NETMASK6:$i"]?>" class="trim">
> Greyed out when using automatic IP assignment. Otherwise specify here the associated prefix value of 1 to 128.
> Greyed out when using automatic IP assignment. Otherwise specify here the IPv6 address and prefix of the interface.
IPv6 default gateway:
: <input type="text" name="GATEWAY6:<?=$i?>" maxlength="39" value="<?=$ethX["GATEWAY6:$i"]?>" pattern="<?=$validIP6?>" title="IPv6 address nnnn:xxxx::yyyy">
@@ -376,43 +356,33 @@ IP address assignment:
<div class="ethX-ipv4-INDEX" style="display:none" markdown="1">
IPv4 address:
: <input type="text" name="IPADDR:INDEX" maxlength="15" value="<?=$ethX["IPADDR:INDEX"]?>" class="narrow" pattern="<?=$validIP4?>" title="IPv4 address A.B.C.D">
> Greyed out when using automatic IP assignment or NONE assignment. Otherwise specify here the IPv4 address of the interface.
IPv4 network mask:
: <select name="NETMASK:INDEX" size="1">
<?=mk_option($ethX["NETMASK:INDEX"], "255.255.0.0", "255.255.0.0");?>
<?=mk_option($ethX["NETMASK:INDEX"], "255.255.252.0", "255.255.252.0");?>
<?=mk_option($ethX["NETMASK:INDEX"], "255.255.254.0", "255.255.254.0");?>
<?=mk_option($ethX["NETMASK:INDEX"], "255.255.255.0", "255.255.255.0");?>
<?=mk_option($ethX["NETMASK:INDEX"], "255.255.255.128", "255.255.255.128");?>
<?=mk_option($ethX["NETMASK:INDEX"], "255.255.255.192", "255.255.255.192");?>
<?=mk_option($ethX["NETMASK:INDEX"], "255.255.255.224", "255.255.255.224");?>
<?=mk_option($ethX["NETMASK:INDEX"], "255.255.255.240", "255.255.255.240");?>
<?=mk_option($ethX["NETMASK:INDEX"], "255.255.255.248", "255.255.255.248");?>
<?=mk_option($ethX["NETMASK:INDEX"], "255.255.255.252", "255.255.255.252");?>
: <input type="text" name="IPADDR:INDEX" maxlength="15" value="<?=$ethX["IPADDR:INDEX"]?>" class="narrow" pattern="<?=$validIP4?>" title="IPv4 address A.B.C.D">/ <select name="NETMASK:INDEX" size="1" class="slim">
<?=mk_option($ethX["NETMASK:INDEX"], "255.255.0.0", "16");?>
<?=mk_option($ethX["NETMASK:INDEX"], "255.255.252.0", "22");?>
<?=mk_option($ethX["NETMASK:INDEX"], "255.255.254.0", "23");?>
<?=mk_option($ethX["NETMASK:INDEX"], "255.255.255.0", "24", "selected");?>
<?=mk_option($ethX["NETMASK:INDEX"], "255.255.255.128", "25");?>
<?=mk_option($ethX["NETMASK:INDEX"], "255.255.255.192", "26");?>
<?=mk_option($ethX["NETMASK:INDEX"], "255.255.255.224", "27");?>
<?=mk_option($ethX["NETMASK:INDEX"], "255.255.255.240", "28");?>
<?=mk_option($ethX["NETMASK:INDEX"], "255.255.255.248", "29");?>
<?=mk_option($ethX["NETMASK:INDEX"], "255.255.255.252", "30");?>
</select>
> Greyed out when using automatic IP assignment or NONE assignment. Otherwise specify here the associated network mask, by default 255.255.255.0 is selected.
> Greyed out when using automatic IP assignment or NONE assignment. Otherwise specify here the IPv4 address and mask of the interface.
IPv4 default gateway:
: <input type="text" name="GATEWAY:INDEX" maxlength="15" value="<?=$ethX["GATEWAY:INDEX"]?>" class="narrow" pattern="<?=$validIP4?>" title="IPv4 address A.B.C.D">
<input type="text" name="METRIC:INDEX" min="1" max="9999" value="<?=$ethX["METRIC:INDEX"]?>" class="trim"><i class="fa fa-sort-numeric-asc"></i> <em>optional metric (lowest is preferred)</em>
<input type="text" name="METRIC:INDEX" min="1" max="9999" value="<?=$ethX["METRIC:INDEX"]?>" class="slim"><i class="fa fa-sort-numeric-asc"></i> <em>optional metric (lowest is preferred)</em>
> Greyed out when using automatic IP assignment. Otherwise specify here the IPv4 address of your router.
</div>
<div class="ethX-ipv6-INDEX" style="display:none" markdown="1">
IPv6 address:
: <input type="text" name="IPADDR6:INDEX" maxlength="39" value="<?=$ethX["IPADDR6:INDEX"]?>" pattern="<?=$validIP6?>" title="IPv6 address nnnn:xxxx::yyyy">
: <input type="text" name="IPADDR6:INDEX" maxlength="39" value="<?=$ethX["IPADDR6:INDEX"]?>" pattern="<?=$validIP6?>" title="IPv6 address nnnn:xxxx::yyyy">/ <input type="number" name="NETMASK6:INDEX" min="1" max="128" value="<?=$ethX["NETMASK6:INDEX"]?>" class="slim">
> Greyed out when using automatic IP assignment. Otherwise specify here the IPv6 address of the interface.
IPv6 prefix:
: <input type="number" name="NETMASK6:INDEX" min="1" max="128" value="<?=$ethX["NETMASK6:INDEX"]?>" class="trim">
> Greyed out when using automatic IP assignment. Otherwise specify here the associated prefix value of 1 to 128.
> Greyed out when using automatic IP assignment. Otherwise specify here the IPv6 address and prefix of the interface.
IPv6 default gateway:
: <input type="text" name="GATEWAY6:INDEX" maxlength="39" value="<?=$ethX["GATEWAY6:INDEX"]?>" pattern="<?=$validIP6?>" title="IPv6 address nnnn:xxxx::yyyy">