Globally replace luci.dispatcher.build_url(...) with url(...) invocations
authorJo-Philipp Wich <jow@openwrt.org>
Wed, 7 Oct 2015 17:07:36 +0000 (19:07 +0200)
committerJo-Philipp Wich <jow@openwrt.org>
Wed, 7 Oct 2015 17:07:36 +0000 (19:07 +0200)
Also concat multiple string arguments into one while we're at it.

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
33 files changed:
applications/luci-app-ahcp/luasrc/view/ahcp_status.htm
applications/luci-app-asterisk/luasrc/view/asterisk/dialplans.htm
applications/luci-app-asterisk/luasrc/view/asterisk/dialzones.htm
applications/luci-app-commands/luasrc/view/commands.htm
applications/luci-app-ddns/luasrc/view/ddns/detail_logview.htm
applications/luci-app-ddns/luasrc/view/ddns/overview_status.htm
applications/luci-app-ddns/luasrc/view/ddns/system_status.htm
applications/luci-app-freifunk-diagnostics/luasrc/view/freifunk/diagnostics.htm
applications/luci-app-freifunk-widgets/luasrc/view/freifunk/widgets/search/main.htm
applications/luci-app-ltqtapi/luasrc/view/telephony_status.htm
applications/luci-app-minidlna/luasrc/view/minidlna_status.htm
applications/luci-app-multiwan/luasrc/view/multiwan_status.htm
applications/luci-app-ocserv/luasrc/view/ocserv_status.htm
applications/luci-app-openvpn/luasrc/view/openvpn/pageswitch.htm
applications/luci-app-privoxy/luasrc/view/privoxy/detail_logview.htm
applications/luci-app-privoxy/luasrc/view/privoxy/detail_startstop.htm
applications/luci-app-radicale/luasrc/view/radicale/btn_startstop.htm
applications/luci-app-upnp/luasrc/view/upnp_status.htm
modules/luci-base/luasrc/view/cbi/apply_xhr.htm
modules/luci-base/luasrc/view/cbi/browser.htm
modules/luci-mod-admin-full/luasrc/view/admin_network/diagnostics.htm
modules/luci-mod-admin-full/luasrc/view/admin_network/iface_overview.htm
modules/luci-mod-admin-full/luasrc/view/admin_network/iface_status.htm
modules/luci-mod-admin-full/luasrc/view/admin_network/lease_status.htm
modules/luci-mod-admin-full/luasrc/view/admin_network/switch_status.htm
modules/luci-mod-admin-full/luasrc/view/admin_network/wifi_join.htm
modules/luci-mod-admin-full/luasrc/view/admin_network/wifi_overview.htm
modules/luci-mod-admin-full/luasrc/view/admin_network/wifi_status.htm
modules/luci-mod-admin-full/luasrc/view/admin_status/iptables.htm
modules/luci-mod-admin-full/luasrc/view/admin_system/backupfiles.htm
modules/luci-mod-admin-full/luasrc/view/admin_system/clock_status.htm
modules/luci-mod-admin-full/luasrc/view/admin_system/ipkg.htm
modules/luci-mod-freifunk/luasrc/view/freifunk-map/frame.htm

index 88796cb1c580a485d115e172360f2a2410be2245..946828953e0677c1b086ecf21eaf188657dcc781 100644 (file)
@@ -1,5 +1,5 @@
 <script type="text/javascript">//<![CDATA[
