From a63b465adb8ede7b62f60285b8cd30daa5e4afd0 Mon Sep 17 00:00:00 2001 From: Florian Eckert Date: Mon, 5 Aug 2019 16:28:27 +0200 Subject: [PATCH] luci-app-openvpn: move to new vpn menu section Move the app openvpn to the new vpn menu section. Signed-off-by: Florian Eckert --- .../luci-app-openvpn/luasrc/controller/openvpn.lua | 12 ++++++------ .../luasrc/model/cbi/openvpn-advanced.lua | 2 +- .../luasrc/model/cbi/openvpn-basic.lua | 2 +- .../luci-app-openvpn/luasrc/model/cbi/openvpn.lua | 6 +++--- .../luasrc/view/openvpn/cbi-select-input-add.htm | 2 +- .../luasrc/view/openvpn/pageswitch.htm | 8 ++++---- 6 files changed, 16 insertions(+), 16 deletions(-) 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 @@

- <%:Overview%> » + <%:Overview%> » <%=luci.i18n.translatef("Instance \"%s\"", self.instance)%>

<% if self.mode == "basic" then %> - "><%:Switch to advanced configuration%> »

+ "><%:Switch to advanced configuration%> »


<% elseif self.mode == "advanced" then %> - <%:Switch to basic configuration%> »

+ <%:Switch to basic configuration%> »


<%:Configuration category%>: <% for i, c in ipairs(self.categories) do %> <% if c == self.category then %> <%=translate(c)%> <% else %> - "><%=translate(c)%> + "><%=translate(c)%> <% end %> <% if next(self.categories, i) then %>|<% end %> <% end %> -- 2.25.1