Merge pull request #25 from bergware/master

Fixed dropdown list may not open in tabbed view
This commit is contained in:
Eric Schultz
2016-06-06 06:50:59 -05:00
3 changed files with 34 additions and 3 deletions

View File

@@ -215,11 +215,23 @@ function exitCode(form,key) {
stopEvent = true;
}
}
function checkPort() {
$.post('/webGui/include/CheckPort.php',{port:'eth0'},function(text) {
showNotice(text);
setTimeout(checkPort,15000);
});
}
$(function() {
var ctrl = "<span id='wait_eth0' class='status red' style='display:none;font-size:small;font-style:italic'>Please wait... configuring interfaces</span>";
var form = document.eth0_settings;
$('#bond0').dropdownchecklist({emptyText:'None', width:130});
$('#bridge0').dropdownchecklist({emptyText:'None', width:130});
<?if ($tabbed && !$disabled):?>
$('#tab1').bind({click:function(){
$('#bond0').dropdownchecklist('destroy').dropdownchecklist({emptyText:'None', width:131});
$('#bridge0').dropdownchecklist('destroy').dropdownchecklist({emptyText:'None', width:131});
}});
<?endif;?>
$('#bond0').dropdownchecklist({emptyText:'None', width:131});
$('#bridge0').dropdownchecklist({emptyText:'None', width:131});
checkBondingSettings(form,0);
checkBridgingSettings(form,0);
checkNetworkAccess(form,'eth0');
@@ -236,6 +248,7 @@ $(function() {
<?else:?>
$('div[id=title]').append(ctrl);
<?endif;?>
checkPort();
});
</script>
<form markdown="1" name="eth0_settings" method="POST" action="/update.php" target="progressFrame" onchange="exitCode(this,false)" onsubmit="return prepareSettings(this)">

View File

@@ -0,0 +1,18 @@
<?PHP
/* Copyright 2016, Bergware International.
* Copyright 2016, Lime Technology
*
* 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.
*/
?>
<?
$port = $_POST['port'] ?: 'eth0';
if (exec("ip link show $port|grep -om1 'NO-CARRIER'")) {
echo "<b>Interface $port is down. Check cable!</b>";
}
?>

View File

@@ -33,7 +33,7 @@ if ($run && file_exists($cfg)) {
$ifname = ifname($set);
} else {
// legacy syntax
if ($set=='eth0') $ifname = $old['BRIDGING']=='yes' ? $old['BRNAME'] : ($old['BONDING']=='yes' ? $old['BONDNAME'] : $set);
if ($set=='eth0') $ifname = $old['BRIDGING']=='yes' ? ($old['BRNAME'] ?: 'br0') : ($old['BONDING']=='yes' ? ($old['BONDNAME'] ?: 'bond0') : $set);
}
}