-       XHR.poll(5, '<%=luci.dispatcher.build_url("admin", "network", "ahcpd", "status")%>', null,
+       XHR.poll(5, '<%=url('admin/network/ahcpd/status')%>', null,
                function(x, st)
                {
                        var tb = document.getElementById('ahcpd_status_table');
index 6de7ba122af232f131e42ed3ce3770afb89581b6..9f644ba0748618594c5fff4c97aec5a1a88cb4c5 100644 (file)
@@ -56,7 +56,7 @@
 %>
 
 
-<form method="post" action="<%=luci.dispatcher.build_url("admin", "asterisk", "dialplans")%>" enctype="multipart/form-data">
+<form method="post" action="<%=url('admin/asterisk/dialplans')%>" enctype="multipart/form-data">
        <div>
                <script type="text/javascript" src="/luci-static/resources/cbi.js"></script>
                <input type="hidden" name="cbi.submit" value="1" />
@@ -68,9 +68,9 @@
        <div class="cbi-map-descr">
                Here you can manage your dial plans which are used to route outgoing calls from your local extensions.<br /><br />
                Related tasks:<br />
-               <a href="<%=luci.dispatcher.build_url('admin/asterisk/dialplans/zones')%>" class="cbi-title-ref">Manage dialzones</a> |
-               <a href="<%=luci.dispatcher.build_url('admin/asterisk/voicemail/mailboxes')%>" class="cbi-title-ref">Manage voicemail boxes</a> |
-               <a href="<%=luci.dispatcher.build_url('admin/asterisk/meetme/rooms')%>" class="cbi-title-ref">Manage meetme rooms</a>
+               <a href="<%=url('admin/asterisk/dialplans/zones')%>" class="cbi-title-ref">Manage dialzones</a> |
+               <a href="<%=url('admin/asterisk/voicemail/mailboxes')%>" class="cbi-title-ref">Manage voicemail boxes</a> |
+               <a href="<%=url('admin/asterisk/meetme/rooms')%>" class="cbi-title-ref">Manage meetme rooms</a>
        </div>
        <!-- tblsection -->
        <fieldset class="cbi-section" id="cbi-asterisk-sip">
@@ -85,7 +85,7 @@
                                                <big>Dialplan <em><%=plan.name%></em></big>
                                        </th>
                                        <td>
-                                               <a href="<%=luci.dispatcher.build_url('admin', 'asterisk', 'dialplans')%>?delplan=<%=plan.name%>">
+                                               <a href="<%=url('admin/asterisk/dialplans')%>?delplan=<%=plan.name%>">
                                                        <img style="border:none" alt="Remove this dialplan" title="Remove this dialplan" src="/luci-static/resources/cbi/remove.gif" />
                                                </a>
                                        </td>
                                                </p>
                                        </td>
                                        <td style="width:5%" class="cbi-value-field">
-                                               <a href="<%=luci.dispatcher.build_url('admin/asterisk/dialplans/out', zone.name)%>">
+                                               <a href="<%=url('admin/asterisk/dialplans/out', zone.name)%>">
                                                        <img style="border:none" alt="Edit dialzone" title="Edit dialzone" src="/luci-static/resources/cbi/edit.gif" />
                                                </a>
-                                               <a href="<%=luci.dispatcher.build_url('admin/asterisk/dialplans')%>?delzone.<%=plan.name%>=<%=zone.name%>">
+                                               <a href="<%=url('admin/asterisk/dialplans')%>?delzone.<%=plan.name%>=<%=zone.name%>">
                                                        <img style="border:none" alt="Remove from this dialplan" title="Remove from this dialplan" src="/luci-static/resources/cbi/remove.gif" />
                                                </a>
                                        </td>
                                                </p>
                                        </td>
                                        <td style="width:5%" class="cbi-value-field">
-                                               <a href="<%=luci.dispatcher.build_url('admin/asterisk/voicemail/mailboxes')%>">
+                                               <a href="<%=url('admin/asterisk/voicemail/mailboxes')%>">
                                                        <img style="border:none" alt="Manage mailboxes ..." title="Manage mailboxes ..." src="/luci-static/resources/cbi/edit.gif" />
                                                </a>
-                                               <a href="<%=luci.dispatcher.build_url('admin/asterisk/dialplans')%>?delvbox.<%=plan.name%>=<%=ext%>">
+                                               <a href="<%=url('admin/asterisk/dialplans')%>?delvbox.<%=plan.name%>=<%=ext%>">
                                                        <img style="border:none" alt="Remove from this dialplan" title="Remove from this dialplan" src="/luci-static/resources/cbi/remove.gif" />
                                                </a>
                                        </td>
                                                </p>
                                        </td>
                                        <td style="width:5%" class="cbi-value-field">
-                                               <a href="<%=luci.dispatcher.build_url('admin/asterisk/meetme/rooms')%>">
+                                               <a href="<%=url('admin/asterisk/meetme/rooms')%>">
                                                        <img style="border:none" alt="Manage conferences ..." title="Manage conferences ..." src="/luci-static/resources/cbi/edit.gif" />
                                                </a>
-                                               <a href="<%=luci.dispatcher.build_url('admin/asterisk/dialplans')%>?delmeetme.<%=plan.name%>=<%=ext%>">
+                                               <a href="<%=url('admin/asterisk/dialplans')%>?delmeetme.<%=plan.name%>=<%=ext%>">
                                                        <img style="border:none" alt="Remove from this dialplan" title="Remove from this dialplan" src="/luci-static/resources/cbi/remove.gif" />
                                                </a>
                                        </td>
index c867bc186084fb8f2672c66862b29cfdc99095c3..ffdbbcf359bbc13d06703368a7471e6d556d6de1 100644 (file)
@@ -47,7 +47,7 @@
 %>
 
 
-<form method="post" action="<%=luci.dispatcher.build_url("admin", "asterisk", "dialplans", "zones")%>" enctype="multipart/form-data">
+<form method="post" action="<%=url('admin/asterisk/dialplans/zones')%>" enctype="multipart/form-data">
        <div>
                <script type="text/javascript" src="/luci-static/resources/cbi.js"></script>
                <input type="hidden" name="cbi.submit" value="1" />
@@ -57,7 +57,7 @@
 <div class="cbi-map" id="cbi-asterisk">
        <h2 name="content">Dial Zone Management</h2>
        <div class="cbi-map-descr">
-               <a href="<%=luci.dispatcher.build_url("admin/asterisk/dialplans")%>" class="cbi-title-ref">Back to dialplan overview</a><br /><br />
+               <a href="<%=url("admin/asterisk/dialplans")%>" class="cbi-title-ref">Back to dialplan overview</a><br /><br />
                Here you can manage your dial zones. The zones are used to route outgoing calls to the destination.
                Each zone groups multiple trunks and number matches to represent a logical destination. Zones can
                also be used to enforce certain dial restrictions on selected extensions.
                                                <%=rule.description or rule.name%>
                                        </td>
                                        <td style="text-align:left" class="cbi-value-field">
-                                               <a href="<%=luci.dispatcher.build_url('admin', 'asterisk', 'dialplans', 'out', rule.name)%>">
+                                               <a href="<%=url('admin/asterisk/dialplans/out', rule.name)%>">
                                                        <img style="border:none" alt="Edit entry" title="Edit entry" src="/luci-static/resources/cbi/edit.gif" />
                                                </a>
-                                               <a href="<%=luci.dispatcher.build_url('admin', 'asterisk', 'dialplans', 'zones')%>?delzone=<%=rule.name%>">
+                                               <a href="<%=url('admin/asterisk/dialplans/zones')%>?delzone=<%=rule.name%>">
                                                        <img style="border:none" alt="Delete entry" title="Delete entry" src="/luci-static/resources/cbi/remove.gif" />
                                                </a>
                                        </td>
index e548757d6b1a04583b282a17451202916918a9f6..73b9e6a2ce5fa45c6f5be60b76ff4f01d6e666e5 100644 (file)
@@ -58,7 +58,7 @@
                        legend.parentNode.style.display = 'block';
                        legend.style.display = 'inline';
 
-                       stxhr.get('<%=luci.dispatcher.build_url("admin", "system", "commands", "run")%>/' + id + (args ? '/' + args : ''), null,
+                       stxhr.get('<%=url('admin/system/commands/run')%>/' + id + (args ? '/' + args : ''), null,
                                function(x, st)
                                {
                                        if (st)
@@ -93,7 +93,7 @@
                if (field)
                        args = encodeURIComponent(field.value);
 
-               location.href = '<%=luci.dispatcher.build_url("admin", "system", "commands", "download")%>/' + id + (args ? '/' + args : '');
+               location.href = '<%=url('admin/system/commands/download')%>/' + id + (args ? '/' + args : '');
        }
 
        function command_link(id)
index 494b7435cd58d755a1892e15f95127dc194e6977..4dcb7bb6fe5edbcd39cb2c18b75d5c0e12d0a315 100644 (file)
@@ -6,7 +6,7 @@
                var txt = document.getElementById("cbid.ddns." + section + "._logview.txt");    // TextArea
                if ( !txt ) { return; } // security check
 
-               XHR.get('<%=luci.dispatcher.build_url("admin", "services", "ddns", "logview")%>/' + section, null,
+               XHR.get('<%=url('admin/services/ddns/logview')%>/' + section, null,
                        function(x) {
                                if (x.responseText == "_nodata_")
                                        txt.value = "<%:File not found or empty%>";
index ea8e4a1e31fb07ce0a6ff6e371ac1a618befba97..54648122239ac0fef9171b053c23d89287d276df 100644 (file)
 
                // do start/stop
                var btnXHR = new XHR();
-               btnXHR.get('<%=luci.dispatcher.build_url("admin", "services", "ddns", "startstop")%>/' + section + '/' + cbx.checked, null,
+               btnXHR.get('<%=url('admin/services/ddns/startstop')%>/' + section + '/' + cbx.checked, null,
                        function(x, data) {
                                if (x.responseText == "_uncommitted_") {
                                        // we need a trick to display Ampersand "&" in stead of "&#38;" or "&amp;"
        }
 
        // force to immediate show status on page load (not waiting for XHR.poll)
-       XHR.get('<%=luci.dispatcher.build_url("admin", "services", "ddns", "status")%>', null,
+       XHR.get('<%=url('admin/services/ddns/status')%>', null,
                function(x, data) {
                        if (data) { _data2elements(data); }
                }
        // define only ONE XHR.poll in a page because if one is running it blocks the other one
        // optimum is to define on Map or Section Level from here you can reach all elements
        // we need update every 15 seconds only
-       XHR.poll(15, '<%=luci.dispatcher.build_url("admin", "services", "ddns", "status")%>', null,
+       XHR.poll(15, '<%=url('admin/services/ddns/status')%>', null,
                function(x, data) {
                        if (data) { _data2elements(data); }
                }
index 4ca0abb0e54a25c98b60d48e51607626e9a9b2a9..06dca48a9c879d05824540a284d3ab91dd00c384 100644 (file)
        }
 
        // force to immediate show status (not waiting for XHR.poll)
-       XHR.get('<%=luci.dispatcher.build_url("admin", "services", "ddns", "status")%>', null,
+       XHR.get('<%=url('admin/services/ddns/status')%>', null,
                function(x, data) {
                        if (data) { _data2elements(x, data); }
                }
        );
 
-       XHR.poll(5, '<%=luci.dispatcher.build_url("admin", "services", "ddns", "status")%>', null,
+       XHR.poll(5, '<%=url('admin/services/ddns/status')%>', null,
                function(x, data) {
                        if (data) { _data2elements(x, data); }
                }
 //]]></script>
 
 <fieldset class="cbi-section" id="ddns_status_section">
-       <legend><a href="<%=luci.dispatcher.build_url([[admin]], [[services]], [[ddns]])%>"><%:Dynamic DNS%></a></legend>
+       <legend><a href="<%=url([[admin]], [[services]], [[ddns]])%>"><%:Dynamic DNS%></a></legend>
 
        <table class="cbi-section-table" id="ddns_status_table">
                <tr class="cbi-section-table-titles">
index ef3342e7409fa815d27579055fe48bb80a4ac2cf..fe205d053b73cb315f7662be8934507882413a85 100644 (file)
@@ -34,7 +34,7 @@ local has_traceroute6 = fs.access("/usr/bin/traceroute6")
                        legend.parentNode.style.display = 'block';
                        legend.style.display = 'inline';
 
-                       stxhr.get('<%=luci.dispatcher.build_url("freifunk", "status")%>/diag_' + tool + protocol + '/' + addr, null,
+                       stxhr.get('<%=url('freifunk/status')%>/diag_' + tool + protocol + '/' + addr, null,
                                function(x)
                                {
                                        if (x.responseText)
index e319f15fbc309fde39a9c7f910414ceca85e3bbb..f2e2fb9069c8c8a0a46a41d8eb55b8b91369a6ec 100644 (file)
@@ -33,7 +33,7 @@ end
 <div id="<%=name%>" style="width:<%=width%>;float:left">
        <h2><%=title%></h2>
        <div id="form_<%=name%>">
-               <form name="searchform" id="search_<%=name%>" action="<%=luci.dispatcher.build_url('freifunk', 'search_redirect')%>">
+               <form name="searchform" id="search_<%=name%>" action="<%=url('freifunk/search_redirect')%>">
                        <input type="text" name="searchterms" style="margin-bottom:15px; width: 90%"><br />
                        <%
                        local checked = " checked"
index 234f90934295020d576c9898ced14140a96abf93..d861ef9fcba9f2a723e637698cb727d6aa852e7e 100644 (file)
@@ -1,5 +1,5 @@
 <script type="text/javascript">//<![CDATA[
-XHR.poll(5, '<%=luci.dispatcher.build_url("admin", "telephony", "status")%>', null,
+XHR.poll(5, '<%=url('admin/telephony/status')%>', null,
        function(x, st)
        {
                var tb = document.getElementById('telephony_status_table');
index 098a72a0732e0c63102eb85b65e12fbedb211664..866eded03e446134da218c62fdc9c56b472f29a8 100644 (file)
@@ -1,5 +1,5 @@
 <script type="text/javascript">//<![CDATA[
-       XHR.poll(5, '<%=luci.dispatcher.build_url("admin/services/minidlna_status")%>', null,
+       XHR.poll(5, '<%=url("admin/services/minidlna_status")%>', null,
                function(x, st)
                {
                        var tb = document.getElementById('minidlna_status');
index 8c4127b2370654d75571f3959c2dabb8fef7620f..03bfad1c5dfa2fbfe95e5b6e5fb22d1d15bfdfeb 100644 (file)
@@ -1,5 +1,5 @@
 <script type="text/javascript">//<![CDATA[
-       XHR.poll(5, '<%=luci.dispatcher.build_url("admin", "network", "multiwan", "status")%>', null,
+       XHR.poll(5, '<%=url('admin/network/multiwan/status')%>', null,
                function(x, st)
                {
                        var tx = document.getElementById('multiwan_status_text');
index fabc1bca9ed03445b30a11813e1b388d1144c781..138b03915a70ff16dbd48c69168dd976eafccbd0 100644 (file)
@@ -1,7 +1,7 @@
 <script type="text/javascript">//<![CDATA[
 
        function ocserv_disconnect(idx) {
-               XHR.get('<%=luci.dispatcher.build_url("admin", "services", "ocserv", "disconnect")%>/' + idx, null,
+               XHR.get('<%=url('admin/services/ocserv/disconnect')%>/' + idx, null,
                        function(x)
                        {
                                var tb = document.getElementById('ocserv_status_table');
@@ -11,7 +11,7 @@
                );
        }
 
-       XHR.poll(5, '<%=luci.dispatcher.build_url("admin", "services", "ocserv", "status")%>', null,
+       XHR.poll(5, '<%=url('admin/services/ocserv/status')%>', null,
                function(x, st)
                {
                        var tb = document.getElementById('ocserv_status_table');
index ac5c8936ece7e3bb08fc389c30f438fccfa863b8..f22cb68c7bfaee1330dd0ce38c48c7f14e4abd1a 100644 (file)
@@ -6,14 +6,14 @@
 
 <fieldset class="cbi-section">
        <legend>
-               <a href="<%=luci.dispatcher.build_url("admin", "services", "openvpn")%>"><%:Overview%></a> &raquo;
+               <a href="<%=url('admin/services/openvpn')%>"><%:Overview%></a> &raquo;
                <%=luci.i18n.translatef("Instance \"%s\"", self.instance)%>
        </legend>
 
        <% if self.mode == "basic" then %>
-               <a href="<%=luci.dispatcher.build_url("admin", "services", "openvpn", "advanced", self.instance, "Service")%>"><%:Switch to advanced configuration Â»%></a>
+               <a href="<%=url('admin/services/openvpn/advanced', self.instance, "Service")%>"><%:Switch to advanced configuration Â»%></a>
        <% else %>
-               <a href="<%=luci.dispatcher.build_url("admin", "services", "openvpn", "basic", self.instance)%>"><%:« Switch to basic configuration%></a>
+               <a href="<%=url('admin/services/openvpn/basic', self.instance)%>"><%:« Switch to basic configuration%></a>
                <hr style="margin:0.5em 0" />
                <%:Configuration category%>:
                <% for i, c in ipairs(self.categories) do %>
index 3e190709fbb09d93b3d00ed8da658deb5e501e76..ab0019bdd4f62f8197858892a8857bf8e855ec17 100644 (file)
@@ -6,7 +6,7 @@
                var txt = document.getElementById("cbid.privoxy.privoxy._logview.txt"); // TextArea
                if ( !txt ) { return; } // security check
                var lvXHR = new XHR();
-               lvXHR.get('<%=luci.dispatcher.build_url("admin", "services", "privoxy", "logview")%>', null,
+               lvXHR.get('<%=url('admin/services/privoxy/logview')%>', null,
                        function(x) {
                                if (x.responseText == "_nodata_")
                                        txt.value = "<%:File not found or empty%>";
index b9de8864e49210540196eceaaa944dbb11ff714d..8c97daeee2f09cec629d211c12ada5732a183bd9 100644 (file)
        function onclick_startstop(id) {
                // do start/stop
                var btnXHR = new XHR();
-               btnXHR.get('<%=luci.dispatcher.build_url("admin", "services", "privoxy", "startstop")%>', null,
+               btnXHR.get('<%=url('admin/services/privoxy/startstop')%>', null,
                        function(x) { _data2elements(x); }
                );
        }
 
-       XHR.poll(5, '<%=luci.dispatcher.build_url("admin", "services", "privoxy", "status")%>', null,
+       XHR.poll(5, '<%=url('admin/services/privoxy/status')%>', null,
                function(x, data) { _data2elements(x); }
        );
 
index 79d1c36297717b1cf7772297dbfc54f38c81f154..b34627536d9b27128cdb2de648c50611d223a3c5 100644 (file)
        function onclick_startstop(id) {
                // do start/stop
                var btnXHR = new XHR();
-               btnXHR.get('<%=luci.dispatcher.build_url("admin", "services", "radicale", "startstop")%>', null,
+               btnXHR.get('<%=url('admin/services/radicale/startstop')%>', null,
                        function(x) { _data2elements(x); }
                );
        }
 
-       XHR.poll(5, '<%=luci.dispatcher.build_url("admin", "services", "radicale", "status")%>', null,
+       XHR.poll(5, '<%=url('admin/services/radicale/status')%>', null,
                function(x, data) { _data2elements(x); }
        );
 
index d50ed0c4d702d100883292f76378fdc076a88741..ce735cf7b107f68c510de24a0fe66fb6a2833985 100644 (file)
@@ -1,6 +1,6 @@
 <script type="text/javascript">//<![CDATA[
        function upnp_delete_fwd(idx) {
-               XHR.get('<%=luci.dispatcher.build_url("admin", "services", "upnp", "delete")%>/' + idx, null,
+               XHR.get('<%=url('admin/services/upnp/delete')%>/' + idx, null,
                        function(x)
                        {
                                var tb = document.getElementById('upnp_status_table');
@@ -10,7 +10,7 @@
                );
        }
 
-       XHR.poll(5, '<%=luci.dispatcher.build_url("admin", "services", "upnp", "status")%>', null,
+       XHR.poll(5, '<%=url('admin/services/upnp/status')%>', null,
                function(x, st)
                {
                        var tb = document.getElementById('upnp_status_table');
index 6f63ba86be80b3e574c881bbb506ff3a3f0e923e..daa57c1db797a0a79078bc92b71f46ef5d80184a 100644 (file)
@@ -4,10 +4,10 @@
        <script type="text/javascript">//<![CDATA[
                var apply_xhr = new XHR();
 
-               apply_xhr.post('<%=luci.dispatcher.build_url("servicectl", "restart", table.concat(configs, ","))%>', { token: '<%=token%>' },
+               apply_xhr.post('<%=url('servicectl/restart', table.concat(configs, ","))%>', { token: '<%=token%>' },
                        function() {
                                var checkfinish = function() {
-                                       apply_xhr.get('<%=luci.dispatcher.build_url("servicectl", "status")%>', null,
+                                       apply_xhr.get('<%=url('servicectl/status')%>', null,
                                                function(x) {
                                                        if( x.responseText == 'finish' )
                                                        {
index e4a4077d55bb9317aa79365104a49aedfd616516..a18120141d5a929e75d76f8e65358b60c5457293 100644 (file)
@@ -2,6 +2,6 @@
 <%+cbi/valueheader%>
        <input class="cbi-input-text" type="text"<%= attr("value", v) .. attr("name", cbid) .. attr("id", cbid) %> />
        <script type="text/javascript">
-cbi_browser_init('<%=cbid%>', '<%=resource%>', '<%=luci.dispatcher.build_url("admin", "filebrowser")%>'<%=self.default_path and ", '"..self.default_path.."'"%>);
+cbi_browser_init('<%=cbid%>', '<%=resource%>', '<%=url('admin/filebrowser')%>'<%=self.default_path and ", '"..self.default_path.."'"%>);
        </script>
 <%+cbi/valuefooter%>
index 8a6c90fc21890d304354489c054528481c75018f..e06a88debed4b11b8c2b6f448617c07e8f7a1ec3 100644 (file)
@@ -34,7 +34,7 @@ local has_traceroute6 = fs.access("/usr/bin/traceroute6")
                        legend.parentNode.style.display = 'block';
                        legend.style.display = 'inline';
 
-                       stxhr.get('<%=luci.dispatcher.build_url("admin", "network")%>/diag_' + tool + protocol + '/' + addr, null,
+                       stxhr.get('<%=url('admin/network')%>/diag_' + tool + protocol + '/' + addr, null,
                                function(x)
                                {
                                        if (x.responseText)
index 1de349856ee1b7a1ce07d954ca2b909c1015a9d6..4cdf2df9589301718b921c81819b67d2cbc7b5a4 100644 (file)
@@ -49,7 +49,7 @@
                        s.innerHTML = '<%:Waiting for changes to be applied...%>';
                }
 
-               XHR.get('<%=luci.dispatcher.build_url("admin", "network")%>/iface_' + (reconnect ? 'reconnect' : 'shutdown') + '/' + id, null,
+               XHR.get('<%=url('admin/network')%>/iface_' + (reconnect ? 'reconnect' : 'shutdown') + '/' + id, null,
                        function(x)
                        {
                                if (s)
@@ -71,7 +71,7 @@
        var wifidevs = <%=luci.http.write_json(netdevs)%>;
        var arptable = <%=luci.http.write_json(arpcache)%>;
 
-       XHR.poll(5, '<%=luci.dispatcher.build_url("admin", "network", "iface_status", table.concat(ifaces, ","))%>', null,
+       XHR.poll(5, '<%=url('admin/network/iface_status', table.concat(ifaces, ","))%>', null,
                function(x, ifcs)
                {
                        if (ifcs)
                                                d.innerHTML = String.format(
                                                        '<em><%:Unsupported protocol type.%></em><br />' +
                                                        '<a href="%h"><%:Install protocol extensions...%></a>',
-                                                               '<%=luci.dispatcher.build_url("admin/system/packages")%>?query=luci-proto&display=available'
+                                                               '<%=url("admin/system/packages")%>?query=luci-proto&display=available'
                                                );
                                        }
                                        else if (d && !ifc.ifname)
                                        {
                                                d.innerHTML = String.format(
                                                        '<em><%:Network without interfaces.%></em><br />' +
-                                                       '<a href="<%=luci.dispatcher.build_url("admin/network/network/%s")%>?tab.network.%s=physical"><%:Assign interfaces...%></a>',
+                                                       '<a href="<%=url("admin/network/network/%s")%>?tab.network.%s=physical"><%:Assign interfaces...%></a>',
                                                                ifc.name, ifc.name
                                                );
                                        }
                                        <td style="width:420px">
                                                <input type="button" class="cbi-button cbi-button-reload" style="width:100px" onclick="iface_shutdown('<%=net[1]%>', true)" title="<%:Reconnect this interface%>" value="<%:Connect%>" />
                                                <input type="button" class="cbi-button cbi-button-reset" style="width:100px" onclick="iface_shutdown('<%=net[1]%>', false)" title="<%:Shutdown this interface%>" value="<%:Stop%>" />
-                                               <input type="button" class="cbi-button cbi-button-edit" style="width:100px" onclick="location.href='<%=luci.dispatcher.build_url("admin/network/network", net[1])%>'" title="<%:Edit this interface%>" value="<%:Edit%>" id="<%=net[1]%>-ifc-edit" />
-                                               <input type="button" class="cbi-button cbi-button-remove" style="width:100px" onclick="if (confirm('<%:Really delete this interface? The deletion cannot be undone!\nYou might lose access to this device if you are connected via this interface.%>')) location.href='<%=luci.dispatcher.build_url("admin/network/iface_delete", net[1])%>'" title="<%:Delete this interface%>" value="<%:Delete%>" />
+                                               <input type="button" class="cbi-button cbi-button-edit" style="width:100px" onclick="location.href='<%=url("admin/network/network", net[1])%>'" title="<%:Edit this interface%>" value="<%:Edit%>" id="<%=net[1]%>-ifc-edit" />
+                                               <input type="button" class="cbi-button cbi-button-remove" style="width:100px" onclick="if (confirm('<%:Really delete this interface? The deletion cannot be undone!\nYou might lose access to this device if you are connected via this interface.%>')) location.href='<%=url("admin/network/iface_delete", net[1])%>'" title="<%:Delete this interface%>" value="<%:Delete%>" />
                                        </td>
                                </tr>
                        <% end %>
                </table>
 
-               <input type="button" class="cbi-button cbi-button-add" value="<%:Add new interface...%>" onclick="location.href='<%=luci.dispatcher.build_url("admin/network/iface_add")%>'" />
+               <input type="button" class="cbi-button cbi-button-add" value="<%:Add new interface...%>" onclick="location.href='<%=url("admin/network/iface_add")%>'" />
        </fieldset>
 </div>
index 8136383969176013f130388949c6a4c1cc8b9746..1ebdbfcfb451933c99c64ccbf16c05c0763be6ee 100644 (file)
@@ -1,7 +1,7 @@
 <%+cbi/valueheader%>
 
 <script type="text/javascript">//<![CDATA[
-       XHR.poll(5, '<%=luci.dispatcher.build_url("admin", "network", "iface_status", self.network)%>', null,
+       XHR.poll(5, '<%=url('admin/network/iface_status', self.network)%>', null,
                function(x, ifc)
                {
                        if (ifc && (ifc = ifc[0]))
index 0ba334ee9d397144b854699e7790c6a36401dea9..ab8e73257366f5b8683fb105c695092e31e1a9be 100644 (file)
@@ -1,5 +1,5 @@
 <script type="text/javascript">//<![CDATA[
-       XHR.poll(5, '<%=luci.dispatcher.build_url("admin", "network", "dhcplease_status")%>', null,
+       XHR.poll(5, '<%=url('admin/network/dhcplease_status')%>', null,
                function(x, st)
                {
                        var tb = document.getElementById('lease_status_table');
index b299575e2f2ad9d51fb803e0ba1260772391c00b..53c35ae59c523f02da0150cd78ce3cbdd2c3d5d5 100644 (file)
@@ -1,6 +1,6 @@
 <script type="text/javascript">//<![CDATA[
        var switches = [ '<%=table.concat(self.switches, "', '")%>' ];
-       XHR.poll(5, '<%=luci.dispatcher.build_url("admin", "network", "switch_status")%>/' + switches.join(','), null,
+       XHR.poll(5, '<%=url('admin/network/switch_status')%>/' + switches.join(','), null,
                function(x, st)
                {
                        for (var i = 0; i < switches.length; i++)
index 431afb57911d6bfbbb47505d6a9f7e1ebc249e22..671d16ed037871f12e56607b9bfcdb04190564bc 100644 (file)
        </fieldset>
 </div>
 <div class="cbi-page-actions right">
-       <form class="inline" action="<%=luci.dispatcher.build_url("admin/network/wireless")%>" method="get">
+       <form class="inline" action="<%=url("admin/network/wireless")%>" method="get">
                <input class="cbi-button cbi-button-reset" type="submit" value="<%:Back to overview%>" />
        </form>
        <form class="inline" action="<%=REQUEST_URI%>" method="get">
index ca1f20baed4dc75a46018d94aec908c808ecbaec..17afe0d6c243447dd7ef27802a336a6c4268f149 100644 (file)
                                st.innerHTML = '<em><%:Wireless is restarting...%></em>';
                }
 
-               XHR.get('<%=luci.dispatcher.build_url("admin", "network")%>/wireless_' + (reconnect ? 'reconnect' : 'shutdown') + '/' + id, null,
+               XHR.get('<%=url('admin/network')%>/wireless_' + (reconnect ? 'reconnect' : 'shutdown') + '/' + id, null,
                        function(x)
                        {
                                if (s)
                );
        }
 
-       XHR.poll(5, '<%=luci.dispatcher.build_url("admin", "network", "wireless_status", table.concat(netlist, ","))%>', null,
+       XHR.poll(5, '<%=url('admin/network/wireless_status', table.concat(netlist, ","))%>', null,
                function(x, st)
                {
                        if (st)
                                        <span id="<%=dev:name()%>-iw-devinfo"></span>
                                </td>
                                <td style="width:310px;text-align:right">
-                                       <input type="button" class="cbi-button cbi-button-find" style="width:100px" onclick="location.href='<%=luci.dispatcher.build_url("admin/network/wireless_join")%>?device=<%=dev:name()%>'" title="<%:Find and join network%>" value="<%:Scan%>" />
-                                       <input type="button" class="cbi-button cbi-button-add" style="width:100px" onclick="location.href='<%=luci.dispatcher.build_url("admin/network/wireless_add")%>?device=<%=dev:name()%>'" title="<%:Provide new network%>" value="<%:Add%>" />
+                                       <input type="button" class="cbi-button cbi-button-find" style="width:100px" onclick="location.href='<%=url("admin/network/wireless_join")%>?device=<%=dev:name()%>'" title="<%:Find and join network%>" value="<%:Scan%>" />
+                                       <input type="button" class="cbi-button cbi-button-add" style="width:100px" onclick="location.href='<%=url("admin/network/wireless_add")%>?device=<%=dev:name()%>'" title="<%:Provide new network%>" value="<%:Add%>" />
                                </td>
                        </tr>
                        <!-- /physical device -->
                                        <td class="cbi-value-field" style="width:310px;text-align:right">
                                                <input id="<%=net:id()%>-iw-toggle" type="button" class="cbi-button cbi-button-reload" style="width:100px" onclick="wifi_shutdown('<%=net:id()%>', this)" title="<%:Delete this network%>" value="<%:Enable%>" />
                                                <input type="button" class="cbi-button cbi-button-edit" style="width:100px" onclick="location.href='<%=net:adminlink()%>'" title="<%:Edit this network%>" value="<%:Edit%>" />
-                                               <input type="button" class="cbi-button cbi-button-remove" style="width:100px" onclick="if (confirm('<%:Really delete this wireless network? The deletion cannot be undone!\nYou might lose access to this device if you are connected via this network.%>')) location.href='<%=luci.dispatcher.build_url("admin/network/wireless_delete", net:ifname())%>'" title="<%:Delete this network%>" value="<%:Remove%>" />
+                                               <input type="button" class="cbi-button cbi-button-remove" style="width:100px" onclick="if (confirm('<%:Really delete this wireless network? The deletion cannot be undone!\nYou might lose access to this device if you are connected via this network.%>')) location.href='<%=url("admin/network/wireless_delete", net:ifname())%>'" title="<%:Delete this network%>" value="<%:Remove%>" />
                                        </td>
                                </tr>
                                <% end %>
index fa0a97b707631276dd8f910fe31cc322a17d3ea1..04687f38e74e34dc5f2b128f9fd7af8d16fa2581 100644 (file)
@@ -1,7 +1,7 @@
 <%+cbi/valueheader%>
 
 <script type="text/javascript">//<![CDATA[
-       XHR.poll(5, '<%=luci.dispatcher.build_url("admin", "network", "wireless_status", self.ifname)%>', null,
+       XHR.poll(5, '<%=url('admin/network/wireless_status', self.ifname)%>', null,
                function(x, iw)
                {
                        if (iw && (iw = iw[0]))
index c1f982d1629dbf795e2ed6e4e4ad9d6ec8c39d95..3757388699aeed663a16fa5a8761c4ede39e7a7f 100644 (file)
@@ -63,8 +63,8 @@
 
 <% if has_ip6tables then %>
 <ul class="cbi-tabmenu">
-       <li class="cbi-tab<%= mode ~= 4 and "-disabled" %>"><a href="<%=luci.dispatcher.build_url("admin/status/iptables/4")%>"><%:IPv4 Firewall%></a></li>
-       <li class="cbi-tab<%= mode ~= 6 and "-disabled" %>"><a href="<%=luci.dispatcher.build_url("admin/status/iptables/6")%>"><%:IPv6 Firewall%></a></li>
+       <li class="cbi-tab<%= mode ~= 4 and "-disabled" %>"><a href="<%=url("admin/status/iptables/4")%>"><%:IPv4 Firewall%></a></li>
+       <li class="cbi-tab<%= mode ~= 6 and "-disabled" %>"><a href="<%=url("admin/status/iptables/6")%>"><%:IPv6 Firewall%></a></li>
 </ul>
 <% end %>
 
index 0a6df109dfa8b761c7a8b45492da66b2c1c5a0f2..c1f3361ae2271c69c9fd71805759236a62450454 100644 (file)
@@ -5,6 +5,6 @@
 -%>
 
 <ul class="cbi-tabmenu">
-       <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/system/flashops")%>"><%:Actions%></a></li>
+       <li class="cbi-tab-disabled"><a href="<%=url("admin/system/flashops")%>"><%:Actions%></a></li>
        <li class="cbi-tab"><a href="#"><%:Configuration%></a></li>
 </ul>
index 84e151075f0ebe2a55b2e1af2b0be39a704d6e5f..19be072fefe10936906ef12c259f46e56820b2ef 100644 (file)
@@ -1,7 +1,7 @@
 <%+cbi/valueheader%>
 
 <script type="text/javascript">//<![CDATA[
-       XHR.poll(5, '<%=luci.dispatcher.build_url("admin", "system", "clock_status")%>', null,
+       XHR.poll(5, '<%=url('admin/system/clock_status')%>', null,
                function(x, rv)
                {
                        var s = document.getElementById('<%=self.option%>-clock-status');
@@ -17,7 +17,7 @@
                btn.disabled = true;
                btn.value    = '<%:Synchronizing...%>';
 
-               XHR.get('<%=luci.dispatcher.build_url("admin", "system", "clock_status")%>',
+               XHR.get('<%=url('admin/system/clock_status')%>',
                        { set: Math.floor((new Date()).getTime() / 1000) },
                        function()
                        {
index 6b812e837e74a2d7f74210874954cd9a24c0113a..a7ff4e50bdbf2d8b48a41e0ec3518e1fc48655e9 100644 (file)
@@ -5,6 +5,6 @@
 -%>
 
 <ul class="cbi-tabmenu">
-       <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/system/packages")%>"><%:Actions%></a></li>
+       <li class="cbi-tab-disabled"><a href="<%=url("admin/system/packages")%>"><%:Actions%></a></li>
        <li class="cbi-tab"><a href="#"><%:Configuration%></a></li>
 </ul>
index b2e168363ff194b000bae4ccb23fe4ad92e85dca..dbf3820f5c17821431c240578b2e59db0c7a0875 100644 (file)
@@ -11,7 +11,7 @@
 %>
 
 <% if has_latlon then %>
-       <iframe style="width:100%; height:640px; border:none" src="<%=luci.dispatcher.build_url("freifunk/map/content")%>"></iframe>
+       <iframe style="width:100%; height:640px; border:none" src="<%=url("freifunk/map/content")%>"></iframe>
        <h3><%:Legend%>:</h3>
        <ul>
                <li><strong><span style="color:#00cc00"><%:Green%></span></strong>:<%:Very good (ETX < 2)%></li>