summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorFlorian Eckert <fe@dev.tdt.de>2019-08-09 14:46:29 +0200
committerGitHub <noreply@github.com>2019-08-09 14:46:29 +0200
commit15e95260896220072bd43225229722f313b6b9e1 (patch)
tree567b19a3df67ff36a82881b6d1a6ffee2d705349
parentb11a25dcb954093fd44f3ce69c9673a748acbb1e (diff)
parent7af8043a75ccf49c3e976984a4b10812e25d115f (diff)
Merge pull request #2969 from TDT-AG/pr/20190806-luci-base
luci-base: add new VPN toplevel menu entry
-rw-r--r--applications/luci-app-ocserv/luasrc/controller/ocserv.lua10
-rw-r--r--applications/luci-app-ocserv/luasrc/view/ocserv_status.htm4
-rw-r--r--applications/luci-app-openvpn/luasrc/controller/openvpn.lua12
-rw-r--r--applications/luci-app-openvpn/luasrc/model/cbi/openvpn-advanced.lua2
-rw-r--r--applications/luci-app-openvpn/luasrc/model/cbi/openvpn-basic.lua2
-rw-r--r--applications/luci-app-openvpn/luasrc/model/cbi/openvpn.lua6
-rw-r--r--applications/luci-app-openvpn/luasrc/view/openvpn/cbi-select-input-add.htm2
-rw-r--r--applications/luci-app-openvpn/luasrc/view/openvpn/pageswitch.htm8
-rw-r--r--modules/luci-base/luasrc/controller/admin/index.lua7
9 files changed, 30 insertions, 23 deletions
diff --git a/applications/luci-app-ocserv/luasrc/controller/ocserv.lua b/applications/luci-app-ocserv/luasrc/controller/ocserv.lua
index 79c6ddb78..f41b48103 100644
--- a/applications/luci-app-ocserv/luasrc/controller/ocserv.lua
+++ b/applications/luci-app-ocserv/luasrc/controller/ocserv.lua
@@ -10,24 +10,24 @@ function index()
local page
- page = entry({"admin", "services", "ocserv"}, alias("admin", "services", "ocserv", "main"),
+ page = entry({"admin", "vpn", "ocserv"}, alias("admin", "vpn", "ocserv", "main"),
_("OpenConnect VPN"))
page.dependent = true
- page = entry({"admin", "services", "ocserv", "main"},
+ page = entry({"admin", "vpn", "ocserv", "main"},
cbi("ocserv/main"),
_("Server Settings"), 200)
page.dependent = true
- page = entry({"admin", "services", "ocserv", "users"},
+ page = entry({"admin", "vpn", "ocserv", "users"},
cbi("ocserv/users"),
_("User Settings"), 300)
page.dependent = true
- entry({"admin", "services", "ocserv", "status"},
+ entry({"admin", "vpn", "ocserv", "status"},
call("ocserv_status")).leaf = true
- entry({"admin", "services", "ocserv", "disconnect"},
+ entry({"admin", "vpn", "ocserv", "disconnect"},
post("ocserv_disconnect")).leaf = true
end
diff --git a/applications/luci-app-ocserv/luasrc/view/ocserv_status.htm b/applications/luci-app-ocserv/luasrc/view/ocserv_status.htm
index 9c69514b9..d00084a0b 100644
--- a/applications/luci-app-ocserv/luasrc/view/ocserv_status.htm
+++ b/applications/luci-app-ocserv/luasrc/view/ocserv_status.htm
@@ -1,7 +1,7 @@
<script type="text/javascript">//<![CDATA[
function ocserv_disconnect(idx) {
- (new XHR()).post('<%=url('admin/services/ocserv/disconnect')%>/' + idx, { token: '<%=token%>' },
+ (new XHR()).post('<%=url('admin/vpn/ocserv/disconnect')%>/' + idx, { token: '<%=token%>' },
function(x)
{
var tb = document.getElementById('ocserv_status_table');
@@ -11,7 +11,7 @@
);
}
- XHR.poll(-1, '<%=url('admin/services/ocserv/status')%>', null,
+ XHR.poll(-1, '<%=url('admin/vpn/ocserv/status')%>', null,
function(x, st)
{
var tb = document.getElementById('ocserv_status_table');
diff --git a/applications/luci-app-openvpn/luasrc/controller/openvpn.lua b/applications/luci-app-openvpn/luasrc/controller/openvpn.lua
index c9a932d87..55c29d1c2 100644
--- a/applications/luci-app-openvpn/luasrc/controller/openvpn.lua
+++ b/applications/luci-app-openvpn/luasrc/controller/openvpn.lua
@@ -5,11 +5,11 @@
module("luci.controller.openvpn", package.seeall)
function index()
- entry( {"admin", "services", "openvpn"}, cbi("openvpn"), _("OpenVPN") )
- entry( {"admin", "services", "openvpn", "basic"}, cbi("openvpn-basic"), nil ).leaf = true
- entry( {"admin", "services", "openvpn", "advanced"}, cbi("openvpn-advanced"), nil ).leaf = true
- entry( {"admin", "services", "openvpn", "file"}, form("openvpn-file"), nil ).leaf = true
- entry( {"admin", "services", "openvpn", "upload"}, call("ovpn_upload"))
+ entry( {"admin", "vpn", "openvpn"}, cbi("openvpn"), _("OpenVPN") )
+ entry( {"admin", "vpn", "openvpn", "basic"}, cbi("openvpn-basic"), nil ).leaf = true
+ entry( {"admin", "vpn", "openvpn", "advanced"}, cbi("openvpn-advanced"), nil ).leaf = true
+ entry( {"admin", "vpn", "openvpn", "file"}, form("openvpn-file"), nil ).leaf = true
+ entry( {"admin", "vpn", "openvpn", "upload"}, call("ovpn_upload"))
end
function ovpn_upload()
@@ -50,5 +50,5 @@ function ovpn_upload()
end
end
end
- http.redirect(luci.dispatcher.build_url('admin/services/openvpn'))
+ http.redirect(luci.dispatcher.build_url('admin/vpn/openvpn'))
end
diff --git a/applications/luci-app-openvpn/luasrc/model/cbi/openvpn-advanced.lua b/applications/luci-app-openvpn/luasrc/model/cbi/openvpn-advanced.lua
index 18b106c32..1971400b8 100644
--- a/applications/luci-app-openvpn/luasrc/model/cbi/openvpn-advanced.lua
+++ b/applications/luci-app-openvpn/luasrc/model/cbi/openvpn-advanced.lua
@@ -800,7 +800,7 @@ local cts = { }
local params = { }
local m = Map("openvpn")
-m.redirect = luci.dispatcher.build_url("admin", "services", "openvpn")
+m.redirect = luci.dispatcher.build_url("admin", "vpn", "openvpn")
m.apply_on_parse = true
local p = m:section( SimpleSection )
diff --git a/applications/luci-app-openvpn/luasrc/model/cbi/openvpn-basic.lua b/applications/luci-app-openvpn/luasrc/model/cbi/openvpn-basic.lua
index 132c4d8f9..86a76d5c8 100644
--- a/applications/luci-app-openvpn/luasrc/model/cbi/openvpn-basic.lua
+++ b/applications/luci-app-openvpn/luasrc/model/cbi/openvpn-basic.lua
@@ -95,7 +95,7 @@ local basicParams = {
local m = Map("openvpn")
-m.redirect = luci.dispatcher.build_url("admin", "services", "openvpn")
+m.redirect = luci.dispatcher.build_url("admin", "vpn", "openvpn")
m.apply_on_parse = true
local p = m:section( SimpleSection )
diff --git a/applications/luci-app-openvpn/luasrc/model/cbi/openvpn.lua b/applications/luci-app-openvpn/luasrc/model/cbi/openvpn.lua
index 41266d860..9164f7f60 100644
--- a/applications/luci-app-openvpn/luasrc/model/cbi/openvpn.lua
+++ b/applications/luci-app-openvpn/luasrc/model/cbi/openvpn.lua
@@ -18,9 +18,9 @@ local cfg = s:option(DummyValue, "config")
function cfg.cfgvalue(self, section)
local file_cfg = self.map:get(section, "config")
if file_cfg then
- s.extedit = luci.dispatcher.build_url("admin", "services", "openvpn", "file", "%s")
+ s.extedit = luci.dispatcher.build_url("admin", "vpn", "openvpn", "file", "%s")
else
- s.extedit = luci.dispatcher.build_url("admin", "services", "openvpn", "basic", "%s")
+ s.extedit = luci.dispatcher.build_url("admin", "vpn", "openvpn", "basic", "%s")
end
end
@@ -117,7 +117,7 @@ end
local updown = s:option( Button, "_updown", translate("Start/Stop") )
updown._state = false
updown.redirect = luci.dispatcher.build_url(
- "admin", "services", "openvpn"
+ "admin", "vpn", "openvpn"
)
function updown.cbid(self, section)
local pid = s.getPID(section)
diff --git a/applications/luci-app-openvpn/luasrc/view/openvpn/cbi-select-input-add.htm b/applications/luci-app-openvpn/luasrc/view/openvpn/cbi-select-input-add.htm
index e75bfda90..3e83df20a 100644
--- a/applications/luci-app-openvpn/luasrc/view/openvpn/cbi-select-input-add.htm
+++ b/applications/luci-app-openvpn/luasrc/view/openvpn/cbi-select-input-add.htm
@@ -54,7 +54,7 @@
if (form)
{
form.enctype = 'multipart/form-data';
- form.action = '<%=url('admin/services/openvpn/upload')%>';
+ form.action = '<%=url('admin/vpn/openvpn/upload')%>';
form.submit();
}
}
diff --git a/applications/luci-app-openvpn/luasrc/view/openvpn/pageswitch.htm b/applications/luci-app-openvpn/luasrc/view/openvpn/pageswitch.htm
index c1fe05215..7d88b844a 100644
--- a/applications/luci-app-openvpn/luasrc/view/openvpn/pageswitch.htm
+++ b/applications/luci-app-openvpn/luasrc/view/openvpn/pageswitch.htm
@@ -8,21 +8,21 @@
<div class="cbi-section">
<h3>
- <a href="<%=url('admin/services/openvpn')%>"><%:Overview%></a> &#187;
+ <a href="<%=url('admin/vpn/openvpn')%>"><%:Overview%></a> &#187;
<%=luci.i18n.translatef("Instance \"%s\"", self.instance)%>
</h3>
<% if self.mode == "basic" then %>
- <a href="<%=url('admin/services/openvpn/advanced', self.instance, "Service")%>"><%:Switch to advanced configuration%> &#187;</a><p/>
+ <a href="<%=url('admin/vpn/openvpn/advanced', self.instance, "Service")%>"><%:Switch to advanced configuration%> &#187;</a><p/>
<hr />
<% elseif self.mode == "advanced" then %>
- <a href="<%=url('admin/services/openvpn/basic', self.instance)%>"><%:Switch to basic configuration%> &#187;</a><p/>
+ <a href="<%=url('admin/vpn/openvpn/basic', self.instance)%>"><%:Switch to basic configuration%> &#187;</a><p/>
<hr />
<%:Configuration category%>:
<% for i, c in ipairs(self.categories) do %>
<% if c == self.category then %>
<strong><%=translate(c)%></strong>
<% else %>
- <a href="<%=luci.dispatcher.build_url("admin", "services", "openvpn", "advanced", self.instance, c)%>"><%=translate(c)%></a>
+ <a href="<%=luci.dispatcher.build_url("admin", "vpn", "openvpn", "advanced", self.instance, c)%>"><%=translate(c)%></a>
<% end %>
<% if next(self.categories, i) then %>|<% end %>
<% end %>
diff --git a/modules/luci-base/luasrc/controller/admin/index.lua b/modules/luci-base/luasrc/controller/admin/index.lua
index 9fcfe4a30..3f2b46587 100644
--- a/modules/luci-base/luasrc/controller/admin/index.lua
+++ b/modules/luci-base/luasrc/controller/admin/index.lua
@@ -51,6 +51,13 @@ function index()
toplevel_page(page, "admin/system/system", alias("admin", "system", "system"))
-- Only used if applications add items
+ page = node("admin", "vpn")
+ page.title = _("VPN")
+ page.order = 30
+ page.index = true
+ toplevel_page(page, false, false)
+
+ -- Only used if applications add items
page = node("admin", "services")
page.title = _("Services")
page.order = 40