summaryrefslogtreecommitdiffhomepage
path: root/modules
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2015-10-07 19:07:36 +0200
committerJo-Philipp Wich <jow@openwrt.org>2015-10-07 19:07:36 +0200
commit281d2f617899a0c3a171a66c6a3a14e834aa000c (patch)
tree4b53f67e82b64bb506b3a219a29319b64d1c1ab2 /modules
parent49a2cb5ad11ccc0225fd3fa1de4b85a0618bbb99 (diff)
Globally replace luci.dispatcher.build_url(...) with url(...) invocations
Also concat multiple string arguments into one while we're at it. Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
Diffstat (limited to 'modules')
-rw-r--r--modules/luci-base/luasrc/view/cbi/apply_xhr.htm4
-rw-r--r--modules/luci-base/luasrc/view/cbi/browser.htm2
-rw-r--r--modules/luci-mod-admin-full/luasrc/view/admin_network/diagnostics.htm2
-rw-r--r--modules/luci-mod-admin-full/luasrc/view/admin_network/iface_overview.htm14
-rw-r--r--modules/luci-mod-admin-full/luasrc/view/admin_network/iface_status.htm2
-rw-r--r--modules/luci-mod-admin-full/luasrc/view/admin_network/lease_status.htm2
-rw-r--r--modules/luci-mod-admin-full/luasrc/view/admin_network/switch_status.htm2
-rw-r--r--modules/luci-mod-admin-full/luasrc/view/admin_network/wifi_join.htm2
-rw-r--r--modules/luci-mod-admin-full/luasrc/view/admin_network/wifi_overview.htm10
-rw-r--r--modules/luci-mod-admin-full/luasrc/view/admin_network/wifi_status.htm2
-rw-r--r--modules/luci-mod-admin-full/luasrc/view/admin_status/iptables.htm4
-rw-r--r--modules/luci-mod-admin-full/luasrc/view/admin_system/backupfiles.htm2
-rw-r--r--modules/luci-mod-admin-full/luasrc/view/admin_system/clock_status.htm4
-rw-r--r--modules/luci-mod-admin-full/luasrc/view/admin_system/ipkg.htm2
-rw-r--r--modules/luci-mod-freifunk/luasrc/view/freifunk-map/frame.htm2
15 files changed, 28 insertions, 28 deletions
diff --git a/modules/luci-base/luasrc/view/cbi/apply_xhr.htm b/modules/luci-base/luasrc/view/cbi/apply_xhr.htm
index 6f63ba86b..daa57c1db 100644
--- a/modules/luci-base/luasrc/view/cbi/apply_xhr.htm
+++ b/modules/luci-base/luasrc/view/cbi/apply_xhr.htm
@@ -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' )
{
diff --git a/modules/luci-base/luasrc/view/cbi/browser.htm b/modules/luci-base/luasrc/view/cbi/browser.htm
index e4a4077d5..a18120141 100644
--- a/modules/luci-base/luasrc/view/cbi/browser.htm
+++ b/modules/luci-base/luasrc/view/cbi/browser.htm
@@ -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%>
diff --git a/modules/luci-mod-admin-full/luasrc/view/admin_network/diagnostics.htm b/modules/luci-mod-admin-full/luasrc/view/admin_network/diagnostics.htm
index 8a6c90fc2..e06a88deb 100644
--- a/modules/luci-mod-admin-full/luasrc/view/admin_network/diagnostics.htm
+++ b/modules/luci-mod-admin-full/luasrc/view/admin_network/diagnostics.htm
@@ -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)
diff --git a/modules/luci-mod-admin-full/luasrc/view/admin_network/iface_overview.htm b/modules/luci-mod-admin-full/luasrc/view/admin_network/iface_overview.htm
index 1de349856..4cdf2df95 100644
--- a/modules/luci-mod-admin-full/luasrc/view/admin_network/iface_overview.htm
+++ b/modules/luci-mod-admin-full/luasrc/view/admin_network/iface_overview.htm
@@ -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)
@@ -178,14 +178,14 @@
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
);
}
@@ -239,13 +239,13 @@
<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>
diff --git a/modules/luci-mod-admin-full/luasrc/view/admin_network/iface_status.htm b/modules/luci-mod-admin-full/luasrc/view/admin_network/iface_status.htm
index 813638396..1ebdbfcfb 100644
--- a/modules/luci-mod-admin-full/luasrc/view/admin_network/iface_status.htm
+++ b/modules/luci-mod-admin-full/luasrc/view/admin_network/iface_status.htm
@@ -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]))
diff --git a/modules/luci-mod-admin-full/luasrc/view/admin_network/lease_status.htm b/modules/luci-mod-admin-full/luasrc/view/admin_network/lease_status.htm
index 0ba334ee9..ab8e73257 100644
--- a/modules/luci-mod-admin-full/luasrc/view/admin_network/lease_status.htm
+++ b/modules/luci-mod-admin-full/luasrc/view/admin_network/lease_status.htm
@@ -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');
diff --git a/modules/luci-mod-admin-full/luasrc/view/admin_network/switch_status.htm b/modules/luci-mod-admin-full/luasrc/view/admin_network/switch_status.htm
index b299575e2..53c35ae59 100644
--- a/modules/luci-mod-admin-full/luasrc/view/admin_network/switch_status.htm
+++ b/modules/luci-mod-admin-full/luasrc/view/admin_network/switch_status.htm
@@ -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++)
diff --git a/modules/luci-mod-admin-full/luasrc/view/admin_network/wifi_join.htm b/modules/luci-mod-admin-full/luasrc/view/admin_network/wifi_join.htm
index 431afb579..671d16ed0 100644
--- a/modules/luci-mod-admin-full/luasrc/view/admin_network/wifi_join.htm
+++ b/modules/luci-mod-admin-full/luasrc/view/admin_network/wifi_join.htm
@@ -135,7 +135,7 @@
</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">
diff --git a/modules/luci-mod-admin-full/luasrc/view/admin_network/wifi_overview.htm b/modules/luci-mod-admin-full/luasrc/view/admin_network/wifi_overview.htm
index ca1f20bae..17afe0d6c 100644
--- a/modules/luci-mod-admin-full/luasrc/view/admin_network/wifi_overview.htm
+++ b/modules/luci-mod-admin-full/luasrc/view/admin_network/wifi_overview.htm
@@ -149,7 +149,7 @@
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)
@@ -167,7 +167,7 @@
);
}
- 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)
@@ -370,8 +370,8 @@
<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 -->
@@ -391,7 +391,7 @@
<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 %>
diff --git a/modules/luci-mod-admin-full/luasrc/view/admin_network/wifi_status.htm b/modules/luci-mod-admin-full/luasrc/view/admin_network/wifi_status.htm
index fa0a97b70..04687f38e 100644
--- a/modules/luci-mod-admin-full/luasrc/view/admin_network/wifi_status.htm
+++ b/modules/luci-mod-admin-full/luasrc/view/admin_network/wifi_status.htm
@@ -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]))
diff --git a/modules/luci-mod-admin-full/luasrc/view/admin_status/iptables.htm b/modules/luci-mod-admin-full/luasrc/view/admin_status/iptables.htm
index c1f982d16..375738869 100644
--- a/modules/luci-mod-admin-full/luasrc/view/admin_status/iptables.htm
+++ b/modules/luci-mod-admin-full/luasrc/view/admin_status/iptables.htm
@@ -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 %>
diff --git a/modules/luci-mod-admin-full/luasrc/view/admin_system/backupfiles.htm b/modules/luci-mod-admin-full/luasrc/view/admin_system/backupfiles.htm
index 0a6df109d..c1f3361ae 100644
--- a/modules/luci-mod-admin-full/luasrc/view/admin_system/backupfiles.htm
+++ b/modules/luci-mod-admin-full/luasrc/view/admin_system/backupfiles.htm
@@ -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>
diff --git a/modules/luci-mod-admin-full/luasrc/view/admin_system/clock_status.htm b/modules/luci-mod-admin-full/luasrc/view/admin_system/clock_status.htm
index 84e151075..19be072fe 100644
--- a/modules/luci-mod-admin-full/luasrc/view/admin_system/clock_status.htm
+++ b/modules/luci-mod-admin-full/luasrc/view/admin_system/clock_status.htm
@@ -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()
{
diff --git a/modules/luci-mod-admin-full/luasrc/view/admin_system/ipkg.htm b/modules/luci-mod-admin-full/luasrc/view/admin_system/ipkg.htm
index 6b812e837..a7ff4e50b 100644
--- a/modules/luci-mod-admin-full/luasrc/view/admin_system/ipkg.htm
+++ b/modules/luci-mod-admin-full/luasrc/view/admin_system/ipkg.htm
@@ -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>
diff --git a/modules/luci-mod-freifunk/luasrc/view/freifunk-map/frame.htm b/modules/luci-mod-freifunk/luasrc/view/freifunk-map/frame.htm
index b2e168363..dbf3820f5 100644
--- a/modules/luci-mod-freifunk/luasrc/view/freifunk-map/frame.htm
+++ b/modules/luci-mod-freifunk/luasrc/view/freifunk-map/frame.htm
@@ -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>