summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorFlorian Eckert <fe@dev.tdt.de>2019-10-29 06:23:13 +0100
committerGitHub <noreply@github.com>2019-10-29 06:23:13 +0100
commit50a685a975e08a889e3c806fe834d8258a925a1d (patch)
treea4e678e05f6db36908c0befe541ffc8522883f98
parent7707b679e20df9806fbcbc58d12116f9ee9a3850 (diff)
parentc145ad0cbf9bd71ef162772bcd3d4622f4023351 (diff)
Merge pull request #3245 from stangri/master-luci-app-vpnbypass
luci-app-vpnbypass: bugfix: call to action has no parent node
-rw-r--r--applications/luci-app-vpnbypass/Makefile4
-rw-r--r--applications/luci-app-vpnbypass/luasrc/controller/vpnbypass.lua10
-rw-r--r--applications/luci-app-vpnbypass/luasrc/model/cbi/vpnbypass.lua4
-rw-r--r--applications/luci-app-vpnbypass/luasrc/view/vpnbypass/js.htm3
4 files changed, 10 insertions, 11 deletions
diff --git a/applications/luci-app-vpnbypass/Makefile b/applications/luci-app-vpnbypass/Makefile
index 133c4bc33d..1bf076f0a2 100644
--- a/applications/luci-app-vpnbypass/Makefile
+++ b/applications/luci-app-vpnbypass/Makefile
@@ -3,14 +3,14 @@
include $(TOPDIR)/rules.mk
-PKG_LICENSE:=GPL-3.0+
+PKG_LICENSE:=GPL-3.0-or-later
PKG_MAINTAINER:=Stan Grishin <stangri@melmac.net>
LUCI_TITLE:=VPN Bypass Web UI
LUCI_DESCRIPTION:=Provides Web UI for VPNBypass service.
LUCI_DEPENDS:=+luci-mod-admin-full +vpnbypass
LUCI_PKGARCH:=all
-PKG_RELEASE:=12
+PKG_RELEASE:=13
include ../../luci.mk
diff --git a/applications/luci-app-vpnbypass/luasrc/controller/vpnbypass.lua b/applications/luci-app-vpnbypass/luasrc/controller/vpnbypass.lua
index d034fce324..dac02d84d6 100644
--- a/applications/luci-app-vpnbypass/luasrc/controller/vpnbypass.lua
+++ b/applications/luci-app-vpnbypass/luasrc/controller/vpnbypass.lua
@@ -1,12 +1,10 @@
module("luci.controller.vpnbypass", package.seeall)
function index()
if nixio.fs.access("/etc/config/vpnbypass") then
- if luci.dispatcher.lookup("admin/vpn") then
- entry({"admin", "vpn", "vpnbypass"}, cbi("vpnbypass"), _("VPN Bypass"))
- else
- entry({"admin", "services", "vpnbypass"}, cbi("vpnbypass"), _("VPN Bypass"))
- end
- entry({"admin", "services", "vpnbypass", "action"}, call("vpnbypass_action"), nil).leaf = true
+ 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
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 8d3ef2b8ee..08054dc484 100644
--- a/applications/luci-app-vpnbypass/luasrc/model/cbi/vpnbypass.lua
+++ b/applications/luci-app-vpnbypass/luasrc/model/cbi/vpnbypass.lua
@@ -4,8 +4,6 @@ local sys = require "luci.sys"
local util = require "luci.util"
local packageName = "vpnbypass"
-m = Map("vpnbypass", translate("VPN Bypass Settings"))
-
local tmpfsVersion = tostring(util.trim(sys.exec("opkg list-installed " .. packageName .. " | awk '{print $3}'")))
if not tmpfsVersion or tmpfsVersion == "" then
tmpfsStatusCode = -1
@@ -19,6 +17,8 @@ if sys.call("iptables -t mangle -L | grep -q VPNBYPASS") == 0 then
tmpfsStatus = "Running"
end
+m = Map("vpnbypass", translate("VPN Bypass Settings"))
+
h = m:section(NamedSection, "config", packageName, translate("Service Status") .. tmpfsVersion)
ss = h:option(DummyValue, "_dummy", translate("Service Status"))
ss.template = packageName .. "/status"
diff --git a/applications/luci-app-vpnbypass/luasrc/view/vpnbypass/js.htm b/applications/luci-app-vpnbypass/luasrc/view/vpnbypass/js.htm
index 76809e9387..8e47a97590 100644
--- a/applications/luci-app-vpnbypass/luasrc/view/vpnbypass/js.htm
+++ b/applications/luci-app-vpnbypass/luasrc/view/vpnbypass/js.htm
@@ -1,3 +1,4 @@
+<%- if luci.dispatcher.lookup("admin/vpn") then node = "vpn" else node = "services" end -%>
<script type="text/javascript">
//<![CDATA[
@@ -32,7 +33,7 @@
btn_enable.disabled = true;
btn_disable.disabled = true;
spinner(btn_spinner, 1);
- xhr.get('<%=luci.dispatcher.build_url("admin", "services", "vpnbypass", "action")%>/' + action.name, null,
+ xhr.get('<%=luci.dispatcher.build_url("admin", node, "vpnbypass", "action")%>/' + action.name, null,
function (x) {
if (!x) {
return;