pari: branch aadk r517 - /branches/aadk/config/networking.html
asterisk-gui-commits at lists.digium.com
asterisk-gui-commits at lists.digium.com
Wed Mar 28 13:03:35 MST 2007
Author: pari
Date: Wed Mar 28 15:03:35 2007
New Revision: 517
URL: http://svn.digium.com/view/asterisk-gui?view=rev&rev=517
Log:
GUI part of - 'apply network settings in seperate phases'
Modified:
branches/aadk/config/networking.html
Modified: branches/aadk/config/networking.html
URL: http://svn.digium.com/view/asterisk-gui/branches/aadk/config/networking.html?view=diff&rev=517&r1=516&r2=517
==============================================================================
--- branches/aadk/config/networking.html (original)
+++ branches/aadk/config/networking.html Wed Mar 28 15:03:35 2007
@@ -32,14 +32,31 @@
networkingcallbacks.loaded = function(t, x) {
$('hiddennetworking').selectitem(0);
+ show_window(1);
parent.loadscreen(this);
}
networkingcallbacks.savechanges = function(){
-
- parent.astmanEngine.run_tool("sh /etc/asterisk/networking.sh options=WAN DHCP_WAN=" + _$('DHCP_WAN').value + " IP_WAN=" + _$('IP_WAN').value + " SUBNET_WAN=" + _$('SUBNET_WAN').value + " GATEWAY_WAN=" + _$('GATEWAY_WAN').value + " DNS_WAN=" + _$('DNS_WAN').value + " DHCP_LAN=" + _$('DHCP_LAN').value + " IP_LAN=" + _$('IP_LAN').value + " SUBNET_LAN=" + _$('SUBNET_LAN').value + " GATEWAY_LAN=" + _$('GATEWAY_LAN').value + " DNS_LAN=" + _$('DNS_LAN').value + " START_RANGE_LAN=" + _$('START_RANGE_LAN').value + " END_RANGE_LAN=" + _$('END_RANGE_LAN').value + " SSH_STATUS=" + _$('SSH_STATUS').value + " HOSTNAME=" + _$('HOSTNAME').value + " LEASE_LAN=" + _$('LEASE_LAN').value + " NTP_LAN=" + _$('NTP_LAN').value + " TFTP_LAN=" + _$('TFTP_LAN').value + " DOMAIN_LAN=" + _$('DOMAIN_LAN').value);
- /* Lets hope this does not character buffer overflow :( */
+ var cmd1 = "sh /etc/asterisk/networking.sh options=WAN DHCP_WAN=" + _$('DHCP_WAN').value + " IP_WAN=" + _$('IP_WAN').value + " SUBNET_WAN=" + _$('SUBNET_WAN').value + " GATEWAY_WAN=" + _$('GATEWAY_WAN').value + " DNS_WAN=" + _$('DNS_WAN').value ;
+
+ var cmd2 = "sh /etc/asterisk/networking.sh options=LAN DHCP_LAN=" + _$('DHCP_LAN').value + " IP_LAN=" + _$('IP_LAN').value + " SUBNET_LAN=" + _$('SUBNET_LAN').value + " GATEWAY_LAN=" + _$('GATEWAY_LAN').value ;
+
+ var cmd3 = "sh /etc/asterisk/networking.sh options=LAN2 DNS_LAN=" + _$('DNS_LAN').value + " START_RANGE_LAN=" + _$('START_RANGE_LAN').value + " END_RANGE_LAN=" + _$('END_RANGE_LAN').value ;
+
+ var cmd4 = "sh /etc/asterisk/networking.sh options=MISC SSH_STATUS=" + _$('SSH_STATUS').value + " HOSTNAME=" + _$('HOSTNAME').value + " LEASE_LAN=" + _$('LEASE_LAN').value + " NTP_LAN=" + _$('NTP_LAN').value + " TFTP_LAN=" + _$('TFTP_LAN').value + " DOMAIN_LAN=" + _$('DOMAIN_LAN').value ;
+
+ parent.astmanEngine.run_tool(cmd1 , onSuccess = function() {
+ parent.astmanEngine.run_tool(cmd2 , onSuccess = function() {
+ parent.astmanEngine.run_tool(cmd3 , onSuccess = function() {
+ parent.astmanEngine.run_tool(cmd4 , onSuccess = function() {
+
+ });
+ });
+ });
+ });
+ /* This is a total hack, but the appliance only 256 characters, so we have to split them up :[ */
+ /* Lets hope this does not character buffer overflow :( */
}
@@ -52,6 +69,40 @@
}
parent.astmanEngine.config2list("networking.conf", $('hiddennetworking'), widgets, networkingcallbacks);
}
+
+
+function show_window(x){
+ _$('tab1').className = "tab";
+ _$('tab2').className = "tab";
+ _$('tab3').className = "tab";
+
+ switch(x){
+ case 1:
+ _$('tab1').className = "tabselected";
+ _$('tab1').blur();
+ _$('lan_div').style.display = "none";
+ _$('wan_div').style.display = "none";
+ _$('general_div').style.display="";
+
+ break;
+ case 2:
+ _$('tab2').className = "tabselected";
+ _$('tab2').blur();
+ _$('lan_div').style.display = "none";
+ _$('wan_div').style.display = "";
+ _$('general_div').style.display="none";
+ break;
+ case 3:
+ _$('tab3').className = "tabselected";
+ _$('tab3').blur();
+ _$('lan_div').style.display = "";
+ _$('wan_div').style.display = "none";
+ _$('general_div').style.display="none";
+ break;
+
+ }
+
+}
</script>
<body id="foo" onload="localajaxinit()" bgcolor="EFEFEF">
<div class="mainscreenTitleBar">
@@ -61,14 +112,31 @@
<div class="mainscreenContentBox" id="mailboxcontent">
<table class="mainscreenTable" align="center">
<tr><td valign="top" align="center">
+
+ <a href="#" class="tab" onclick="show_window(1);" id="tab1">General</a>
+ <a href="#" class="tab" onclick="show_window(2);" id="tab2">Wan</a>
+ <a href="#" class="tab" onclick="show_window(3);" id="tab3">Lan</a>
+ <BR><BR>
+ <div id="general_div">
<table align="center">
<TR>
<TD><B>Hostname</B></TD>
<TD><input type="text" id='HOSTNAME' size=14></TD>
</TR>
- <TR> <TD><B>WAN Settings</B></TD>
- <TD></TD>
- </TR>
+ <TR> <TD>NTP Server</TD>
+ <TD><input type="text" id='NTP_LAN' size=14></TD>
+ </TR>
+ <TR> <TD>Tftp (Phone Provisioning)</TD>
+ <TD><input type="text" id='TFTP_LAN' size=14></TD>
+ </TR>
+ <TR> <TD><B>SSH</B></TD>
+ <TD><input type="checkbox" id='SSH_STATUS'></TD>
+ </TR>
+ </table>
+ </div>
+
+ <div id="wan_div">
+ <table align="center">
<TR> <TD>DHCP</TD>
<TD><input type="checkbox" id='DHCP_WAN'></TD>
</TR>
@@ -84,9 +152,11 @@
<TR> <TD>DNS</TD>
<TD><input type="text" id='DNS_WAN' size=14></TD>
</TR>
- <TR> <TD><B>LAN Settings</B></TD>
- <TD></TD>
- </TR>
+ </table>
+ </div>
+
+ <div id="lan_div">
+ <table align="center">
<TR> <TD>Domain</TD>
<TD><input type="text" id='DOMAIN_LAN'></TD>
</TR>
@@ -120,25 +190,12 @@
<TR> <TD>Optional Router IP</TD>
<TD><input type="text" id='ROUTER_LAN' size=14></TD>
</TR>
- <TR> <TD>NTP Server</TD>
- <TD><input type="text" id='NTP_LAN' size=14></TD>
- </TR>
- <TR> <TD>Tftp (Phone Provisioning)</TD>
- <TD><input type="text" id='TFTP_LAN' size=14></TD>
- </TR>
- <TR> <TD><B>SSH</B></TD>
- <TD><input type="checkbox" id='SSH_STATUS'></TD>
- </TR>
- <TR> <TD colspan=2 align="center">
- <div id="status"></div>
- </TD>
- </TR>
- <TR> <TD colspan=2 align="center">
- <input type="button" value="Save" id="save">
- <input type="button" value="Cancel" id="cancel">
- </TD>
- </TR>
</table>
+ </div>
+
+ <div id="status" height=20></div>
+ <BR>
+ <input type="button" value="Save" id="save"> <input type="button" value="Cancel" id="cancel">
</td>
</tr>
More information about the asterisk-gui-commits
mailing list