summaryrefslogtreecommitdiffhomepage
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/luci-base/luasrc/dispatcher.lua17
-rw-r--r--modules/luci-mod-admin-full/luasrc/view/admin_network/wifi_status.htm47
-rw-r--r--modules/luci-mod-admin-full/luasrc/view/admin_system/flashops.htm5
-rw-r--r--modules/luci-mod-admin-full/luasrc/view/admin_uci/revert.htm2
4 files changed, 37 insertions, 34 deletions
diff --git a/modules/luci-base/luasrc/dispatcher.lua b/modules/luci-base/luasrc/dispatcher.lua
index 6850d7e3a..6d5a8f4d3 100644
--- a/modules/luci-base/luasrc/dispatcher.lua
+++ b/modules/luci-base/luasrc/dispatcher.lua
@@ -703,15 +703,22 @@ function _create_node(path)
local last = table.remove(path)
local parent = _create_node(path)
- c = {nodes={}, auto=true}
- -- the node is "in request" if the request path matches
- -- at least up to the length of the node path
- if parent.inreq and context.path[#path+1] == last then
- c.inreq = true
+ c = {nodes={}, auto=true, inreq=true}
+
+ local _, n
+ for _, n in ipairs(path) do
+ if context.path[_] ~= n then
+ c.inreq = false
+ break
+ end
end
+
+ c.inreq = c.inreq and (context.path[#path + 1] == last)
+
parent.nodes[last] = c
context.treecache[name] = c
end
+
return c
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 85468252e..ad20ea38f 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
@@ -24,21 +24,22 @@
else
icon = "<%=resource%>/icons/signal-75-100.png";
- var s = document.getElementById('<%=self.option%>-iw-signal');
- if (s)
- s.innerHTML = String.format(
- '<img src="%s" title="<%:Signal%>: %d <%:dBm%> / <%:Noise%>: %d <%:dBm%>" /><br />' +
- '<small>%d%%</small>', icon, iw.signal, iw.noise, p
- );
+ var s = document.getElementById('<%=self.option%>-iw-status'),
+ small = s.querySelector('small'),
+ info = s.querySelector('span');
+
+ small.innerHTML = info.innerHTML = String.format(
+ '<img src="%s" title="<%:Signal%>: %d <%:dBm%> / <%:Noise%>: %d <%:dBm%>" />&#160;<br />%d%%&#160;',
+ icon, iw.signal, iw.noise, p
+ );
- var d = document.getElementById('<%=self.option%>-iw-description');
- if (d && is_assoc)
- d.innerHTML = String.format(
+ if (is_assoc)
+ info.innerHTML = String.format(
'<strong><%:Mode%>:</strong> %s | ' +
'<strong><%:SSID%>:</strong> %h<br />' +
- '<strong><%:BSSID%>:</strong> %s | ' +
+ '<strong><%:BSSID%>:</strong> %s<br />' +
'<strong><%:Encryption%>:</strong> %s<br />' +
- '<strong><%:Channel%>:</strong> %d (%.3f <%:GHz%>) | ' +
+ '<strong><%:Channel%>:</strong> %d (%.3f <%:GHz%>)<br />' +
'<strong><%:Tx-Power%>:</strong> %d <%:dBm%><br />' +
'<strong><%:Signal%>:</strong> %d <%:dBm%> | ' +
'<strong><%:Noise%>:</strong> %d <%:dBm%><br />' +
@@ -50,8 +51,8 @@
iw.txpower, iw.signal, iw.noise,
iw.bitrate ? iw.bitrate : 0, iw.country
);
- else if (d)
- d.innerHTML = String.format(
+ else
+ info.innerHTML = String.format(
'<strong><%:SSID%>:</strong> %h | ' +
'<strong><%:Mode%>:</strong> %s<br />' +
'<em><%:Wireless is disabled or not associated%></em>',
@@ -62,17 +63,13 @@
);
//]]></script>
-<div class="table">
- <div class="tr cbi-section-table">
- <div class="td"></div>
- <div class="td cbi-value-field" style="width:16px; padding:3px" id="<%=self.option%>-iw-signal">
- <img src="<%=resource%>/icons/signal-none.png" title="<%:Not associated%>" /><br />
- <small>0%</small>
- </div>
- <div class="td cbi-value-field" style="vertical-align:middle; text-align:left; padding:3px" id="<%=self.option%>-iw-description">
- <em><%:Collecting data...%></em>
- </div>
- </div>
-</div>
+<span class="ifacebadge large" id="<%=self.option%>-iw-status">
+ <small>
+ <img src="<%=resource%>/icons/signal-none.png" title="<%:Not associated%>" />&#160;
+ </small>
+ <span>
+ <em><%:Collecting data...%></em>
+ </span>
+</span>
<%+cbi/valuefooter%>
diff --git a/modules/luci-mod-admin-full/luasrc/view/admin_system/flashops.htm b/modules/luci-mod-admin-full/luasrc/view/admin_system/flashops.htm
index 9eec01254..0a4bc6578 100644
--- a/modules/luci-mod-admin-full/luasrc/view/admin_system/flashops.htm
+++ b/modules/luci-mod-admin-full/luasrc/view/admin_system/flashops.htm
@@ -14,7 +14,7 @@
</ul>
<div class="cbi-section">
- <legend><%:Backup / Restore%></legend>
+ <h3><%:Backup / Restore%></h3>
<div class="cbi-section-descr"><%:Click "Generate archive" to download a tar archive of the current configuration files. To reset the firmware to its initial state, click "Perform reset" (only possible with squashfs images).%></div>
<div class="cbi-section-node">
<form class="inline" method="post" action="<%=url('admin/system/flashops/backup')%>">
@@ -38,7 +38,6 @@
</form>
<% end %>
</div>
- <br />
<div class="cbi-section-descr"><%:To restore configuration files, you can upload a previously generated backup archive here.%></div>
<div class="cbi-section-node">
<form class="inline" method="post" action="<%=url('admin/system/flashops/restore')%>" enctype="multipart/form-data">
@@ -58,7 +57,7 @@
</div>
<div class="cbi-section">
- <legend><%:Flash new firmware image%></legend>
+ <h3><%:Flash new firmware image%></h3>
<% if upgrade_avail then %>
<form method="post" action="<%=url('admin/system/flashops/sysupgrade')%>" enctype="multipart/form-data">
<input type="hidden" name="token" value="<%=token%>" />
diff --git a/modules/luci-mod-admin-full/luasrc/view/admin_uci/revert.htm b/modules/luci-mod-admin-full/luasrc/view/admin_uci/revert.htm
index dff53420a..ff23d568d 100644
--- a/modules/luci-mod-admin-full/luasrc/view/admin_uci/revert.htm
+++ b/modules/luci-mod-admin-full/luasrc/view/admin_uci/revert.htm
@@ -27,7 +27,7 @@
<div class="alert-message" id="cbi_apply_status" style="display:none"></div>
<script type="text/javascript">
document.addEventListener("DOMContentLoaded", function() {
- uci_apply(true);
+ uci_revert();
});
</script>