Merge pull request #3245 from stangri/master-luci-app-vpnbypass
luci-app-vpnbypass: bugfix: call to action has no parent node
This commit is contained in:
commit
50a685a975
4 changed files with 10 additions and 11 deletions
|
@ -3,14 +3,14 @@
|
||||||
|
|
||||||
include $(TOPDIR)/rules.mk
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_LICENSE:=GPL-3.0+
|
PKG_LICENSE:=GPL-3.0-or-later
|
||||||
PKG_MAINTAINER:=Stan Grishin <stangri@melmac.net>
|
PKG_MAINTAINER:=Stan Grishin <stangri@melmac.net>
|
||||||
|
|
||||||
LUCI_TITLE:=VPN Bypass Web UI
|
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-mod-admin-full +vpnbypass
|
LUCI_DEPENDS:=+luci-mod-admin-full +vpnbypass
|
||||||
LUCI_PKGARCH:=all
|
LUCI_PKGARCH:=all
|
||||||
PKG_RELEASE:=12
|
PKG_RELEASE:=13
|
||||||
|
|
||||||
include ../../luci.mk
|
include ../../luci.mk
|
||||||
|
|
||||||
|
|
|
@ -1,12 +1,10 @@
|
||||||
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
|
||||||
if luci.dispatcher.lookup("admin/vpn") then
|
local node = "services"
|
||||||
entry({"admin", "vpn", "vpnbypass"}, cbi("vpnbypass"), _("VPN Bypass"))
|
if luci.dispatcher.lookup("admin/vpn") then node = "vpn" end
|
||||||
else
|
entry({"admin", node, "vpnbypass"}, cbi("vpnbypass"), _("VPN Bypass"))
|
||||||
entry({"admin", "services", "vpnbypass"}, cbi("vpnbypass"), _("VPN Bypass"))
|
entry({"admin", node, "vpnbypass", "action"}, call("vpnbypass_action"), nil).leaf = true
|
||||||
end
|
|
||||||
entry({"admin", "services", "vpnbypass", "action"}, call("vpnbypass_action"), nil).leaf = true
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -4,8 +4,6 @@ local sys = require "luci.sys"
|
||||||
local util = require "luci.util"
|
local util = require "luci.util"
|
||||||
local packageName = "vpnbypass"
|
local packageName = "vpnbypass"
|
||||||
|
|
||||||
m = Map("vpnbypass", translate("VPN Bypass Settings"))
|
|
||||||
|
|
||||||
local tmpfsVersion = tostring(util.trim(sys.exec("opkg list-installed " .. packageName .. " | awk '{print $3}'")))
|
local tmpfsVersion = tostring(util.trim(sys.exec("opkg list-installed " .. packageName .. " | awk '{print $3}'")))
|
||||||
if not tmpfsVersion or tmpfsVersion == "" then
|
if not tmpfsVersion or tmpfsVersion == "" then
|
||||||
tmpfsStatusCode = -1
|
tmpfsStatusCode = -1
|
||||||
|
@ -19,6 +17,8 @@ if sys.call("iptables -t mangle -L | grep -q VPNBYPASS") == 0 then
|
||||||
tmpfsStatus = "Running"
|
tmpfsStatus = "Running"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
m = Map("vpnbypass", translate("VPN Bypass Settings"))
|
||||||
|
|
||||||
h = m:section(NamedSection, "config", packageName, translate("Service Status") .. tmpfsVersion)
|
h = m:section(NamedSection, "config", packageName, translate("Service Status") .. tmpfsVersion)
|
||||||
ss = h:option(DummyValue, "_dummy", translate("Service Status"))
|
ss = h:option(DummyValue, "_dummy", translate("Service Status"))
|
||||||
ss.template = packageName .. "/status"
|
ss.template = packageName .. "/status"
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
<%- if luci.dispatcher.lookup("admin/vpn") then node = "vpn" else node = "services" end -%>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
//<![CDATA[
|
//<![CDATA[
|
||||||
|
@ -32,7 +33,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", "services", "vpnbypass", "action")%>/' + action.name, null,
|
xhr.get('<%=luci.dispatcher.build_url("admin", node, "vpnbypass", "action")%>/' + action.name, null,
|
||||||
function (x) {
|
function (x) {
|
||||||
if (!x) {
|
if (!x) {
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in a new issue