diff options
author | Stan Grishin <stangri@melmac.net> | 2019-11-18 16:01:58 -0700 |
---|---|---|
committer | Stan Grishin <stangri@melmac.net> | 2019-11-18 16:01:58 -0700 |
commit | 5a730115856ac8ae4461f402da39b0c05321b712 (patch) | |
tree | 8a2bc2c9cbaed96006931cd6b8fd63fd74415296 /applications/luci-app-vpnbypass/luasrc/view/vpnbypass/js.htm | |
parent | b1cb0d6d59c84a16f084e8ec91714a3d247a2700 (diff) |
luci-app-vpnbypass: use VPN node by default
Signed-off-by: Stan Grishin <stangri@melmac.net>
Diffstat (limited to 'applications/luci-app-vpnbypass/luasrc/view/vpnbypass/js.htm')
-rw-r--r-- | applications/luci-app-vpnbypass/luasrc/view/vpnbypass/js.htm | 36 |
1 files changed, 17 insertions, 19 deletions
diff --git a/applications/luci-app-vpnbypass/luasrc/view/vpnbypass/js.htm b/applications/luci-app-vpnbypass/luasrc/view/vpnbypass/js.htm index 8e47a97590..e8c076f50e 100644 --- a/applications/luci-app-vpnbypass/luasrc/view/vpnbypass/js.htm +++ b/applications/luci-app-vpnbypass/luasrc/view/vpnbypass/js.htm @@ -1,14 +1,12 @@ -<%- if luci.dispatcher.lookup("admin/vpn") then node = "vpn" else node = "services" end -%> - <script type="text/javascript"> //<![CDATA[ function button_action(action) { - var xhr = new XHR(false); - var btn_start = document.getElementById("btn_start"); - var btn_action = document.getElementById("btn_action"); - var btn_stop = document.getElementById("btn_stop"); - var btn_enable = document.getElementById("btn_enable"); - var btn_disable = document.getElementById("btn_disable"); + var xhr = new XHR(false); + var btn_start = document.getElementById("btn_start"); + var btn_action = document.getElementById("btn_action"); + var btn_stop = document.getElementById("btn_stop"); + var btn_enable = document.getElementById("btn_enable"); + var btn_disable = document.getElementById("btn_disable"); var btn_spinner; switch (action.name) { case "start": @@ -32,28 +30,28 @@ btn_stop.disabled = true; btn_enable.disabled = true; btn_disable.disabled = true; - spinner(btn_spinner, 1); - xhr.get('<%=luci.dispatcher.build_url("admin", node, "vpnbypass", "action")%>/' + action.name, null, + spinner(btn_spinner, 1); + xhr.get('<%=luci.dispatcher.build_url("admin", "vpn", "vpnbypass", "action")%>/' + action.name, null, function (x) { if (!x) { return; } - btn_start.disabled = false; - btn_action.disabled = false; - btn_stop.disabled = false; - btn_enable.disabled = false; - btn_disable.disabled = false; + btn_start.disabled = false; + btn_action.disabled = false; + btn_stop.disabled = false; + btn_enable.disabled = false; + btn_disable.disabled = false; spinner(btn_spinner, 0); - location.reload(); - }); + location.reload(); + }); } function spinner(element, state) { if (state === 1) { - element.style.width = "16px"; + element.style.width = "16px"; element.innerHTML = '<img src="<%=resource%>/icons/loading.gif" alt="<%:Loading%>" width="16" height="16" style="vertical-align:middle" />'; } else { - element.style.width = "0px"; + element.style.width = "0px"; element.innerHTML = ''; } } |