summaryrefslogtreecommitdiffstats
path: root/usr/local/www/javascript/interfaces_ppps_edit
diff options
context:
space:
mode:
authorgnhb <gnoahb@gmail.com>2010-05-28 22:05:40 +0700
committergnhb <gnoahb@gmail.com>2010-05-28 22:05:40 +0700
commit114990f43aa99a70482809cfe79ed97f60a81918 (patch)
tree15a764b8489fb5a2d168a23756859a6898d7ea22 /usr/local/www/javascript/interfaces_ppps_edit
parentebef8175beab236c963cb0cc026eec0a5a1d9b1a (diff)
downloadpfsense-114990f43aa99a70482809cfe79ed97f60a81918.zip
pfsense-114990f43aa99a70482809cfe79ed97f60a81918.tar.gz
Fixed problems in javascript and added L2TP support to GUI.
Diffstat (limited to 'usr/local/www/javascript/interfaces_ppps_edit')
-rw-r--r--usr/local/www/javascript/interfaces_ppps_edit/ppps_edit.js39
1 files changed, 22 insertions, 17 deletions
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 0d441f6..5e8da66 100644
--- a/usr/local/www/javascript/interfaces_ppps_edit/ppps_edit.js
+++ b/usr/local/www/javascript/interfaces_ppps_edit/ppps_edit.js
@@ -23,11 +23,14 @@ function clear_selected(list_name){
function show_hide_linkfields(options){
var select_count = 0;
- for(var j=0; j < options.length; j++){
- var count = select_count.toString();
+ var port_count = parseInt($('port_count').innerHTML);
+ for(var j=0; j < port_count; j++){
+ var count = j.toString();
var type = $('type').value;
- var label = "link" + count;
+ var link = "link" + count;
+ var lnklabel = "linklabel" + count;
var bw = "bandwidth" + count;
+ var bwlabel = "bwlabel" + count;
var mtu = "mtu" + count;
var mru = "mru" + count;
var ipfields = "ipfields" + count;
@@ -37,33 +40,32 @@ function show_hide_linkfields(options){
var gateway = "gateway" + count;
var gatewaylabel = "gatewaylabel" + count;
- $(ipfields,label,subnet).invoke('hide');
+ $(ipfields,link).invoke('hide');
$(bw).name = "bandwidth[]";
$(mtu).name = "mtu[]";
$(mru).name = "mru[]";
$(localip).name = "localip[]";
$(subnet).name = "subnet[]";
+ $(subnet).disabled = true;
$(gateway).name = "gateway[]";
- if (options[j].selected){
- var lnklabel = "linklabel" + count;
- var bwlabel = "bwlabel" + count;
+ if (j < options.length && options[j].selected){
$(lnklabel).innerHTML = "Link Parameters (" + options[j].value + ")";
$(bwlabel).innerHTML = "Bandwidth (" + options[j].value + ")";
$(bw).name = "bandwidth[" + options[j].value + "]";
$(mtu).name = "mtu[" + options[j].value + "]";
$(mru).name = "mru[" + options[j].value + "]";
- if (type == 'pptp' || type == 'ppp'){
- $(localiplabel).innerHTML = "Local IP (" + options[j].value + ")";
- $(gatewaylabel).innerHTML = "Gateway (" + options[j].value + ")";
- $(localip).name = "localip[" + options[j].value + "]";
- $(subnet).name = "subnet[" + options[j].value + "]";
- $(gateway).name = "gateway[" + options[j].value + "]";
- if (type == 'pptp'){
- $(subnet).show();
- }
+ $(localiplabel).innerHTML = "Local IP (" + options[j].value + ")";
+ $(gatewaylabel).innerHTML = "Gateway (" + options[j].value + ")";
+ $(localip).name = "localip[" + options[j].value + "]";
+ $(subnet).name = "subnet[" + options[j].value + "]";
+ $(gateway).name = "gateway[" + options[j].value + "]";
+ if (type == 'pptp' || type == 'ppp' || type == 'l2tp'){
$(ipfields).show();
+ if (type == 'pptp' || type == 'l2tp'){
+ $(subnet).disabled = false;
+ }
}
- $(label).show();
+ $(link).show();
select_count++;
}
}
@@ -92,6 +94,9 @@ function updateType(t){
$('select','ppp','pptp','prefil_ppp').invoke('hide');
break;
}
+ case "l2tp": {
+ t = "pptp";
+ }
case "pptp": {
update_select_list(ports, select_list);
$('select','ppp','pppoe','prefil_ppp').invoke('hide');
OpenPOWER on IntegriCloud