From 7db2ef5fd8c0842d8c87b0489f48465a323e8d7e Mon Sep 17 00:00:00 2001 From: gnhb Date: Fri, 4 Jun 2010 07:20:41 +0700 Subject: Simplify GUI even more, especially for PPP connections. --- usr/local/www/interfaces_ppps_edit.php | 174 +++++++++------------ .../javascript/interfaces_ppps_edit/ppps_edit.js | 29 ++-- 2 files changed, 89 insertions(+), 114 deletions(-) (limited to 'usr') diff --git a/usr/local/www/interfaces_ppps_edit.php b/usr/local/www/interfaces_ppps_edit.php index 0704e9b..ba13052 100644 --- a/usr/local/www/interfaces_ppps_edit.php +++ b/usr/local/www/interfaces_ppps_edit.php @@ -558,6 +558,49 @@ $types = array("select" => "Select", "ppp" => "PPP", "pppoe" => "PPPoE", "pptp" + + + +
+ + + + + + + + + + + + + + + + + + + + + + +
+
+ + + @@ -569,86 +612,39 @@ $types = array("select" => "Select", "ppp" => "PPP", "pppoe" => "PPPoE", "pptp" - - - + + + - -
+ +
- - - - + + + + + - - - - - - - - - - - - - - +
- - - - - - - - - - - - - -
-
-
- -
+ - - - - - + - + + - - + + - - - + + diff --git a/usr/local/www/javascript/interfaces_ppps_edit/ppps_edit.js b/usr/local/www/javascript/interfaces_ppps_edit/ppps_edit.js index 513dbdd..1156e0f 100644 --- a/usr/local/www/javascript/interfaces_ppps_edit/ppps_edit.js +++ b/usr/local/www/javascript/interfaces_ppps_edit/ppps_edit.js @@ -51,14 +51,15 @@ function show_hide_linkfields(options){ var bwlabel = "bwlabel" + count; var mtu = "mtu" + count; var mru = "mru" + count; - var ipfields = "ipfields" + count; + var ipfields = "ip_fields" + count; + var gwfields = "gw_fields" + count; var localip = "localip" + count; var localiplabel = "localiplabel" + count; var subnet = "subnet" + count; var gateway = "gateway" + count; var gatewaylabel = "gatewaylabel" + count; - $(ipfields,link).invoke('hide'); + $(ipfields, gwfields ,link).invoke('hide'); $(subnet).disabled = true; $(bw).name = "bandwidth[]"; @@ -81,12 +82,11 @@ function show_hide_linkfields(options){ $(subnet).name = "subnet[" + options[i].value + "]"; $(gateway).name = "gateway[" + options[i].value + "]"; if (type == 'ppp' && adv_show){ - $(ipfields).show(); + $(ipfields, gwfields).invoke('show'); } if (type == 'pptp' || type == 'l2tp'){ $(subnet).disabled = false; - $(ipfields).show(); - $('pptp').show(); + $(ipfields, gwfields).invoke('show'); } if (adv_show){ $(link).show(); @@ -108,32 +108,27 @@ function updateType(t){ show_advanced('0'); switch(t) { case "select": { - $('ppp','pppoe','pptp').invoke('hide'); + $('ppp','pppoe','ppp_provider','phone_num','apn').invoke('hide'); select_list.length = 0; select_list[0] = new Option("Select Link Type First",""); break; } case "ppp": { update_select_list(serialports, select_list); - $('select','pppoe','pptp').invoke('hide'); + $('select','pppoe').invoke('hide'); + $('ppp_provider','phone_num','apn').invoke('show'); country_list(); break; } case "pppoe": { update_select_list(ports, select_list); - $('select','ppp','pptp').invoke('hide'); - break; - } - case "l2tp": { - $('pptp_label').innerHTML = "L2TP Configuration"; - update_select_list(ports, select_list); - $('select','ppp','pppoe').invoke('hide'); + $('select','ppp','ppp_provider','phone_num','apn').invoke('hide'); break; } + case "l2tp": case "pptp": { update_select_list(ports, select_list); - $('select','ppp','pppoe').invoke('hide'); - $('pptp_label').innerHTML = "PPTP Configuration"; + $('select','ppp','pppoe','ppp_provider','phone_num','apn').invoke('hide'); break; } default: @@ -141,7 +136,7 @@ function updateType(t){ select_list[0] = new Option("Select Link Type First",""); break; } - if (t != ''){ + if (t == "pppoe" || t == "ppp"){ $(t).show(); } } -- cgit v1.1
- -
-