diff --git a/plugins/dynamix/Eth0.page b/plugins/dynamix/Eth0.page index 7ad7ad10a..742f1850c 100644 --- a/plugins/dynamix/Eth0.page +++ b/plugins/dynamix/Eth0.page @@ -50,8 +50,9 @@ if (isset($eth0)) foreach ($eth0 as $key => $val) if (substr($key,0,6)=='VLANID' ?> @@ -220,6 +221,9 @@ function portcheck_eth0() { setTimeout(portcheck_eth0,10000); }); } +function portToggle(port,cmd) { + $.post('/webGui/include/PortToggle.php',{port:port,cmd:cmd},function(){refresh();}); +} $(function() { var ctrl = ""; var form = document.eth0_settings; diff --git a/plugins/dynamix/EthX.page b/plugins/dynamix/EthX.page index 82d75a0b9..63f047701 100644 --- a/plugins/dynamix/EthX.page +++ b/plugins/dynamix/EthX.page @@ -27,18 +27,24 @@ $locked = $bond_ethX || $bridge_ethX ; $vlan_ethX = [0]; if (!$locked && isset($ethX)) foreach ($ethX as $key => $val) if (substr($key,0,6)=='VLANID') $vlan_ethX[] = substr($key,7); -if ($bond_ethX) { +$cmd = 'Down'; +if (strlen(exec("ip link show ethX|grep -om1 ',UP[,>]'"))==0) { + $more = true; + $reason = "Interface is shutdown (inactive)"; + $class = 'blue'; + $cmd = 'Up'; +} elseif ($bond_ethX) { $more = true; $reason = "Interface is member of ".$eth0['BONDNAME']." (see interface eth0)"; - $class = 'member'; + $class = 'green'; } elseif ($bridge_ethX) { $more = true; $reason = "Interface is member of ".$eth0['BRNAME']." (see interface eth0)"; - $class = 'member'; -} elseif (empty($ethX) || strlen(exec("ip link show ethX|grep -om1 ',UP[,>]'"))==0) { + $class = 'green'; +} elseif (empty($ethX)) { $more = true; $reason = "Interface is not configured"; - $class = 'unset'; + $class = 'red'; } else { $more = false; } @@ -67,6 +73,9 @@ $(function() { disableForm(form,true); + +]'"))==0):?> + $('input[name="#shut"]').prop('disabled',true); setTimeout(portcheck_ethX,Number('ethX'.substr(3))*1000); }); @@ -254,5 +263,5 @@ Network mask:   -: STOPPED to change"?> +: STOPPED to change"?> diff --git a/plugins/dynamix/include/PortToggle.php b/plugins/dynamix/include/PortToggle.php new file mode 100644 index 000000000..782dafbaf --- /dev/null +++ b/plugins/dynamix/include/PortToggle.php @@ -0,0 +1,17 @@ + +