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>
pull/505/head
Jo-Philipp Wich 2015-10-07 19:07:36 +02:00
parent 49a2cb5ad1
commit 281d2f6178
33 changed files with 70 additions and 70 deletions

View File

@ -1,5 +1,5 @@
<script type="text/javascript">//<![CDATA[ <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) function(x, st)
{ {
var tb = document.getElementById('ahcpd_status_table'); var tb = document.getElementById('ahcpd_status_table');

View 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> <div>
<script type="text/javascript" src="/luci-static/resources/cbi.js"></script> <script type="text/javascript" src="/luci-static/resources/cbi.js"></script>
<input type="hidden" name="cbi.submit" value="1" /> <input type="hidden" name="cbi.submit" value="1" />
@ -68,9 +68,9 @@
<div class="cbi-map-descr"> <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 /> Here you can manage your dial plans which are used to route outgoing calls from your local extensions.<br /><br />
Related tasks:<br /> Related tasks:<br />
<a href="<%=luci.dispatcher.build_url('admin/asterisk/dialplans/zones')%>" class="cbi-title-ref">Manage dialzones</a> | <a href="<%=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="<%=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/meetme/rooms')%>" class="cbi-title-ref">Manage meetme rooms</a>
</div> </div>
<!-- tblsection --> <!-- tblsection -->
<fieldset class="cbi-section" id="cbi-asterisk-sip"> <fieldset class="cbi-section" id="cbi-asterisk-sip">
@ -85,7 +85,7 @@
<big>Dialplan <em><%=plan.name%></em></big> <big>Dialplan <em><%=plan.name%></em></big>
</th> </th>
<td> <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" /> <img style="border:none" alt="Remove this dialplan" title="Remove this dialplan" src="/luci-static/resources/cbi/remove.gif" />
</a> </a>
</td> </td>
@ -109,10 +109,10 @@
</p> </p>
</td> </td>
<td style="width:5%" class="cbi-value-field"> <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" /> <img style="border:none" alt="Edit dialzone" title="Edit dialzone" src="/luci-static/resources/cbi/edit.gif" />
</a> </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" /> <img style="border:none" alt="Remove from this dialplan" title="Remove from this dialplan" src="/luci-static/resources/cbi/remove.gif" />
</a> </a>
</td> </td>
@ -134,10 +134,10 @@
</p> </p>
</td> </td>
<td style="width:5%" class="cbi-value-field"> <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" /> <img style="border:none" alt="Manage mailboxes ..." title="Manage mailboxes ..." src="/luci-static/resources/cbi/edit.gif" />
</a> </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" /> <img style="border:none" alt="Remove from this dialplan" title="Remove from this dialplan" src="/luci-static/resources/cbi/remove.gif" />
</a> </a>
</td> </td>
@ -157,10 +157,10 @@
</p> </p>
</td> </td>
<td style="width:5%" class="cbi-value-field"> <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" /> <img style="border:none" alt="Manage conferences ..." title="Manage conferences ..." src="/luci-static/resources/cbi/edit.gif" />
</a> </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" /> <img style="border:none" alt="Remove from this dialplan" title="Remove from this dialplan" src="/luci-static/resources/cbi/remove.gif" />
</a> </a>
</td> </td>

View 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> <div>
<script type="text/javascript" src="/luci-static/resources/cbi.js"></script> <script type="text/javascript" src="/luci-static/resources/cbi.js"></script>
<input type="hidden" name="cbi.submit" value="1" /> <input type="hidden" name="cbi.submit" value="1" />
@ -57,7 +57,7 @@
<div class="cbi-map" id="cbi-asterisk"> <div class="cbi-map" id="cbi-asterisk">
<h2 name="content">Dial Zone Management</h2> <h2 name="content">Dial Zone Management</h2>
<div class="cbi-map-descr"> <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. 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 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. also be used to enforce certain dial restrictions on selected extensions.
@ -109,10 +109,10 @@
<%=rule.description or rule.name%> <%=rule.description or rule.name%>
</td> </td>
<td style="text-align:left" class="cbi-value-field"> <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" /> <img style="border:none" alt="Edit entry" title="Edit entry" src="/luci-static/resources/cbi/edit.gif" />
</a> </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" /> <img style="border:none" alt="Delete entry" title="Delete entry" src="/luci-static/resources/cbi/remove.gif" />
</a> </a>
</td> </td>

View File

@ -58,7 +58,7 @@
legend.parentNode.style.display = 'block'; legend.parentNode.style.display = 'block';
legend.style.display = 'inline'; 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) function(x, st)
{ {
if (st) if (st)
@ -93,7 +93,7 @@
if (field) if (field)
args = encodeURIComponent(field.value); 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) function command_link(id)

View File

@ -6,7 +6,7 @@
var txt = document.getElementById("cbid.ddns." + section + "._logview.txt"); // TextArea var txt = document.getElementById("cbid.ddns." + section + "._logview.txt"); // TextArea
if ( !txt ) { return; } // security check 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) { function(x) {
if (x.responseText == "_nodata_") if (x.responseText == "_nodata_")
txt.value = "<%:File not found or empty%>"; txt.value = "<%:File not found or empty%>";

View File

@ -136,7 +136,7 @@
// do start/stop // do start/stop
var btnXHR = new XHR(); 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) { function(x, data) {
if (x.responseText == "_uncommitted_") { if (x.responseText == "_uncommitted_") {
// we need a trick to display Ampersand "&" in stead of "&#38;" or "&amp;" // we need a trick to display Ampersand "&" in stead of "&#38;" or "&amp;"
@ -155,7 +155,7 @@
} }
// force to immediate show status on page load (not waiting for XHR.poll) // 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) { function(x, data) {
if (data) { _data2elements(data); } if (data) { _data2elements(data); }
} }
@ -164,7 +164,7 @@
// define only ONE XHR.poll in a page because if one is running it blocks the other one // 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 // optimum is to define on Map or Section Level from here you can reach all elements
// we need update every 15 seconds only // 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) { function(x, data) {
if (data) { _data2elements(data); } if (data) { _data2elements(data); }
} }

