From a8087a7c1b83ae7770f2b1c278d0eb5318b7e33e Mon Sep 17 00:00:00 2001 From: Niklas Date: Wed, 28 Sep 2011 17:44:42 +0200 Subject: added a select field to the manual conf gui. also fixed some bugs in the ip4_manualConf function --- LogReceiver/html/networkdiscovery.html | 50 +++++++++++++++++++++++----------- 1 file changed, 34 insertions(+), 16 deletions(-) (limited to 'LogReceiver/html/networkdiscovery.html') diff --git a/LogReceiver/html/networkdiscovery.html b/LogReceiver/html/networkdiscovery.html index 1302071..1f6125a 100644 --- a/LogReceiver/html/networkdiscovery.html +++ b/LogReceiver/html/networkdiscovery.html @@ -42,14 +42,29 @@ var checkRegexp = function ( o, regexp, n ) { }; var ip4_manualConfigurationDialog = function () { - var ifname = $("#ifname"), + var jsonArr = fbgui.getManualConfInterfaces(); + //jsonArr = eval('(' + jsonArr + ')'); + var c = ""; + $("#nd_mc_ifname").html(c); + + var ifname = $("#nd_mc_ifname_select :selected").text(), ipaddr = $("#ipaddr"), netmask = $("#netmask"), broadcast = $("#broadcast"), gateway = $("#gateway"), dns = $("#dns"), - allFields = $([]).add(ifname).add(ipaddr).add(netmask).add(broadcast).add(gateway).add(dns); + allFields = $([]).add(ipaddr).add(netmask).add(broadcast).add(gateway).add(dns); + $("#nd_manual_configuration_dialog").dialog( { buttons: { "Cancel": function() { $(this).dialog("close");}, @@ -57,8 +72,6 @@ var ip4_manualConfigurationDialog = function () { var bValid = true; allFields.removeClass("ui-state-error"); - //the interface name has to be choosen out of a dropdown menue - //bValid = bValid && checkLength(ifname, "Interface", 2, 15); bValid = bValid && checkLength(ipaddr, "IP-Address", 7, 15); bValid = bValid && checkLength(netmask, "Netmask Address", 7, 15); bValid = bValid && checkLength(broadcast, "Broadcast Address", 7, 15); @@ -75,16 +88,19 @@ var ip4_manualConfigurationDialog = function () { // put variables into a json object // send to qt networkdiscovery var o = {"ifname" : ifname, - "ipaddr" : ipaddr, - "netmask" : netmask, - "broadcast" : broadcast, - "gateway" : gateway, - "dns" : dns } - fbgui.ip4_setManualConfiguraton(o); + "ipaddr" : ipaddr.val(), + "netmask" : netmask.val(), + "broadcast" : broadcast.val(), + "gateway" : gateway.val(), + "dns" : dns.val() } + try { + fbgui.ip4_setManualConfiguration(o); + } catch (e) { + fbgui.notifyCall(e); + } $(this).dialog("close"); } } } , - //autoOpen: false, minWidth: 450, modal: true, resizable: false, @@ -95,11 +111,11 @@ var ip4_manualConfigurationDialog = function () { }; var abortBootDialog = function (m) { + fbgui.notifyCall("abortBootDialog"); $("#nd_abort_boot_msg").html(m); $("#nd_abort_boot_dialog").dialog( { buttons: { "Manual Configure": function() { - ip4_manualConfigurationDialog(); - $(this).dialog("close");}, + ip4_manualConfigurationDialog();}, "Show Log": function() {fbgui.showLog(); $(this).dialog("close");}, "Restart": function() {fbgui.restartSystem(); @@ -126,7 +142,9 @@ var chooseInterfaceDialog = function (i) { $("#nd_choose_interface_msg").html(cb); $("#nd_choose_interface_dialog").dialog( - { buttons: { "Show Log": function() {fbgui.showLog(); + { buttons: { "Manual Configure": function() { + ip4_manualConfigurationDialog();}, + "Show Log": function() {fbgui.showLog(); $(this).dialog("close");}, "Restart": function() {fbgui.restartSystem(); $(this).dialog("close"); }, @@ -208,8 +226,8 @@ var addInterface = function (i){

All form fields are required.

- - + + -- cgit v1.2.3-55-g7522