Merge pull request #3329 from stangri/master-luci-app-vpnbypass
luci-app-vpnbypass: use VPN node by default
This commit is contained in:
commit
e55537e8a1
6 changed files with 29 additions and 33 deletions
|
@ -10,7 +10,7 @@ LUCI_TITLE:=VPN Bypass Web UI
|
||||||
LUCI_DESCRIPTION:=Provides Web UI for VPNBypass service.
|
LUCI_DESCRIPTION:=Provides Web UI for VPNBypass service.
|
||||||
LUCI_DEPENDS:=+luci-compat +luci-mod-admin-full +vpnbypass
|
LUCI_DEPENDS:=+luci-compat +luci-mod-admin-full +vpnbypass
|
||||||
LUCI_PKGARCH:=all
|
LUCI_PKGARCH:=all
|
||||||
PKG_RELEASE:=13
|
PKG_RELEASE:=14
|
||||||
|
|
||||||
include ../../luci.mk
|
include ../../luci.mk
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,8 @@
|
||||||
module("luci.controller.vpnbypass", package.seeall)
|
module("luci.controller.vpnbypass", package.seeall)
|
||||||
function index()
|
function index()
|
||||||
if nixio.fs.access("/etc/config/vpnbypass") then
|
if nixio.fs.access("/etc/config/vpnbypass") then
|
||||||
local node = "services"
|
entry({"admin", "vpn", "vpnbypass"}, cbi("vpnbypass"), _("VPN Bypass"))
|
||||||
if luci.dispatcher.lookup("admin/vpn") then node = "vpn" end
|
entry({"admin", "vpn", "vpnbypass", "action"}, call("vpnbypass_action"), nil).leaf = true
|
||||||
entry({"admin", node, "vpnbypass"}, cbi("vpnbypass"), _("VPN Bypass"))
|
|
||||||
entry({"admin", node, "vpnbypass", "action"}, call("vpnbypass_action"), nil).leaf = true
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
<%- if luci.dispatcher.lookup("admin/vpn") then node = "vpn" else node = "services" end -%>
|
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
//<![CDATA[
|
//<![CDATA[
|
||||||
function button_action(action) {
|
function button_action(action) {
|
||||||
|
@ -33,7 +31,7 @@
|
||||||
btn_enable.disabled = true;
|
btn_enable.disabled = true;
|
||||||
btn_disable.disabled = true;
|
btn_disable.disabled = true;
|
||||||
spinner(btn_spinner, 1);
|
spinner(btn_spinner, 1);
|
||||||
xhr.get('<%=luci.dispatcher.build_url("admin", node, "vpnbypass", "action")%>/' + action.name, null,
|
xhr.get('<%=luci.dispatcher.build_url("admin", "vpn", "vpnbypass", "action")%>/' + action.name, null,
|
||||||
function (x) {
|
function (x) {
|
||||||
if (!x) {
|
if (!x) {
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in a new issue