View File

@ -111,13 +111,13 @@
} }
// force to immediate show status (not waiting for XHR.poll) // 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) { function(x, data) {
if (data) { _data2elements(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) { function(x, data) {
if (data) { _data2elements(x, data); } if (data) { _data2elements(x, data); }
} }
@ -126,7 +126,7 @@
//]]></script> //]]></script>
<fieldset class="cbi-section" id="ddns_status_section"> <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"> <table class="cbi-section-table" id="ddns_status_table">
<tr class="cbi-section-table-titles"> <tr class="cbi-section-table-titles">

View File

@ -34,7 +34,7 @@ local has_traceroute6 = fs.access("/usr/bin/traceroute6")
legend.parentNode.style.display = 'block'; legend.parentNode.style.display = 'block';
legend.style.display = 'inline'; 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) function(x)
{ {
if (x.responseText) if (x.responseText)

View File

@ -33,7 +33,7 @@ end
<div id="<%=name%>" style="width:<%=width%>;float:left"> <div id="<%=name%>" style="width:<%=width%>;float:left">
<h2><%=title%></h2> <h2><%=title%></h2>
<div id="form_<%=name%>"> <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 /> <input type="text" name="searchterms" style="margin-bottom:15px; width: 90%"><br />
<% <%
local checked = " checked" local checked = " checked"

View File

@ -1,5 +1,5 @@
<script type="text/javascript">//<![CDATA[ <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) function(x, st)
{ {
var tb = document.getElementById('telephony_status_table'); var tb = document.getElementById('telephony_status_table');

View File

@ -1,5 +1,5 @@
<script type="text/javascript">//<![CDATA[ <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) function(x, st)
{ {
var tb = document.getElementById('minidlna_status'); var tb = document.getElementById('minidlna_status');

View File

@ -1,5 +1,5 @@
<script type="text/javascript">//<![CDATA[ <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) function(x, st)
{ {
var tx = document.getElementById('multiwan_status_text'); var tx = document.getElementById('multiwan_status_text');

View File

@ -1,7 +1,7 @@
<script type="text/javascript">//<![CDATA[ <script type="text/javascript">//<![CDATA[
function ocserv_disconnect(idx) { 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) function(x)
{ {
var tb = document.getElementById('ocserv_status_table'); 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) function(x, st)
{ {
var tb = document.getElementById('ocserv_status_table'); var tb = document.getElementById('ocserv_status_table');

View File

@ -6,14 +6,14 @@
<fieldset class="cbi-section"> <fieldset class="cbi-section">
<legend> <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)%> <%=luci.i18n.translatef("Instance \"%s\"", self.instance)%>
</legend> </legend>
<% if self.mode == "basic" then %> <% 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 %> <% 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" /> <hr style="margin:0.5em 0" />
<%:Configuration category%>: <%:Configuration category%>:
<% for i, c in ipairs(self.categories) do %> <% for i, c in ipairs(self.categories) do %>

View File

@ -6,7 +6,7 @@
var txt = document.getElementById("cbid.privoxy.privoxy._logview.txt"); // TextArea var txt = document.getElementById("cbid.privoxy.privoxy._logview.txt"); // TextArea
if ( !txt ) { return; } // security check if ( !txt ) { return; } // security check
var lvXHR = new XHR(); 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) { function(x) {
if (x.responseText == "_nodata_") if (x.responseText == "_nodata_")
txt.value = "<%:File not found or empty%>"; txt.value = "<%:File not found or empty%>";

View File

@ -21,12 +21,12 @@
function onclick_startstop(id) { function onclick_startstop(id) {
// do start/stop // do start/stop
var btnXHR = new XHR(); 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); } 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); } function(x, data) { _data2elements(x); }
); );

View File

@ -21,12 +21,12 @@
function onclick_startstop(id) { function onclick_startstop(id) {
// do start/stop // do start/stop
var btnXHR = new XHR(); 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); } 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); } function(x, data) { _data2elements(x); }
); );

View File

@ -1,6 +1,6 @@
<script type="text/javascript">//<![CDATA[ <script type="text/javascript">//<![CDATA[
function upnp_delete_fwd(idx) { 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) function(x)
{ {
var tb = document.getElementById('upnp_status_table'); 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) function(x, st)
{ {
var tb = document.getElementById('upnp_status_table'); var tb = document.getElementById('upnp_status_table');

View File

@ -4,10 +4,10 @@
<script type="text/javascript">//<![CDATA[ <script type="text/javascript">//<![CDATA[
var apply_xhr = new XHR(); 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() { function() {
var checkfinish = function() { var checkfinish = function() {
apply_xhr.get('<%=luci.dispatcher.build_url("servicectl", "status")%>', null, apply_xhr.get('<%=url('servicectl/status')%>', null,
function(x) { function(x) {
if( x.responseText == 'finish' ) if( x.responseText == 'finish' )
{ {

View File

@ -2,6 +2,6 @@
<%+cbi/valueheader%> <%+cbi/valueheader%>
<input class="cbi-input-text" type="text"<%= attr("value", v) .. attr("name", cbid) .. attr("id", cbid) %> /> <input class="cbi-input-text" type="text"<%= attr("value", v) .. attr("name", cbid) .. attr("id", cbid) %> />
<script type="text/javascript"> <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> </script>
<%+cbi/valuefooter%> <%+cbi/valuefooter%>

View File

@ -34,7 +34,7 @@ local has_traceroute6 = fs.access("/usr/bin/traceroute6")
legend.parentNode.style.display = 'block'; legend.parentNode.style.display = 'block';
legend.style.display = 'inline'; 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) function(x)
{ {
if (x.responseText) if (x.responseText)

View File

@ -49,7 +49,7 @@
s.innerHTML = '<%:Waiting for changes to be applied...%>'; 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) function(x)
{ {
if (s) if (s)
@ -71,7 +71,7 @@
var wifidevs = <%=luci.http.write_json(netdevs)%>; var wifidevs = <%=luci.http.write_json(netdevs)%>;
var arptable = <%=luci.http.write_json(arpcache)%>; 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) function(x, ifcs)
{ {
if (ifcs) if (ifcs)
@ -178,14 +178,14 @@
d.innerHTML = String.format( d.innerHTML = String.format(
'<em><%:Unsupported protocol type.%></em><br />' + '<em><%:Unsupported protocol type.%></em><br />' +
'<a href="%h"><%:Install protocol extensions...%></a>', '<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) else if (d && !ifc.ifname)
{ {
d.innerHTML = String.format( d.innerHTML = String.format(
'<em><%:Network without interfaces.%></em><br />' + '<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 ifc.name, ifc.name
); );
} }
@ -239,13 +239,13 @@
<td style="width:420px"> <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-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-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-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='<%=luci.dispatcher.build_url("admin/network/iface_delete", net[1])%>'" title="<%:Delete this interface%>" value="<%:Delete%>" /> <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> </td>
</tr> </tr>
<% end %> <% end %>
</table> </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> </fieldset>
</div> </div>

View File

@ -1,7 +1,7 @@
<%+cbi/valueheader%> <%+cbi/valueheader%>
<script type="text/javascript">//<![CDATA[ <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) function(x, ifc)
{ {
if (ifc && (ifc = ifc[0])) if (ifc && (ifc = ifc[0]))

View File

@ -1,5 +1,5 @@
<script type="text/javascript">//<![CDATA[ <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) function(x, st)
{ {
var tb = document.getElementById('lease_status_table'); var tb = document.getElementById('lease_status_table');

View File

@ -1,6 +1,6 @@
<script type="text/javascript">//<![CDATA[ <script type="text/javascript">//<![CDATA[
var switches = [ '<%=table.concat(self.switches, "', '")%>' ]; 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) function(x, st)
{ {
for (var i = 0; i < switches.length; i++) for (var i = 0; i < switches.length; i++)

View File

@ -135,7 +135,7 @@
</fieldset> </fieldset>
</div> </div>
<div class="cbi-page-actions right"> <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%>" /> <input class="cbi-button cbi-button-reset" type="submit" value="<%:Back to overview%>" />
</form> </form>
<form class="inline" action="<%=REQUEST_URI%>" method="get"> <form class="inline" action="<%=REQUEST_URI%>" method="get">

View File

@ -149,7 +149,7 @@
st.innerHTML = '<em><%:Wireless is restarting...%></em>'; 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) function(x)
{ {
if (s) 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) function(x, st)
{ {
if (st) if (st)
@ -370,8 +370,8 @@
<span id="<%=dev:name()%>-iw-devinfo"></span> <span id="<%=dev:name()%>-iw-devinfo"></span>
</td> </td>
<td style="width:310px;text-align:right"> <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-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='<%=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-add" style="width:100px" onclick="location.href='<%=url("admin/network/wireless_add")%>?device=<%=dev:name()%>'" title="<%:Provide new network%>" value="<%:Add%>" />
</td> </td>
</tr> </tr>
<!-- /physical device --> <!-- /physical device -->
@ -391,7 +391,7 @@
<td class="cbi-value-field" style="width:310px;text-align:right"> <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 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-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> </td>
</tr> </tr>
<% end %> <% end %>

View File

@ -1,7 +1,7 @@
<%+cbi/valueheader%> <%+cbi/valueheader%>
<script type="text/javascript">//<![CDATA[ <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) function(x, iw)
{ {
if (iw && (iw = iw[0])) if (iw && (iw = iw[0]))

View File

@ -63,8 +63,8 @@
<% if has_ip6tables then %> <% if has_ip6tables then %>
<ul class="cbi-tabmenu"> <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 ~= 4 and "-disabled" %>"><a href="<%=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 ~= 6 and "-disabled" %>"><a href="<%=url("admin/status/iptables/6")%>"><%:IPv6 Firewall%></a></li>
</ul> </ul>
<% end %> <% end %>

View File

@ -5,6 +5,6 @@
-%> -%>
<ul class="cbi-tabmenu"> <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> <li class="cbi-tab"><a href="#"><%:Configuration%></a></li>
</ul> </ul>

View File

@ -1,7 +1,7 @@
<%+cbi/valueheader%> <%+cbi/valueheader%>
<script type="text/javascript">//<![CDATA[ <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) function(x, rv)
{ {
var s = document.getElementById('<%=self.option%>-clock-status'); var s = document.getElementById('<%=self.option%>-clock-status');
@ -17,7 +17,7 @@
btn.disabled = true; btn.disabled = true;
btn.value = '<%:Synchronizing...%>'; 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) }, { set: Math.floor((new Date()).getTime() / 1000) },
function() function()
{ {

View File

@ -5,6 +5,6 @@
-%> -%>
<ul class="cbi-tabmenu"> <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> <li class="cbi-tab"><a href="#"><%:Configuration%></a></li>
</ul> </ul>

View File

@ -11,7 +11,7 @@
%> %>
<% if has_latlon then %> <% 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> <h3><%:Legend%>:</h3>
<ul> <ul>
<li><strong><span style="color:#00cc00"><%:Green%></span></strong>:<%:Very good (ETX < 2)%></li> <li><strong><span style="color:#00cc00"><%:Green%></span></strong>:<%:Very good (ETX < 2)%></li>