luci-app-openvpn: move to new vpn menu section
authorFlorian Eckert <fe@dev.tdt.de>
Mon, 5 Aug 2019 14:28:27 +0000 (16:28 +0200)
committerFlorian Eckert <fe@dev.tdt.de>
Tue, 6 Aug 2019 14:22:44 +0000 (16:22 +0200)
Move the app openvpn to the new vpn menu section.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
applications/luci-app-openvpn/luasrc/controller/openvpn.lua
applications/luci-app-openvpn/luasrc/model/cbi/openvpn-advanced.lua
applications/luci-app-openvpn/luasrc/model/cbi/openvpn-basic.lua
applications/luci-app-openvpn/luasrc/model/cbi/openvpn.lua
applications/luci-app-openvpn/luasrc/view/openvpn/cbi-select-input-add.htm
applications/luci-app-openvpn/luasrc/view/openvpn/pageswitch.htm

index c9a932d870e1443819463ef071dcb2cafa81b331..55c29d1c2ac29c14534a95b09cef47d6307e2b34 100644 (file)
@@ -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
index 18b106c32ed231e2a81d2eae388024f67d12b72d..1971400b80bf7639a6982df0b8af7de912d24bb5 100644 (file)
@@ -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 )
index 132c4d8f995afebadb2b753c2cb9a3245df2c826..86a76d5c8da85d73b62ce0340646856f17de4e97 100644 (file)
@@ -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 )
index 41266d860e523b3c05921287e74f42c17bd5aa54..9164f7f600960a7f09d8ceb9ed76cacde8ef681c 100644 (file)
@@ -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)
index e75bfda900bd3fcfb0fa9f42167dd34af00fcbff..3e83df20a264edc875e182a5e62c6b4f851af3cb 100644 (file)
@@ -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();
                }
        }
index c1fe05215a1c3462bc22918d9a49642bf394331f..7d88b844ab4cbfdbb73d47b69d9d8821ac7dead8 100644 (file)
@@ -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 %>