From 5a730115856ac8ae4461f402da39b0c05321b712 Mon Sep 17 00:00:00 2001 From: Stan Grishin Date: Mon, 18 Nov 2019 16:01:58 -0700 Subject: [PATCH] luci-app-vpnbypass: use VPN node by default Signed-off-by: Stan Grishin --- applications/luci-app-vpnbypass/Makefile | 2 +- .../luasrc/controller/vpnbypass.lua | 6 ++-- .../luasrc/model/cbi/vpnbypass.lua | 12 +++---- .../luasrc/view/vpnbypass/buttons.htm | 2 +- .../luasrc/view/vpnbypass/js.htm | 36 +++++++++---------- .../luasrc/view/vpnbypass/status-textarea.htm | 4 +-- 6 files changed, 29 insertions(+), 33 deletions(-) diff --git a/applications/luci-app-vpnbypass/Makefile b/applications/luci-app-vpnbypass/Makefile index cddcf8536..14425ce98 100644 --- a/applications/luci-app-vpnbypass/Makefile +++ b/applications/luci-app-vpnbypass/Makefile @@ -10,7 +10,7 @@ LUCI_TITLE:=VPN Bypass Web UI LUCI_DESCRIPTION:=Provides Web UI for VPNBypass service. LUCI_DEPENDS:=+luci-compat +luci-mod-admin-full +vpnbypass LUCI_PKGARCH:=all -PKG_RELEASE:=13 +PKG_RELEASE:=14 include ../../luci.mk diff --git a/applications/luci-app-vpnbypass/luasrc/controller/vpnbypass.lua b/applications/luci-app-vpnbypass/luasrc/controller/vpnbypass.lua index dac02d84d..c971ce651 100644 --- a/applications/luci-app-vpnbypass/luasrc/controller/vpnbypass.lua +++ b/applications/luci-app-vpnbypass/luasrc/controller/vpnbypass.lua @@ -1,10 +1,8 @@ module("luci.controller.vpnbypass", package.seeall) function index() if nixio.fs.access("/etc/config/vpnbypass") then - local node = "services" - if luci.dispatcher.lookup("admin/vpn") then node = "vpn" end - entry({"admin", node, "vpnbypass"}, cbi("vpnbypass"), _("VPN Bypass")) - entry({"admin", node, "vpnbypass", "action"}, call("vpnbypass_action"), nil).leaf = true + entry({"admin", "vpn", "vpnbypass"}, cbi("vpnbypass"), _("VPN Bypass")) + entry({"admin", "vpn", "vpnbypass", "action"}, call("vpnbypass_action"), nil).leaf = true end end diff --git a/applications/luci-app-vpnbypass/luasrc/model/cbi/vpnbypass.lua b/applications/luci-app-vpnbypass/luasrc/model/cbi/vpnbypass.lua index 08054dc48..8aa222709 100644 --- a/applications/luci-app-vpnbypass/luasrc/model/cbi/vpnbypass.lua +++ b/applications/luci-app-vpnbypass/luasrc/model/cbi/vpnbypass.lua @@ -6,11 +6,11 @@ local packageName = "vpnbypass" local tmpfsVersion = tostring(util.trim(sys.exec("opkg list-installed " .. packageName .. " | awk '{print $3}'"))) if not tmpfsVersion or tmpfsVersion == "" then - tmpfsStatusCode = -1 - tmpfsVersion = "" - tmpfsStatus = packageName .. " " .. translate("is not installed or not found") + tmpfsStatusCode = -1 + tmpfsVersion = "" + tmpfsStatus = packageName .. " " .. translate("is not installed or not found") else - tmpfsVersion = " [" .. packageName .. " " .. tmpfsVersion .. "]" + tmpfsVersion = " [" .. packageName .. " " .. tmpfsVersion .. "]" end local tmpfsStatus = "Stopped" if sys.call("iptables -t mangle -L | grep -q VPNBYPASS") == 0 then @@ -60,9 +60,9 @@ d = Map("dhcp") s4 = d:section(TypedSection, "dnsmasq") s4.anonymous = true di = s4:option(DynamicList, "ipset", translate("Domains to Bypass"), - translate("Domains to be accessed directly (outside of the VPN tunnel), see ") + translate("Domains to be accessed directly (outside of the VPN tunnel), see ") .. [[]] - .. translate("README") .. [[ ]] .. translate("for syntax")) + .. translate("README") .. [[ ]] .. translate("for syntax")) function d.on_after_commit(map) util.exec("/etc/init.d/dnsmasq restart >/dev/null 2>&1") end diff --git a/applications/luci-app-vpnbypass/luasrc/view/vpnbypass/buttons.htm b/applications/luci-app-vpnbypass/luasrc/view/vpnbypass/buttons.htm index 9f79b9b77..baabb8f2a 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 + Copyright 2019 Stan Grishin -%> <%- diff --git a/applications/luci-app-vpnbypass/luasrc/view/vpnbypass/js.htm b/applications/luci-app-vpnbypass/luasrc/view/vpnbypass/js.htm index 8e47a9759..e8c076f50 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 -%> -