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 | |
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')
3 files changed, 20 insertions, 22 deletions
diff --git a/applications/luci-app-vpnbypass/luasrc/view/vpnbypass/buttons.htm b/applications/luci-app-vpnbypass/luasrc/view/vpnbypass/buttons.htm index 9f79b9b779..baabb8f2a7 100644 --- a/applications/luci-app-vpnbypass/luasrc/view/vpnbypass/buttons.htm +++ b/applications/luci-app-vpnbypass/luasrc/view/vpnbypass/buttons.htm @@ -1,5 +1,5 @@ <%# - Copyright 2019 Stan Grishin <stangri@melmac.net> + Copyright 2019 Stan Grishin <stangri@melmac.net> -%> <%- 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 = ''; } } diff --git a/applications/luci-app-vpnbypass/luasrc/view/vpnbypass/status-textarea.htm b/applications/luci-app-vpnbypass/luasrc/view/vpnbypass/status-textarea.htm index 75243e3950..4ab2e11291 100644 --- a/applications/luci-app-vpnbypass/luasrc/view/vpnbypass/status-textarea.htm +++ b/applications/luci-app-vpnbypass/luasrc/view/vpnbypass/status-textarea.htm @@ -6,8 +6,8 @@ This is free software, licensed under the Apache License, Version 2.0 <%+cbi/valueheader%> <textarea rows="<%=select(2, self:cfgvalue(section):gsub('\n', '\n'))%>" - style="border:none;box-shadow:none;background:transparent;font-weight:bold;line-height:20px;width:50em;padding:none;margin:6px;resize:none;overflow:hidden;" - disabled="disabled"><%=self:cfgvalue(section):gsub('\n', '\n')%> + style="border:none;box-shadow:none;background:transparent;font-weight:bold;line-height:20px;width:50em;padding:none;margin:6px;resize:none;overflow:hidden;" + disabled="disabled"><%=self:cfgvalue(section):gsub('\n', '\n')%> </textarea> <%+cbi/valuefooter%> |