From 6b6c7e6d7a53c93ee1ae9eddcadb97349d3c368b Mon Sep 17 00:00:00 2001 From: Ycarus Date: Tue, 3 Jul 2018 16:03:20 +0200 Subject: [PATCH] Update luci-base and luci-mod-admin-full to latest upstream version --- luci-base/Makefile | 15 +- luci-base/htdocs/luci-static/resources/cbi.js | 129 +- luci-base/htdocs/luci-static/resources/xhr.js | 3 +- luci-base/luasrc/dispatcher.lua | 17 +- luci-base/luasrc/tools/status.lua | 86 +- luci-base/luasrc/view/cbi/apply_widget.htm | 2 +- luci-base/luasrc/view/cbi/button.htm | 2 +- .../luasrc/view/cbi/cell_valueheader.htm | 10 +- luci-base/luasrc/view/cbi/dropdown.htm | 12 + .../luasrc/view/cbi/firewall_zoneforwards.htm | 79 +- luci-base/luasrc/view/cbi/footer.htm | 2 - .../luasrc/view/cbi/full_valuefooter.htm | 1 - luci-base/luasrc/view/cbi/map.htm | 3 - luci-base/luasrc/view/cbi/nsection.htm | 9 +- luci-base/luasrc/view/cbi/nullsection.htm | 5 +- luci-base/luasrc/view/cbi/simpleform.htm | 15 +- luci-base/luasrc/view/cbi/tblsection.htm | 208 ++- luci-base/luasrc/view/cbi/tsection.htm | 18 +- luci-base/luasrc/view/cbi/upload.htm | 2 +- luci-base/luasrc/view/sysauth.htm | 10 +- luci-base/po/ca/base.po | 62 +- luci-base/po/cs/base.po | 86 +- luci-base/po/de/base.po | 90 +- luci-base/po/el/base.po | 59 +- luci-base/po/en/base.po | 56 +- luci-base/po/es/base.po | 86 +- luci-base/po/fr/base.po | 86 +- luci-base/po/he/base.po | 73 +- luci-base/po/hu/base.po | 86 +- luci-base/po/it/base.po | 87 +- luci-base/po/ja/base.po | 88 +- luci-base/po/ko/base.po | 68 +- luci-base/po/ms/base.po | 53 +- luci-base/po/no/base.po | 86 +- luci-base/po/pl/base.po | 179 ++- luci-base/po/pt-br/base.po | 86 +- luci-base/po/pt/base.po | 84 +- luci-base/po/ro/base.po | 56 +- luci-base/po/ru/base.po | 88 +- luci-base/po/sk/base.po | 50 +- luci-base/po/sv/base.po | 62 +- luci-base/po/templates/base.pot | 50 +- luci-base/po/tr/base.po | 56 +- luci-base/po/uk/base.po | 1129 ++++++++--------- luci-base/po/vi/base.po | 50 +- luci-base/po/zh-cn/base.po | 139 +- luci-base/po/zh-tw/base.po | 82 +- .../luasrc/controller/admin/network.lua | 10 + .../luasrc/controller/admin/system.lua | 2 +- .../luasrc/model/cbi/admin_network/vlan.lua | 4 +- .../luasrc/model/cbi/admin_system/admin.lua | 9 +- .../luasrc/view/admin_network/diagnostics.htm | 138 +- .../view/admin_network/diagnostics.htm.rej | 61 + .../view/admin_network/iface_overview.htm | 73 +- .../view/admin_network/iface_status.htm | 59 +- .../view/admin_network/lease_status.htm | 110 +- .../view/admin_network/switch_status.htm | 32 +- .../view/admin_network/wifi_assoclist.htm | 82 ++ .../luasrc/view/admin_network/wifi_join.htm | 48 +- .../view/admin_network/wifi_overview.htm | 200 +-- .../luasrc/view/admin_network/wifi_status.htm | 47 +- .../luasrc/view/admin_status/bandwidth.htm | 33 +- .../luasrc/view/admin_status/connections.htm | 2 + .../luasrc/view/admin_status/index.htm | 303 +---- .../luasrc/view/admin_status/iptables.htm | 108 +- .../luasrc/view/admin_status/load.htm | 2 + .../luasrc/view/admin_status/routes.htm | 113 +- .../luasrc/view/admin_status/wireless.htm | 4 +- .../luasrc/view/admin_system/flashops.htm | 139 +- .../luasrc/view/admin_system/packages.htm | 150 +-- .../luasrc/view/admin_system/reboot.htm | 3 +- .../luasrc/view/admin_uci/changelog.htm | 10 +- .../luasrc/view/admin_uci/changes.htm | 22 +- .../luasrc/view/admin_uci/revert.htm | 2 +- .../luci-static/openmptcprouter/cascade.css | 302 +++-- 75 files changed, 3309 insertions(+), 2564 deletions(-) create mode 100644 luci-mod-admin-full/luasrc/view/admin_network/diagnostics.htm.rej create mode 100644 luci-mod-admin-full/luasrc/view/admin_network/wifi_assoclist.htm diff --git a/luci-base/Makefile b/luci-base/Makefile index 264bfe9f4..fc8a31d2a 100644 --- a/luci-base/Makefile +++ b/luci-base/Makefile @@ -14,12 +14,13 @@ LUCI_BASENAME:=base LUCI_TITLE:=LuCI core libraries LUCI_DEPENDS:=+lua +luci-lib-nixio +luci-lib-ip +rpcd +libubus-lua +luci-lib-jsonc +liblucihttp-lua -PKG_SOURCE:=LuaSrcDiet-0.12.1.tar.bz2 -PKG_SOURCE_URL:=https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/luasrcdiet -PKG_HASH:=ed7680f2896269ae8633756e7edcf09050812f78c8f49e280e63c30d14f35aea -PKG_LICENSE:=Apache-2.0 -HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/LuaSrcDiet-0.12.1 +PKG_SOURCE:=v1.0.0.tar.gz +PKG_SOURCE_URL:=https://github.com/jirutka/luasrcdiet/archive/ +PKG_HASH:=48162e63e77d009f5848f18a5cabffbdfc867d0e5e73c6d407f6af5d6880151b +PKG_LICENSE:=MIT + +HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/luasrcdiet-1.0.0 include $(INCLUDE_DIR)/host-build.mk @@ -36,13 +37,13 @@ endef define Host/Compile $(MAKE) -C src/ clean po2lmo - $(MAKE) -C $(HOST_BUILD_DIR) bin/LuaSrcDiet.lua + $(MAKE) -C $(HOST_BUILD_DIR) bin/luasrcdiet endef define Host/Install $(INSTALL_DIR) $(1)/bin $(INSTALL_BIN) src/po2lmo $(1)/bin/po2lmo - $(INSTALL_BIN) $(HOST_BUILD_DIR)/bin/LuaSrcDiet.lua $(1)/bin/LuaSrcDiet + $(INSTALL_BIN) $(HOST_BUILD_DIR)/bin/luasrcdiet $(1)/bin/luasrcdiet endef $(eval $(call HostBuild)) diff --git a/luci-base/htdocs/luci-static/resources/cbi.js b/luci-base/htdocs/luci-static/resources/cbi.js index a7f999d87..6a487366f 100644 --- a/luci-base/htdocs/luci-static/resources/cbi.js +++ b/luci-base/htdocs/luci-static/resources/cbi.js @@ -620,7 +620,11 @@ function cbi_init() { } document.querySelectorAll('.cbi-dropdown').forEach(function(s) { - cbi_dropdown_init(s); + cbi_dropdown_init(s); + }); + + document.querySelectorAll('.cbi-tooltip:not(:empty)').forEach(function(s) { + s.parentNode.classList.add('cbi-tooltip-container'); }); cbi_d_update(); @@ -1232,14 +1236,13 @@ function cbi_validate_field(cbid, optional, type) function cbi_row_swap(elem, up, store) { - var tr = elem.parentNode; - - while (tr && !tr.classList.contains('cbi-section-table-row')) - tr = tr.parentNode; + var tr = findParent(elem.parentNode, '.cbi-section-table-row'); if (!tr) return false; + tr.classList.remove('flash'); + if (up) { var prev = tr.previousElementSibling; @@ -1277,6 +1280,9 @@ function cbi_row_swap(elem, up, store) if (input) input.value = ids.join(' '); + window.scrollTo(0, tr.offsetTop); + window.setTimeout(function() { tr.classList.add('flash'); }, 1); + return false; } @@ -1522,6 +1528,19 @@ function toElem(s) return elem || null; } +function findParent(node, selector) +{ + while (node) + if (node.msMatchesSelector && node.msMatchesSelector(selector)) + return node; + else if (node.matches && node.matches(selector)) + return node; + else + node = node.parentNode; + + return null; +} + function E() { var html = arguments[0], @@ -1541,7 +1560,7 @@ function E() if (attr) for (var key in attr) - if (attr.hasOwnProperty(key)) + if (attr.hasOwnProperty(key) && attr[key] !== null && attr[key] !== undefined) elem.setAttribute(key, attr[key]); if (typeof(data) === 'function') @@ -1818,18 +1837,6 @@ CBIDropdown = { document.querySelectorAll('.cbi-dropdown[open]').forEach(function(s) { s.dispatchEvent(new CustomEvent('cbi-dropdown-close', {})); }); - }, - - findParent: function(node, selector) { - while (node) - if (node.msMatchesSelector && node.msMatchesSelector(selector)) - return node; - else if (node.matches && node.matches(selector)) - return node; - else - node = node.parentNode; - - return null; } }; @@ -1908,7 +1915,7 @@ function cbi_dropdown_init(sb) { sbox.openDropdown(this); } else { - var li = sbox.findParent(ev.target, 'li'); + var li = findParent(ev.target, 'li'); if (li && li.parentNode.classList.contains('dropdown')) sbox.toggleItem(this, li); } @@ -1933,7 +1940,7 @@ function cbi_dropdown_init(sb) { } else { - var active = sbox.findParent(document.activeElement, 'li'); + var active = findParent(document.activeElement, 'li'); switch (ev.keyCode) { case 27: @@ -1986,7 +1993,7 @@ function cbi_dropdown_init(sb) { if (!this.hasAttribute('open')) return; - var li = sbox.findParent(ev.target, 'li'); + var li = findParent(ev.target, 'li'); if (li) { if (li.parentNode.classList.contains('dropdown')) sbox.setFocus(this, li); @@ -2023,18 +2030,18 @@ function cbi_dropdown_init(sb) { }); create.addEventListener('focus', function(ev) { - var cbox = sbox.findParent(this, 'li').querySelector('input[type="checkbox"]'); + var cbox = findParent(this, 'li').querySelector('input[type="checkbox"]'); if (cbox) cbox.checked = true; sb.setAttribute('locked-in', ''); }); create.addEventListener('blur', function(ev) { - var cbox = sbox.findParent(this, 'li').querySelector('input[type="checkbox"]'); + var cbox = findParent(this, 'li').querySelector('input[type="checkbox"]'); if (cbox) cbox.checked = false; sb.removeAttribute('locked-in'); }); - var li = sbox.findParent(create, 'li'); + var li = findParent(create, 'li'); li.setAttribute('unselectable', ''); li.addEventListener('click', function(ev) { @@ -2044,3 +2051,77 @@ function cbi_dropdown_init(sb) { } cbi_dropdown_init.prototype = CBIDropdown; + +function cbi_update_table(table, data, placeholder) { + target = isElem(table) ? table : document.querySelector(table); + + if (!isElem(target)) + return; + + target.querySelectorAll('.tr.table-titles, .cbi-section-table-titles').forEach(function(thead) { + var titles = []; + + thead.querySelectorAll('.th').forEach(function(th) { + titles.push(th); + }); + + if (Array.isArray(data)) { + var n = 0, rows = target.querySelectorAll('.tr'); + + data.forEach(function(row) { + var trow = E('div', { 'class': 'tr' }); + + for (var i = 0; i < titles.length; i++) { + var text = titles[i].innerText; + var td = trow.appendChild(E('div', { + 'class': titles[i].className, + 'data-title': text ? text.trim() : null + }, row[i] || '')); + + td.classList.remove('th'); + td.classList.add('td'); + } + + trow.classList.add('cbi-rowstyle-%d'.format((n++ % 2) ? 2 : 1)); + + if (rows[n]) + target.replaceChild(trow, rows[n]); + else + target.appendChild(trow); + }); + + while (rows[++n]) + target.removeChild(rows[n]); + + if (placeholder && target.firstElementChild === target.lastElementChild) { + var trow = target.appendChild(E('div', { 'class': 'tr placeholder' })); + var td = trow.appendChild(E('div', { 'class': titles[0].className }, placeholder)); + + td.classList.remove('th'); + td.classList.add('td'); + } + } + else { + thead.parentNode.style.display = 'none'; + + thead.parentNode.querySelectorAll('.tr, .cbi-section-table-row').forEach(function(trow) { + if (trow !== thead) { + var n = 0; + trow.querySelectorAll('.th, .td').forEach(function(td) { + if (n < titles.length) { + var text = (titles[n++].innerText || '').trim(); + if (text !== '') + td.setAttribute('data-title', text); + } + }); + } + }); + + thead.parentNode.style.display = ''; + } + }); +} + +document.addEventListener('DOMContentLoaded', function() { + document.querySelectorAll('.table').forEach(cbi_update_table); +}); diff --git a/luci-base/htdocs/luci-static/resources/xhr.js b/luci-base/htdocs/luci-static/resources/xhr.js index de4476cdd..f1537a448 100644 --- a/luci-base/htdocs/luci-static/resources/xhr.js +++ b/luci-base/htdocs/luci-static/resources/xhr.js @@ -204,7 +204,6 @@ XHR.poll = function(interval, url, data, callback, post) }; XHR._q.push(e); - XHR.run(); return e; } @@ -260,3 +259,5 @@ XHR.running = function() { return !!(XHR._r && XHR._i); } + +document.addEventListener('DOMContentLoaded', XHR.run); diff --git a/luci-base/luasrc/dispatcher.lua b/luci-base/luasrc/dispatcher.lua index 6850d7e3a..6d5a8f4d3 100644 --- a/luci-base/luasrc/dispatcher.lua +++ b/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/luci-base/luasrc/tools/status.lua b/luci-base/luasrc/tools/status.lua index 06a9ad415..635995310 100644 --- a/luci-base/luasrc/tools/status.lua +++ b/luci-base/luasrc/tools/status.lua @@ -6,9 +6,25 @@ module("luci.tools.status", package.seeall) local uci = require "luci.model.uci".cursor() local ipc = require "luci.ip" +local function duid_to_mac(duid) + local b1, b2, b3, b4, b5, b6 + + -- DUID-LLT / Ethernet + if type(duid) == "string" and #duid == 28 then + b1, b2, b3, b4, b5, b6 = duid:match("^00010001(%x%x)(%x%x)(%x%x)(%x%x)(%x%x)(%x%x)%x%x%x%x%x%x%x%x$") + + -- DUID-LL / Ethernet + elseif type(duid) == "string" and #duid == 20 then + b1, b2, b3, b4, b5, b6 = duid:match("^00030001(%x%x)(%x%x)(%x%x)(%x%x)(%x%x)(%x%x)$") + end + + return b1 and ipc.checkmac(table.concat({ b1, b2, b3, b4, b5, b6 }, ":")) +end + local function dhcp_leases_common(family) local rv = { } local nfs = require "nixio.fs" + local sys = require "luci.sys" local leasefile = "/tmp/dhcp.leases" uci:foreach("dhcp", "dnsmasq", @@ -87,6 +103,22 @@ local function dhcp_leases_common(family) fd:close() end + if family == 6 then + local _, lease + local hosts = sys.net.host_hints() + for _, lease in ipairs(rv) do + local mac = duid_to_mac(lease.duid) + local host = mac and hosts[mac] + if host then + if not lease.name then + lease.host_hint = host.name or host.ipv4 or host.ipv6 + elseif host.name and lease.hostname ~= host.name then + lease.host_hint = host.name + end + end + end + end + return rv end @@ -113,6 +145,11 @@ function wifi_networks() local net for _, net in ipairs(dev:get_wifinets()) do + local a, an = nil, 0 + for _, a in pairs(net:assoclist() or {}) do + an = an + 1 + end + rd.networks[#rd.networks+1] = { name = net:shortname(), link = net:adminlink(), @@ -128,10 +165,10 @@ function wifi_networks() noise = net:noise(), bitrate = net:bitrate(), ifname = net:ifname(), - assoclist = net:assoclist(), country = net:country(), txpower = net:txpower(), txpoweroff = net:txpower_offset(), + num_assoc = an, disabled = (dev:get("disabled") == "1" or net:get("disabled") == "1") } @@ -165,7 +202,6 @@ function wifi_network(id) noise = net:noise(), bitrate = net:bitrate(), ifname = net:ifname(), - assoclist = net:assoclist(), country = net:country(), txpower = net:txpower(), txpoweroff = net:txpower_offset(), @@ -182,6 +218,52 @@ function wifi_network(id) return { } end +function wifi_assoclist() + local sys = require "luci.sys" + local ntm = require "luci.model.network".init() + local hosts = sys.net.host_hints() + + local assoc = {} + local _, dev, net, bss + + for _, dev in ipairs(ntm:get_wifidevs()) do + local radioname = dev:get_i18n() + + for _, net in ipairs(dev:get_wifinets()) do + local netname = net:shortname() + local netlink = net:adminlink() + local ifname = net:ifname() + + for _, bss in pairs(net:assoclist() or {}) do + local host = hosts[_] + + bss.bssid = _ + bss.ifname = ifname + bss.radio = radioname + bss.name = netname + bss.link = netlink + + bss.host_name = (host) and (host.name or host.ipv4 or host.ipv6) + bss.host_hint = (host and host.name and (host.ipv4 or host.ipv6)) and (host.ipv4 or host.ipv6) + + assoc[#assoc+1] = bss + end + end + end + + table.sort(assoc, function(a, b) + if a.radio ~= b.radio then + return a.radio < b.radio + elseif a.ifname ~= b.ifname then + return a.ifname < b.ifname + else + return a.bssid < b.bssid + end + end) + + return assoc +end + function switch_status(devs) local dev local switches = { } diff --git a/luci-base/luasrc/view/cbi/apply_widget.htm b/luci-base/luasrc/view/cbi/apply_widget.htm index 702512f49..e3090da65 100644 --- a/luci-base/luasrc/view/cbi/apply_widget.htm +++ b/luci-base/luasrc/view/cbi/apply_widget.htm @@ -47,7 +47,7 @@ } - + -
-
-
-
-
- ? -
-
- <%:Collecting data...%> -
-
-
+ + + + <%:Collecting data...%> + + <%+cbi/valuefooter%> diff --git a/luci-mod-admin-full/luasrc/view/admin_network/lease_status.htm b/luci-mod-admin-full/luasrc/view/admin_network/lease_status.htm index 9005279a4..8fbbdc947 100644 --- a/luci-mod-admin-full/luasrc/view/admin_network/lease_status.htm +++ b/luci-mod-admin-full/luasrc/view/admin_network/lease_status.htm @@ -1,27 +1,11 @@ -
- <%:Active DHCP Leases%> -
-
-
<%:Hostname%>
-
<%:IPv4-Address%>
-
<%:MAC-Address%>
-
<%:Leasetime remaining%>
+
+

<%:Active DHCP Leases%>

+
+
+
<%:Hostname%>
+
<%:IPv4-Address%>
+
<%:MAC-Address%>
+
<%:Leasetime remaining%>
-
-

<%:Collecting data...%>
+
+
<%:Collecting data...%>
-
+ - + diff --git a/luci-mod-admin-full/luasrc/view/admin_network/switch_status.htm b/luci-mod-admin-full/luasrc/view/admin_network/switch_status.htm index 96fbffdb0..68f0bbc9d 100644 --- a/luci-mod-admin-full/luasrc/view/admin_network/switch_status.htm +++ b/luci-mod-admin-full/luasrc/view/admin_network/switch_status.htm @@ -1,21 +1,39 @@ + +
+
+
<%:Network%>
+
<%:MAC-Address%>
+
<%:Host%>
+
<%:Signal%> / <%:Noise%>
+
<%:RX Rate%> / <%:TX Rate%>
+
+
+
<%:Collecting data...%>
+
+
diff --git a/luci-mod-admin-full/luasrc/view/admin_network/wifi_join.htm b/luci-mod-admin-full/luasrc/view/admin_network/wifi_join.htm index e9cfb3e85..9b93942c8 100644 --- a/luci-mod-admin-full/luasrc/view/admin_network/wifi_join.htm +++ b/luci-mod-admin-full/luasrc/view/admin_network/wifi_join.htm @@ -90,25 +90,43 @@

<%:Join Network: Wireless Scan%>

-
-
+
+
+
+
<%:Signal%>
+
<%:SSID%>
+
<%:Channel%>
+
<%:Mode%>
+
<%:BSSID%>
+
<%:Encryption%>
+
 
+
+ <% for i, net in ipairs(scanlist(3)) do net.encryption = net.encryption or { } %> -
-
+
+

<%=percent_wifi_signal(net)%>%
-
- <%=net.ssid and utl.pcdata(net.ssid) or "%s" % translate("hidden")%>
- Channel: <%=net.channel%> | - Mode: <%=net.mode%> | - BSSID: <%=net.bssid%> | - Encryption: <%=format_wifi_encryption(net.encryption)%> +
+ <%=net.ssid and utl.pcdata(net.ssid) or "%s" % translate("hidden")%>
-
+
+ <%=net.channel%> +
+
+ <%=net.mode%> +
+
+ <%=net.bssid%> +
+
+ <%=format_wifi_encryption(net.encryption)%> +
+
@@ -126,23 +144,23 @@ " /> - +
<% end %>
-
+
" method="get"> - +
- +
diff --git a/luci-mod-admin-full/luasrc/view/admin_network/wifi_overview.htm b/luci-mod-admin-full/luasrc/view/admin_network/wifi_overview.htm index d6140c81f..b9602785f 100644 --- a/luci-mod-admin-full/luasrc/view/admin_network/wifi_overview.htm +++ b/luci-mod-admin-full/luasrc/view/admin_network/wifi_overview.htm @@ -113,32 +113,10 @@ var is_reconnecting = false; - function nowrap(s) { - return s.replace(/ /g, ' '); - } - - function wifirate(bss, rx) { - var p = rx ? 'rx_' : 'tx_', - s = '%.1f <%:Mbit/s%>, %d<%:MHz%>' - .format(bss[p+'rate'] / 1000, bss[p+'mhz']), - ht = bss[p+'ht'], vht = bss[p+'vht'], - mhz = bss[p+'mhz'], nss = bss[p+'nss'], - mcs = bss[p+'mcs'], sgi = bss[p+'short_gi']; - - if (ht || vht) { - if (vht) s += ', VHT-MCS %d'.format(mcs); - if (nss) s += ', VHT-NSS %d'.format(nss); - if (ht) s += ', MCS %s'.format(mcs); - if (sgi) s += ', <%:Short GI%>'; - } - - return s; - } - function wifi_shutdown(id, toggle) { var reconnect = (toggle.getAttribute('active') == 'false'); - if (!reconnect && !confirm(String.format('<%:Really shut down network?\nYou might lose access to this device if you are connected via this interface.%>'))) + if (!reconnect && !confirm(<%=luci.http.write_json(translate('Really shut down network? You might lose access to this device if you are connected via this interface'))%>)) return; is_reconnecting = true; @@ -176,7 +154,7 @@ } function wifi_delete(id) { - 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.%>')) + if (!confirm(<%=luci.http.write_json(translate('Really delete this wireless network? The deletion cannot be undone! You might lose access to this device if you are connected via this network.'))%>)) return; (new XHR()).post('<%=url('admin/network/wireless_delete')%>/' + id, { token: '<%=token%>' }, @@ -193,20 +171,25 @@ { if (st) { - var assoctable = document.getElementById('iw-assoclist'); - if (assoctable) - while (assoctable.firstElementChild !== assoctable.lastElementChild) - assoctable.removeChild(assoctable.lastElementChild); - - var devup = { }; var rowstyle = 1; + var radiostate = { }; + + st.forEach(function(s) { + var r = radiostate[wifidevs[s.id]] || (radiostate[wifidevs[s.id]] = {}); + + s.is_assoc = (s.bssid && s.bssid != '00:00:00:00:00:00' && s.channel && s.mode != 'Unknown' && !s.disabled); + + r.up = r.up || s.is_assoc; + r.channel = r.channel || s.channel; + r.bitrate = r.bitrate || s.bitrate; + r.frequency = r.frequency || s.frequency; + }); for( var i = 0; i < st.length; i++ ) { var iw = st[i]; - var is_assoc = (iw.bssid && iw.bssid != '00:00:00:00:00:00' && iw.channel && iw.mode != 'Unknown' && !iw.disabled); var p = iw.quality; - var q = is_assoc ? p : -1; + var q = iw.is_assoc ? p : -1; var icon; if (q < 0) @@ -222,9 +205,6 @@ else icon = "<%=resource%>/icons/signal-75-100.png"; - if (!devup[wifidevs[iw.id]]) - devup[wifidevs[iw.id]] = is_assoc; - var sig = document.getElementById(iw.id + '-iw-signal'); if (sig) sig.innerHTML = String.format( @@ -237,13 +217,13 @@ { if (!iw.disabled) { - toggle.className = 'cbi-button cbi-button-reset'; + toggle.className = 'cbi-button cbi-button-neutral'; toggle.value = '<%:Disable%>'; toggle.title = '<%:Shutdown this network%>'; } else { - toggle.className = 'cbi-button cbi-button-reload'; + toggle.className = 'cbi-button cbi-button-neutral'; toggle.value = '<%:Enable%>'; toggle.title = '<%:Activate this network%>'; } @@ -254,7 +234,7 @@ var info = document.getElementById(iw.id + '-iw-status'); if (info) { - if (is_assoc) + if (iw.is_assoc) info.innerHTML = String.format( '<%:SSID%>: %h | ' + '<%:Mode%>: %s
' + @@ -274,83 +254,23 @@ : '<%:Wireless is disabled or not associated%>' ); } - - var dev = document.getElementById(wifidevs[iw.id] + '-iw-devinfo'); - if (dev) - { - if (is_assoc) - dev.innerHTML = String.format( - '<%:Channel%>: %s (%s <%:GHz%>) | ' + - '<%:Bitrate%>: %s <%:Mbit/s%>', - iw.channel ? iw.channel : '?', - iw.frequency ? iw.frequency : '?', - iw.bitrate ? iw.bitrate : '?' - ); - else - dev.innerHTML = ''; - } - - if (assoctable) - { - var assoclist = [ ]; - for (var bssid in iw.assoclist) - { - assoclist.push(iw.assoclist[bssid]); - assoclist[assoclist.length-1].bssid = bssid; - } - - assoclist.sort(function(a, b) { a.bssid < b.bssid }); - - for (var j = 0; j < assoclist.length; j++) - { - var icon; - var q = (-1 * (assoclist[j].noise - assoclist[j].signal)) / 5; - if (q < 1) - icon = "<%=resource%>/icons/signal-0.png"; - else if (q < 2) - icon = "<%=resource%>/icons/signal-0-25.png"; - else if (q < 3) - icon = "<%=resource%>/icons/signal-25-50.png"; - else if (q < 4) - icon = "<%=resource%>/icons/signal-50-75.png"; - else - icon = "<%=resource%>/icons/signal-75-100.png"; - - var host = hosts[assoclist[j].bssid], - name = host ? (host.name || host.ipv4 || host.ipv6) : null, - hint = (host && host.name && (host.ipv4 || host.ipv6)) ? (host.ipv4 || host.ipv6) : null; - - assoctable.appendChild(E('
'.format(rowstyle), [ - E('
%h
' - .format(iw.device.name, iw.ifname)), - E('
%h
' - .format(iw.ssid || '?')), - E('
%h
' - .format(assoclist[j].bssid)), - E('
', hint ? '
%h (%h)
' - .format(name || '?', hint) : (name || '?')), - E('
%d / %d <%:dBm%>
' - .format(assoclist[j].signal, assoclist[j].noise, assoclist[j].signal - assoclist[j].noise, icon, assoclist[j].signal, assoclist[j].noise)), - E('
', [ - E('', wifirate(assoclist[j], true)), - E('
'), - E('', wifirate(assoclist[j], false)) - ]) - ])); - - rowstyle = (rowstyle == 1) ? 2 : 1; - } - } } - if (assoctable && assoctable.firstElementChild === assoctable.lastElementChild) - assoctable.appendChild(E('

<%:No information available%>
')); - - for (var dev in devup) + for (var dev in radiostate) { var img = document.getElementById(dev + '-iw-upstate'); if (img) - img.src = '<%=resource%>/icons/wifi_big' + (devup[dev] ? '' : '_disabled') + '.png'; + img.src = '<%=resource%>/icons/wifi' + (radiostate[dev].up ? '' : '_disabled') + '.png'; + + var stat = document.getElementById(dev + '-iw-devinfo'); + if (stat) + stat.innerHTML = String.format( + '<%:Channel%>: %s (%s <%:GHz%>) | ' + + '<%:Bitrate%>: %s <%:Mbit/s%>', + radiostate[dev].channel ? radiostate[dev].channel : '?', + radiostate[dev].frequency ? radiostate[dev].frequency : '?', + radiostate[dev].bitrate ? radiostate[dev].bitrate : '?' + ); } } } @@ -359,37 +279,37 @@

<%:Wireless Overview%>

- +
-
+
<% for _, dev in ipairs(devices) do local nets = dev:get_wifinets() %> -
-
+
+
-
- +
+ <%=dev:name()%>
-
- <%=guess_wifi_hw(dev)%> (<%=dev:name()%>)
+
+ <%=guess_wifi_hw(dev)%>
-
+
- +
- +
@@ -398,22 +318,22 @@ <% if #nets > 0 then %> <% for i, net in ipairs(nets) do %> -
-
+
+
0%
-
+
<%:Collecting data...%>
-
- - - +
+ + +
<% end %> <% else %> -
+
<%:No network configured on this device%>
@@ -421,30 +341,14 @@ <% end %>
-
+
<% end %>

<%:Associated Stations%>

-
-
-
-
-
<%:SSID%>
-
<%:MAC-Address%>
-
<%:Host%>
-
<%:Signal%> / <%:Noise%>
-
<%:RX Rate%> / <%:TX Rate%>
-
-
-
- <%:Collecting data...%> -
-
-
-
+ <%+admin_network/wifi_assoclist%>
<%+footer%> diff --git a/luci-mod-admin-full/luasrc/view/admin_network/wifi_status.htm b/luci-mod-admin-full/luasrc/view/admin_network/wifi_status.htm index 85468252e..ad20ea38f 100644 --- a/luci-mod-admin-full/luasrc/view/admin_network/wifi_status.htm +++ b/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( - '
' + - '%d%%', icon, iw.signal, iw.noise, p - ); + var s = document.getElementById('<%=self.option%>-iw-status'), + small = s.querySelector('small'), + info = s.querySelector('span'); - var d = document.getElementById('<%=self.option%>-iw-description'); - if (d && is_assoc) - d.innerHTML = String.format( + small.innerHTML = info.innerHTML = String.format( + ' 
%d%% ', + icon, iw.signal, iw.noise, p + ); + + if (is_assoc) + info.innerHTML = String.format( '<%:Mode%>: %s | ' + '<%:SSID%>: %h
' + - '<%:BSSID%>: %s | ' + + '<%:BSSID%>: %s
' + '<%:Encryption%>: %s
' + - '<%:Channel%>: %d (%.3f <%:GHz%>) | ' + + '<%:Channel%>: %d (%.3f <%:GHz%>)
' + '<%:Tx-Power%>: %d <%:dBm%>
' + '<%:Signal%>: %d <%:dBm%> | ' + '<%:Noise%>: %d <%:dBm%>
' + @@ -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( '<%:SSID%>: %h | ' + '<%:Mode%>: %s
' + '<%:Wireless is disabled or not associated%>', @@ -62,17 +63,13 @@ ); //]]> -
-
-
-
-
- 0% -
-
- <%:Collecting data...%> -
-
-
+ + +   + + + <%:Collecting data...%> + + <%+cbi/valuefooter%> diff --git a/luci-mod-admin-full/luasrc/view/admin_status/bandwidth.htm b/luci-mod-admin-full/luasrc/view/admin_status/bandwidth.htm index db1d0b888..ba0ab0f68 100644 --- a/luci-mod-admin-full/luasrc/view/admin_status/bandwidth.htm +++ b/luci-mod-admin-full/luasrc/view/admin_status/bandwidth.htm @@ -202,22 +202,23 @@ data_rx_peak = Math.max(data_rx_peak, data_rx[i]); data_tx_peak = Math.max(data_tx_peak, data_tx[i]); - if (i > 0) - { - data_rx_avg = (data_rx_avg + data_rx[i]) / 2; - data_tx_avg = (data_tx_avg + data_tx[i]) / 2; - } - else - { - data_rx_avg = data_rx[i]; - data_tx_avg = data_tx[i]; - } + data_rx_avg += data_rx[i]; + data_tx_avg += data_tx[i]; } + data_rx_avg = (data_rx_avg / Math.max(data_rx.length, 1)); + data_tx_avg = (data_tx_avg / Math.max(data_tx.length, 1)); + + var size = Math.floor(Math.log2(data_max)), + div = Math.pow(2, size - (size % 10)), + mult = data_max / div, + mult = (mult < 5) ? 2 : ((mult < 50) ? 10 : ((mult < 500) ? 100 : 1000)); + + data_max = data_max + (mult * div) - (data_max % (mult * div)); + /* remember current timestamp, calculate horizontal scale */ data_stamp = data[data.length-1][TIME]; - data_scale = height / (data_max * 1.1); - + data_scale = height / data_max; /* plot data */ var pt_rx = '0,' + height; @@ -244,9 +245,9 @@ line_rx.setAttribute('points', pt_rx); line_tx.setAttribute('points', pt_tx); - label_25.firstChild.data = bandwidth_label(1.1 * 0.25 * data_max); - label_50.firstChild.data = bandwidth_label(1.1 * 0.50 * data_max); - label_75.firstChild.data = bandwidth_label(1.1 * 0.75 * data_max); + label_25.firstChild.data = bandwidth_label(0.25 * data_max); + label_50.firstChild.data = bandwidth_label(0.50 * data_max); + label_75.firstChild.data = bandwidth_label(0.75 * data_max); label_rx_cur.innerHTML = bandwidth_label(data_rx[data_rx.length-1], true); label_tx_cur.innerHTML = bandwidth_label(data_tx[data_tx.length-1], true); @@ -258,6 +259,8 @@ label_tx_peak.innerHTML = bandwidth_label(data_tx_peak, true); } ); + + XHR.run(); } }, 1000 ); diff --git a/luci-mod-admin-full/luasrc/view/admin_status/connections.htm b/luci-mod-admin-full/luasrc/view/admin_status/connections.htm index 30d93f78b..ae8a6bb7c 100644 --- a/luci-mod-admin-full/luasrc/view/admin_status/connections.htm +++ b/luci-mod-admin-full/luasrc/view/admin_status/connections.htm @@ -304,6 +304,8 @@ label_otr_peak.innerHTML = Math.floor(data_otr_peak); } ); + + XHR.run(); } }, 1000 ); diff --git a/luci-mod-admin-full/luasrc/view/admin_status/index.htm b/luci-mod-admin-full/luasrc/view/admin_status/index.htm index ae6a10193..9d282f58b 100644 --- a/luci-mod-admin-full/luasrc/view/admin_status/index.htm +++ b/luci-mod-admin-full/luasrc/view/admin_status/index.htm @@ -54,8 +54,6 @@ swap = swapinfo, connmax = conn_max, conncount = conn_count, - leases = stat.dhcp_leases(), - leases6 = stat.dhcp6_leases(), wifinets = stat.wifi_networks() } @@ -111,11 +109,6 @@ luci.http.prepare_content("application/json") luci.http.write_json(rv) - return - elseif luci.http.formvalue("hosts") == "1" then - luci.http.prepare_content("application/json") - luci.http.write_json(luci.sys.net.host_hints()) - return end -%> @@ -131,7 +124,7 @@ var pc = Math.floor((100 / mn) * vn); return String.format( - '
' + + '
' + '
' + '
' + '%s / %s (%d%%)' + @@ -141,45 +134,6 @@ ); } - function wifirate(bss, rx) { - var p = rx ? 'rx_' : 'tx_', - s = '%.1f <%:Mbit/s%>, %d<%:MHz%>' - .format(bss[p+'rate'] / 1000, bss[p+'mhz']), - ht = bss[p+'ht'], vht = bss[p+'vht'], - mhz = bss[p+'mhz'], nss = bss[p+'nss'], - mcs = bss[p+'mcs'], sgi = bss[p+'short_gi']; - - if (ht || vht) { - if (vht) s += ', VHT-MCS %d'.format(mcs); - if (nss) s += ', VHT-NSS %d'.format(nss); - if (ht) s += ', MCS %s'.format(mcs); - if (sgi) s += ', <%:Short GI%>'; - } - - return s; - } - - function duid2mac(duid) { - // DUID-LLT / Ethernet - if (duid.length === 28 && duid.substr(0, 8) === '00010001') - return duid.substr(16).replace(/(..)(?=..)/g, '$1:').toUpperCase(); - - // DUID-LL / Ethernet - if (duid.length === 20 && duid.substr(0, 8) === '00030001') - return duid.substr(8).replace(/(..)(?=..)/g, '$1:').toUpperCase(); - - return null; - } - - var npoll = 1; - var hosts = <%=luci.http.write_json(luci.sys.net.host_hints())%>; - - function updateHosts() { - XHR.get('<%=REQUEST_URI%>', { hosts: 1 }, function(x, data) { - hosts = data; - }); - } - function labelList(items, offset) { var rv = [ ]; @@ -206,7 +160,7 @@ return E('div', { class: 'ifacebox' }, [ E('div', { class: 'ifacebox-head center ' + (active ? 'active' : '') }, E('strong', title)), - E('div', { class: 'ifacebox-body' }, childs) + E('div', { class: 'ifacebox-body left' }, childs) ]); } @@ -220,9 +174,6 @@ XHR.poll(5, '<%=REQUEST_URI%>', { status: 1 }, function(x, info) { - if (!(npoll++ % 5)) - updateHosts(); - <% if has_mptcp == 0 then %> var us = document.getElementById('upstream_status_table'); @@ -333,86 +284,7 @@ ); <% end %> - <% if has_dhcp then %> - var ls = document.getElementById('lease_status_table'); - if (ls) - { - /* clear all rows */ - while (ls.firstElementChild !== ls.lastElementChild) - ls.removeChild(ls.lastElementChild); - - for (var i = 0; i < info.leases.length; i++) - { - var timestr; - - if (info.leases[i].expires === false) - timestr = '<%:unlimited%>'; - else if (info.leases[i].expires <= 0) - timestr = '<%:expired%>'; - else - timestr = String.format('%t', info.leases[i].expires); - - ls.appendChild(E('
'.format((i % 2) + 1), [ - E('
', info.leases[i].hostname ? info.leases[i].hostname : '?'), - E('
', info.leases[i].ipaddr), - E('
', info.leases[i].macaddr), - E('
', timestr) - ])); - } - - if (ls.firstElementChild === ls.lastElementChild) - ls.appendChild(E('

<%:There are no active leases.%>
')); - } - - var ls6 = document.getElementById('lease6_status_table'); - if (ls6 && info.leases6) - { - ls6.parentNode.style.display = 'block'; - - /* clear all rows */ - while (ls6.firstElementChild !== ls6.lastElementChild) - ls6.removeChild(ls6.lastElementChild); - - for (var i = 0; i < info.leases6.length; i++) - { - var timestr; - - if (info.leases6[i].expires === false) - timestr = '<%:unlimited%>'; - else if (info.leases6[i].expires <= 0) - timestr = '<%:expired%>'; - else - timestr = String.format('%t', info.leases6[i].expires); - - var host = hosts[duid2mac(info.leases6[i].duid)], - name = info.leases6[i].hostname, - hint = null; - - if (!name) { - if (host) - hint = host.name || host.ipv4 || host.ipv6; - } - else { - if (host && host.name && info.leases6[i].hostname != host.name) - hint = host.name; - } - - ls6.appendChild(E('
'.format((i % 2) + 1), [ - E('
', hint ? '
%h (%h)
'.format(name || '?', hint) : (name || '?')), - E('
', info.leases6[i].ip6addr), - E('
', info.leases6[i].duid), - E('
', timestr) - ])); - } - - if (ls6.firstElementChild === ls6.lastElementChild) - ls6.appendChild(E('

<%:There are no active leases.%>
')); - } - <% end %> - <% if has_wifi then %> - var assoclist = [ ]; - var ws = document.getElementById('wifi_status_table'); if (ws) { @@ -429,21 +301,6 @@ { var net = dev.networks[nidx]; var is_assoc = (net.bssid != '00:00:00:00:00:00' && net.channel && !net.disabled); - var num_assoc = 0; - - for (var bssid in net.assoclist) - { - var bss = net.assoclist[bssid]; - - bss.bssid = bssid; - bss.link = net.link; - bss.name = net.name; - bss.ifname = net.ifname; - bss.radio = dev.name; - - assoclist.push(bss); - num_assoc++; - } var icon; if (!is_assoc) @@ -466,7 +323,7 @@ '<%:Mode%>', net.mode, '<%:BSSID%>', is_assoc ? (net.bssid || '-') : null, '<%:Encryption%>', is_assoc ? net.encryption : null, - '<%:Associations%>', is_assoc ? (num_assoc || '-') : null, + '<%:Associations%>', is_assoc ? (net.num_assoc || '-') : null, null, is_assoc ? null : E('em', '<%:Wireless is disabled or not associated%>'))); } @@ -481,62 +338,6 @@ if (!ws.lastElementChild) ws.appendChild(E('<%:No information available%>')); } - - var ac = document.getElementById('wifi_assoc_table'); - if (ac) - { - /* clear all rows */ - while (ac.firstElementChild !== ac.lastElementChild) - ac.removeChild(ac.lastElementChild); - - assoclist.sort(function(a, b) { - return (a.name == b.name) - ? (a.bssid < b.bssid) - : (a.name > b.name ) - ; - }); - - for (var i = 0; i < assoclist.length; i++) - { - var icon; - var q = (-1 * (assoclist[i].noise - assoclist[i].signal)) / 5; - if (q < 1) - icon = "<%=resource%>/icons/signal-0.png"; - else if (q < 2) - icon = "<%=resource%>/icons/signal-0-25.png"; - else if (q < 3) - icon = "<%=resource%>/icons/signal-25-50.png"; - else if (q < 4) - icon = "<%=resource%>/icons/signal-50-75.png"; - else - icon = "<%=resource%>/icons/signal-75-100.png"; - - var host = hosts[assoclist[i].bssid], - name = host ? (host.name || host.ipv4 || host.ipv6) : null, - hint = (host && host.name && (host.ipv4 || host.ipv6)) ? (host.ipv4 || host.ipv6) : null; - - ac.appendChild(E('
'.format(1 + (i % 2)), [ - E('
%h
' - .format(assoclist[i].radio, assoclist[i].ifname)), - E('' - .format(assoclist[i].link, assoclist[i].name)), - E('
', - assoclist[i].bssid), - E('
', - hint ? '
%h (%h)
'.format(name || '?', hint) : (name || '?')), - E('
%d / %d <%:dBm%>
' - .format(assoclist[i].signal, assoclist[i].noise, assoclist[i].signal - assoclist[i].noise, icon, assoclist[i].signal, assoclist[i].noise)), - E('
', [ - E('', wifirate(assoclist[i], true)), - E('
'), - E('', wifirate(assoclist[i], false)) - ]) - ])); - } - - if (ac.firstElementChild === ac.lastElementChild) - ac.appendChild(E('

<%:No information available%>
')); - } <% end %> var e; @@ -594,8 +395,8 @@

<%:Status%>

-
- <%:System%> +
+

<%:System%>

<%:Hostname%>
<%=luci.sys.hostname() or "?"%>
@@ -610,79 +411,51 @@
<%:Uptime%>
-
<%:Load Average%>
-
-
+
-
- <%:Memory%> +
+

<%:Memory%>

<%:Total Available%>
-
<%:Free%>
-
<%:Buffered%>
-
-
+
<% if swapinfo.total > 0 then %> -
- <%:Swap%> +
+

<%:Swap%>

<%:Total Available%>
-
<%:Free%>
-
-
+
<% end %> -
- <%:Network%> - <% if has_mptcp == "0" then %> +
+

<%:Network%>

+
<%:Collecting data...%>
- <% end %>
<%:Active Connections%>
-
-
+
-<% if has_dhcp then %> -
- <%:DHCP Leases%> - -
-
-
<%:Hostname%>
-
<%:IPv4-Address%>
-
<%:MAC-Address%>
-
<%:Leasetime remaining%>
-
-
-

<%:Collecting data...%>
-
-
-
- - -<% end %> +<% + if has_dhcp then + include("admin_network/lease_status") + end +%> <% if has_dsl then %> -
- <%:DSL%> +
+

<%:DSL%>

+
<%:DSL Status%>
@@ -696,35 +469,23 @@
-
+
<% end %> <% if has_wifi then %> -
- <%:Wireless%> +
+

<%:Wireless%>

<%:Collecting data...%>
-
+
-
- <%:Associated Stations%> +
+

<%:Associated Stations%>

-
-
-
 
-
<%:Network%>
-
<%:MAC-Address%>
-
<%:Host%>
-
<%:Signal%> / <%:Noise%>
-
<%:RX Rate%> / <%:TX Rate%>
-
-
-

<%:Collecting data...%>
-
-
-
+ <%+admin_network/wifi_assoclist%> +
<% end %> <%- diff --git a/luci-mod-admin-full/luasrc/view/admin_status/iptables.htm b/luci-mod-admin-full/luasrc/view/admin_status/iptables.htm index ced4d5f77..5d544ca60 100644 --- a/luci-mod-admin-full/luasrc/view/admin_status/iptables.htm +++ b/luci-mod-admin-full/luasrc/view/admin_status/iptables.htm @@ -62,6 +62,7 @@ <%+header%> +

<%:Firewall Status%>

-
<% if has_ip6tables then %>
    @@ -88,69 +88,69 @@ -
    +
    <% for _, tbl in ipairs(tables) do chaincnt = 0 %>

    <%:Table%>: <%=tbl%>

    -
    - <% for _, chain in ipairs(ipt:chains(tbl)) do - rowcnt = 0 - chaincnt = chaincnt + 1 - chaininfo = ipt:chain(tbl, chain) - %> -
    -
    -
    - <%:Chain%> <%=chain%> - (<%- if chaininfo.policy then -%> - <%:Policy%>: <%=chaininfo.policy%>, <%:Packets%>: <%=chaininfo.packets%>, <%:Traffic%>: <%=wba.byte_format(chaininfo.bytes)-%> - <%- else -%> - <%:References%>: <%=chaininfo.references-%> - <%- end -%>) -
    -
    -
    -
    <%:Pkts.%>
    -
    <%:Traffic%>
    -
    <%:Target%>
    -
    <%:Prot.%>
    -
    <%:In%>
    -
    <%:Out%>
    -
    <%:Source%>
    -
    <%:Destination%>
    -
    <%:Options%>
    -
    - <% for _, rule in ipairs(ipt:find({table=tbl, chain=chain})) do %> -
    -
    <%=rule.packets%>
    -
    <%=wba.byte_format(rule.bytes)%>
    -
    <%=rule.target and link_target(tbl, rule.target) or "-"%>
    -
    <%=rule.protocol%>
    -
    <%=link_iface(rule.inputif)%>
    -
    <%=link_iface(rule.outputif)%>
    -
    <%=rule.source%>
    -
    <%=rule.destination%>
    -
    <%=#rule.options > 0 and luci.util.pcdata(table.concat(rule.options, " ")) or "-"%>
    -
    - <% end %> + <% for _, chain in ipairs(ipt:chains(tbl)) do + rowcnt = 0 + chaincnt = chaincnt + 1 + chaininfo = ipt:chain(tbl, chain) + %> +

    + <%:Chain%> <%=chain%> + (<%- if chaininfo.policy then -%> + <%:Policy%>: <%=chaininfo.policy%>, <%:Packets%>: <%=chaininfo.packets%>, <%:Traffic%>: <%=wba.byte_format(chaininfo.bytes)-%> + <%- else -%> + <%:References%>: <%=chaininfo.references-%> + <%- end -%>) +

    - <% if rowcnt == 1 then %> -
    -
    <%:No rules in this chain%>
    +
    +
    +
    +
    <%:Pkts.%>
    +
    <%:Traffic%>
    +
    <%:Target%>
    +
    <%:Prot.%>
    +
    <%:In%>
    +
    <%:Out%>
    +
    <%:Source%>
    +
    <%:Destination%>
    +
    <%:Options%>
    - <% end %> - <% end %> - <% if chaincnt == 0 then %> -
    -
    <%:No chains in this table%>
    + <% for _, rule in ipairs(ipt:find({table=tbl, chain=chain})) do %> +
    +
    <%=rule.packets%>
    +
    <%=wba.byte_format(rule.bytes)%>
    +
    <%=rule.target and link_target(tbl, rule.target) or "-"%>
    +
    <%=rule.protocol%>
    +
    <%=link_iface(rule.inputif)%>
    +
    <%=link_iface(rule.outputif)%>
    +
    <%=rule.source%>
    +
    <%=rule.destination%>
    +
    <%=#rule.options > 0 and luci.util.pcdata(table.concat(rule.options, " ")) or "-"%>
    +
    + <% end %> + + <% if rowcnt == 1 then %> +
    +
    <%:No rules in this chain%>
    +
    + <% end %>
    - <% end %> -
    +
    + <% end %> + + <% if chaincnt == 0 then %> + <%:No chains in this table%> + <% end %> +

    <% end %> -
    +
<%+footer%> diff --git a/luci-mod-admin-full/luasrc/view/admin_status/load.htm b/luci-mod-admin-full/luasrc/view/admin_status/load.htm index c8ada7156..dc7d927de 100644 --- a/luci-mod-admin-full/luasrc/view/admin_status/load.htm +++ b/luci-mod-admin-full/luasrc/view/admin_status/load.htm @@ -237,6 +237,8 @@ label_15_peak.innerHTML = (data_15_peak / 100).toFixed(2); } ); + + XHR.run(); } }, 1000 ); diff --git a/luci-mod-admin-full/luasrc/view/admin_status/routes.htm b/luci-mod-admin-full/luasrc/view/admin_status/routes.htm index af8037135..9ed37939f 100644 --- a/luci-mod-admin-full/luasrc/view/admin_status/routes.htm +++ b/luci-mod-admin-full/luasrc/view/admin_status/routes.htm @@ -32,28 +32,30 @@ <%+header%> + +

<%:Routes%>

<%:The following rules are currently active on this system.%>
-
+
ARP
-
-
-
<%_IPv4-Address%>
-
<%_MAC-Address%>
-
<%:Interface%>
+
+
+
<%_IPv4-Address%>
+
<%_MAC-Address%>
+
<%:Interface%>
<% for _, v in ipairs(ip.neighbors({ family = 4 })) do if v.mac then %> -
-
<%=v.dest%>
-
<%=v.mac%>
-
<%=luci.tools.webadmin.iface_get_network(v.dev) or '(' .. v.dev .. ')'%>
+
+
<%=v.dest%>
+
<%=v.mac%>
+
<%=luci.tools.webadmin.iface_get_network(v.dev) or '(' .. v.dev .. ')'%>
<% style = not style @@ -62,61 +64,57 @@ %>
-
-
+
-
+
<%_Active IPv4-Routes%> -
-
-
-
<%:Network%>
-
<%:Target%>
-
<%_IPv4-Gateway%>
-
<%:Metric%>
-
<%:Table%>
+
+
+
<%:Network%>
+
<%:Target%>
+
<%_IPv4-Gateway%>
+
<%:Metric%>
+
<%:Table%>
<% for _, v in ipairs(ip.routes({ family = 4, type = 1 })) do %> -
-
<%=luci.tools.webadmin.iface_get_network(v.dev) or v.dev%>
-
<%=v.dest%>
-
<%=v.gw%>
-
<%=v.metric or 0%>
-
<%=rtn[v.table] or v.table%>
+
+
<%=luci.tools.webadmin.iface_get_network(v.dev) or v.dev%>
+
<%=v.dest%>
+
<%=v.gw or "-"%>
+
<%=v.metric or 0%>
+
<%=rtn[v.table] or v.table%>
<% style = not style end %>
-
-
+
<% if nixio.fs.access("/proc/net/ipv6_route") then style = true %> -
+
<%_Active IPv6-Routes%> -
-
-
-
<%:Network%>
-
<%:Target%>
-
<%:Source%>
-
<%:Metric%>
-
<%:Table%>
+
+
+
<%:Network%>
+
<%:Target%>
+
<%:Source%>
+
<%:Metric%>
+
<%:Table%>
<% for _, v in ipairs(ip.routes({ family = 6, type = 1 })) do if v.dest and not v.dest:is6linklocal() then %> -
-
<%=luci.tools.webadmin.iface_get_network(v.dev) or '(' .. v.dev .. ')'%>
-
<%=v.dest%>
-
<%=v.from%>
-
<%=v.metric or 0%>
-
<%=rtn[v.table] or v.table%>
+
+
<%=luci.tools.webadmin.iface_get_network(v.dev) or '(' .. v.dev .. ')'%>
+
<%=v.dest%>
+
<%=v.from%>
+
<%=v.metric or 0%>
+
<%=rtn[v.table] or v.table%>
<% style = not style @@ -125,27 +123,25 @@ %>
-
-
+
-
+
<%:IPv6 Neighbours%> -
-
-
-
<%:IPv6-Address%>
-
<%:MAC-Address%>
-
<%:Interface%>
+
+
+
<%:IPv6-Address%>
+
<%:MAC-Address%>
+
<%:Interface%>
<% for _, v in ipairs(ip.neighbors({ family = 6 })) do if v.dest and not v.dest:is6linklocal() and v.mac then %> -
-
<%=v.dest%>
-
<%=v.mac%>
-
<%=luci.tools.webadmin.iface_get_network(v.dev) or '(' .. v.dev .. ')'%>
+
+
<%=v.dest%>
+
<%=v.mac%>
+
<%=luci.tools.webadmin.iface_get_network(v.dev) or '(' .. v.dev .. ')'%>
<% style = not style @@ -154,8 +150,7 @@ %>
-
-
+
<% end %>
diff --git a/luci-mod-admin-full/luasrc/view/admin_status/wireless.htm b/luci-mod-admin-full/luasrc/view/admin_status/wireless.htm index 4211b2647..1806f4a6c 100644 --- a/luci-mod-admin-full/luasrc/view/admin_status/wireless.htm +++ b/luci-mod-admin-full/luasrc/view/admin_status/wireless.htm @@ -276,7 +276,7 @@ function wireless_label(dbm, noise) { if (noise) - return String.format("%d <%:dBm%> (SNR %d <%:dBm%>)", noise_floor + dbm - 255, dbm - noise); + return String.format("%d <%:dBm%> (SNR %d <%:dB%>)", noise_floor + dbm - 255, dbm - noise); else return String.format("%d <%:dBm%>", noise_floor + dbm - 255); } @@ -308,6 +308,8 @@ label_rate_peak.innerHTML = rate_label(data_rate_peak); } ); + + XHR.run(); } }, 1000 ); diff --git a/luci-mod-admin-full/luasrc/view/admin_system/flashops.htm b/luci-mod-admin-full/luasrc/view/admin_system/flashops.htm index b32ef7826..0a4bc6578 100644 --- a/luci-mod-admin-full/luasrc/view/admin_system/flashops.htm +++ b/luci-mod-admin-full/luasrc/view/admin_system/flashops.htm @@ -13,84 +13,77 @@
  • <%:Configuration%>
  • -
    - -
    - <%:Backup / Restore%> -
    <%: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).%>
    -
    -
    - -
    - -
    - -
    +
    +

    <%:Backup / Restore%>

    +
    <%: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).%>
    +
    + + +
    + +
    +
    - - <% if reset_avail then %> -
    - -
    - -
    - -
    -
    -
    - <% end %> -
    -
    -
    <%:To restore configuration files, you can upload a previously generated backup archive here.%>
    -
    -
    -
    - -
    - - - -
    -
    -
    -
    +
    + <% if reset_avail then %> -
    <%:Custom files (certificates, scripts) may remain on the system. To prevent this, perform a factory-reset first.%>
    +
    + +
    + +
    + +
    +
    +
    <% end %> -
    +
    +
    <%:To restore configuration files, you can upload a previously generated backup archive here.%>
    +
    +
    +
    + +
    + + + +
    +
    +
    +
    + <% if reset_avail then %> +
    <%:Custom files (certificates, scripts) may remain on the system. To prevent this, perform a factory-reset first.%>
    + <% end %> +
    -
    - -
    - <%:Flash new firmware image%> - <% if upgrade_avail then %> -
    - -
    <%:Upload a sysupgrade-compatible image here to replace the running firmware. Check "Keep settings" to retain the current configuration (requires a compatible firmware image).%>
    -
    -
    - -
    - -
    -
    -
    - -
    - - -
    +
    +

    <%:Flash new firmware image%>

    + <% if upgrade_avail then %> + + +
    <%:Upload a sysupgrade-compatible image here to replace the running firmware. Check "Keep settings" to retain the current configuration (requires a compatible firmware image).%>
    +
    +
    + +
    +
    - <% if image_invalid then %> -
    <%:The uploaded image file does not contain a supported format. Make sure that you choose the generic image format for your platform. %>
    - <% end %> - - <% else %> -
    <%:Sorry, there is no sysupgrade support present; a new firmware image must be flashed manually. Please refer to the wiki for device specific install instructions.%>
    - <% end %> -
    - - +
    + +
    + + +
    +
    +
    + <% if image_invalid then %> +
    <%:The uploaded image file does not contain a supported format. Make sure that you choose the generic image format for your platform. %>
    + <% end %> + + <% else %> +
    <%:Sorry, there is no sysupgrade support present; a new firmware image must be flashed manually. Please refer to the wiki for device specific install instructions.%>
    + <% end %> +
    <%+footer%> diff --git a/luci-mod-admin-full/luasrc/view/admin_system/packages.htm b/luci-mod-admin-full/luasrc/view/admin_system/packages.htm index 4944a232b..ef13a9167 100644 --- a/luci-mod-admin-full/luasrc/view/admin_system/packages.htm +++ b/luci-mod-admin-full/luasrc/view/admin_system/packages.htm @@ -44,6 +44,8 @@ end <%+header%> + +

    <%:Software%>

    @@ -57,8 +59,8 @@ end -
    -
    +
    +
    <% if (install and next(install)) or (remove and next(remove)) or update or upgrade then %>
    <% if #stdout > 0 then %>
    <%=pcdata(stdout)%>
    <% end %> @@ -91,18 +93,18 @@ end
     
    -
    +

    -
    +
    - +
    @@ -110,11 +112,11 @@ end
    - +
    -
    - +
    +
    @@ -122,90 +124,90 @@ end <% if display ~= "available" then %> -
    -
    -
    -
     
    -
    <%:Package name%>
    -
    <%:Version%>
    -
    - <% local empty = true; luci.model.ipkg.list_installed(querypat, function(n, v, s, d) empty = false; filter[n] = true %> -
    -
    -
    - - - - <%:Remove%> -
    +
    +
    +
    +
    +
    <%:Package name%>
    +
    <%:Version%>
    +
     
    -
    <%=luci.util.pcdata(n)%>
    -
    <%=luci.util.pcdata(v)%>
    + <% local empty = true; luci.model.ipkg.list_installed(querypat, function(n, v, s, d) empty = false; filter[n] = true %> +
    +
    <%=luci.util.pcdata(n)%>
    +
    <%=luci.util.pcdata(v)%>
    +
    +
    + + + + +
    +
    +
    + <% end) %> + <% if empty then %> +
    +
     
    +
    <%:none%>
    +
    <%:none%>
    +
    + <% end %>
    - <% end) %> - <% if empty then %> -
    -
     
    -
    <%:none%>
    -
    <%:none%>
    -
    - <% end %>
    -
    +
    <% else %> -
    +
    <% if not querypat then %> -
      + -
      <% end %> -
      -
      -
       
      -
      <%:Package name%>
      -
      <%:Version%>
      -
      <%:Size (.ipk)%>
      -
      <%:Description%>
      -
      - <% local empty = true; opkg_list(querypat or letterpat, function(n, v, s, d) if filter[n] then return end; empty = false %> -
      -
      -
      - - - - <%:Install%> -
      +
      +
      +
      +
      <%:Package name%>
      +
      <%:Version%>
      +
      <%:Size (.ipk)%>
      +
      <%:Description%>
      +
       
      -
      <%=luci.util.pcdata(n)%>
      -
      <%=luci.util.pcdata(v)%>
      -
      <%=luci.util.pcdata(s)%>
      -
      <%=luci.util.pcdata(d)%>
      + <% local empty = true; opkg_list(querypat or letterpat, function(n, v, s, d) if filter[n] then return end; empty = false %> +
      +
      <%=luci.util.pcdata(n)%>
      +
      <%=luci.util.pcdata(v)%>
      +
      <%=luci.util.pcdata(s)%>
      +
      <%=luci.util.pcdata(d)%>
      +
      +
      + + + + +
      +
      +
      + <% end) %> + <% if empty then %> +
      +
       
      +
      <%:none%>
      +
      <%:none%>
      +
      <%:none%>
      +
      <%:none%>
      +
      + <% end %>
      - <% end) %> - <% if empty then %> -
      -
       
      -
      <%:none%>
      -
      <%:none%>
      -
      <%:none%>
      -
      <%:none%>
      -
      - <% end %>
      - <% if not querypat then %> -
      - <% end %> -
    + <% end %> diff --git a/luci-mod-admin-full/luasrc/view/admin_system/reboot.htm b/luci-mod-admin-full/luasrc/view/admin_system/reboot.htm index c9551804d..6ec2b310d 100644 --- a/luci-mod-admin-full/luasrc/view/admin_system/reboot.htm +++ b/luci-mod-admin-full/luasrc/view/admin_system/reboot.htm @@ -7,7 +7,6 @@ <%+header%>

    <%:Reboot%>

    -

    <%:Reboots the operating system of your device%>

    @@ -49,7 +48,7 @@ } //]]> - +
    +
    <%:Legend:%>
      <%:Section added%>
    @@ -32,9 +32,11 @@ ret[#ret+1] = "
    %s.%s.%s+=%s" %{ r, s, o, util.pcdata(v[i]) } end - else + elseif v ~= "" then ret[#ret+1] = "
    %s.%s.%s=%s" %{ r, s, o, util.pcdata(v) } + else + ret[#ret+1] = "
    %s.%s.%s" %{ r, s, o } end end end @@ -57,7 +59,7 @@ ret[#ret+1] = "%s.%s.%s+=%s
    " %{ r, s, o, util.pcdata(v[i]) } end - + else ret[#ret+1] = "%s.%s.%s=%s
    " %{ r, s, o, util.pcdata(v) } @@ -75,5 +77,5 @@ write(table.concat(ret)) %>
    -
    + <%- end) %> diff --git a/luci-mod-admin-full/luasrc/view/admin_uci/changes.htm b/luci-mod-admin-full/luasrc/view/admin_uci/changes.htm index c69ec1215..628224475 100644 --- a/luci-mod-admin-full/luasrc/view/admin_uci/changes.htm +++ b/luci-mod-admin-full/luasrc/view/admin_uci/changes.htm @@ -27,21 +27,17 @@
    <% if redir_url then %> -
    -
    - -
    -
    +
    + +
    <% end %> -
    - -
    "> - - " /> - -
    -
    + +
    "> + + " /> + +
    <%+footer%> diff --git a/luci-mod-admin-full/luasrc/view/admin_uci/revert.htm b/luci-mod-admin-full/luasrc/view/admin_uci/revert.htm index dff53420a..ff23d568d 100644 --- a/luci-mod-admin-full/luasrc/view/admin_uci/revert.htm +++ b/luci-mod-admin-full/luasrc/view/admin_uci/revert.htm @@ -27,7 +27,7 @@ diff --git a/luci-theme-openmptcprouter/htdocs/luci-static/openmptcprouter/cascade.css b/luci-theme-openmptcprouter/htdocs/luci-static/openmptcprouter/cascade.css index 5771a94aa..9fe28f463 100644 --- a/luci-theme-openmptcprouter/htdocs/luci-static/openmptcprouter/cascade.css +++ b/luci-theme-openmptcprouter/htdocs/luci-static/openmptcprouter/cascade.css @@ -215,7 +215,8 @@ a:hover { * ---------------------------------------------------------------------------------------- */ p, .cbi-map-descr, -.cbi-section-descr { +.cbi-section-descr, +.table .tr.cbi-section-table-descr .th { font-size: 13px; font-weight: normal; line-height: 18px; @@ -229,7 +230,7 @@ p small { h1, h2, -h3, +h3, legend, h4, h5, h6 { @@ -265,14 +266,14 @@ h2 small { font-size: 14px; } -h3, +h3, legend, h4, h5, h6 { line-height: 36px; } -h3 { +h3, legend { font-size: 18px; } @@ -543,6 +544,13 @@ textarea { height: auto; } +.td > input[type=text], +.td > input[type=password], +.td > select, +.td > .cbi-dropdown { + width: 100%; +} + .uneditable-input { background-color: #ffffff; display: block; @@ -645,6 +653,26 @@ textarea[readonly] { border-color: #ddd; } +.cbi-optionals, +.cbi-section-create { + padding: 0 0 10px 10px; +} + +.cbi-section-create { + margin: -3px; + display: inline-flex; + align-items: center; +} + +.cbi-section-create > * { + margin: 3px; + flex: 1 1 auto; +} + +.cbi-section-create > * > input { + width: 100%; +} + .actions, .cbi-page-actions { background: #f5f5f5; @@ -706,6 +734,7 @@ textarea[readonly] { padding: 0; font-size: 13px; border-collapse: collapse; + position: relative; } .table .th, .table .td { @@ -765,6 +794,19 @@ table tbody th { vertical-align: top; } +.tr.placeholder { + height: calc(3em + 20px); +} + +.tr.placeholder > .td { + position: absolute; + left: 0; + right: 0; + bottom: 0; + text-align: center; + line-height: 3em; +} + /* Patterns.less * Repeatable UI elements outside the base styles provided from the scaffolding * ---------------------------------------------------------------------------- */ @@ -1277,99 +1319,67 @@ footer { outline: 1px dotted #666; } -.btn.primary, -.cbi-page-actions .cbi-button-apply, -.cbi-page-actions .cbi-button-save, -.cbi-page-actions .cbi-button-reset { - color: #ffffff; - padding: 5px 14px 6px; - background-color: #0064cd; - background-repeat: repeat-x; - background-image: linear-gradient(to bottom, #049cdb, #0064cd); - text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); - border-color: #0064cd #0064cd #003f81; - border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); -} - .cbi-input-invalid, .cbi-value-error input { color: #FF0000; border-color: #FF0000; } -.cbi-button-up, -.cbi-input-up { - background-position: center center; - background-image: url('../resources/cbi/up.gif'), linear-gradient(#ffffff, #ffffff 25%, #e6e6e6); -} - -.cbi-button-down, -.cbi-input-down { - background-position: center center; - background-image: url('../resources/cbi/down.gif'), linear-gradient(#ffffff, #ffffff 25%, #e6e6e6); -} - -.cbi-button-find, -.cbi-input-find { - background-position: 6px center, left top; - padding-left: 28px; - background-image: url('../resources/cbi/find.gif'), linear-gradient(#ffffff, #ffffff 25%, #e6e6e6); -} - +.cbi-button-positive, +.cbi-button-fieldadd, .cbi-button-add, -.cbi-input-add { - background-position: 6px center, left top; - padding-left: 28px; - background-image: url('../resources/cbi/add.gif'), linear-gradient(#ffffff, #ffffff 25%, #e6e6e6); -} - -.cbi-button-apply, -.cbi-input-apply { - background-position: 6px center, left top; - padding-left: 28px; - background-image: url('../resources/cbi/apply.gif'), linear-gradient(#ffffff, #ffffff 25%, #e6e6e6); -} - -.cbi-button-reset, -.cbi-input-reset { - background-position: 6px center, left top; - padding-left: 28px; - background-image: url('../resources/cbi/reset.gif'), linear-gradient(#ffffff, #ffffff 25%, #e6e6e6); -} - -.cbi-button-edit, -.cbi-input-edit { - background-position: 6px center, left top; - padding-left: 28px; - background-image: url('../resources/cbi/edit.gif'), linear-gradient(#ffffff, #ffffff 25%, #e6e6e6); -} - -.cbi-button-remove, -.cbi-input-remove { - background-position: 6px center, left top; - padding-left: 28px; - background-image: url('../resources/cbi/remove.gif'), linear-gradient(#ffffff, #ffffff 25%, #e6e6e6); -} - -.cbi-button-reload, -.cbi-input-reload { - background-position: 6px center, left top; - padding-left: 28px; - background-image: url('../resources/cbi/reload.gif'), linear-gradient(#ffffff, #ffffff 25%, #e6e6e6); -} - -.cbi-button-link, -.cbi-input-link { - background-position: 6px center, left top; - padding-left: 28px; - background-image: url('../resources/cbi/link.gif'), linear-gradient(#ffffff, #ffffff 25%, #e6e6e6); +.cbi-button-save { + border-color: #4a4; + color: #4a4; } +.cbi-button-neutral, .cbi-button-download, -.cbi-input-download { - background-position: 6px center, left top; - padding-left: 28px; - background-image: url('../resources/cbi/download.gif'), linear-gradient(#ffffff, #ffffff 25%, #e6e6e6); +.cbi-button-find, +.cbi-button-link, +.cbi-button-up, +.cbi-button-down { + border-color: #444; + color: #444; +} + +.btn.primary, +.cbi-button-action, +.cbi-button-apply, +.cbi-button-reload, +.cbi-button-edit { + border-color: #0069d6; + color: #0069d6; +} + +.cbi-button-negative, +.cbi-section-remove .cbi-button, +.cbi-button-reset, +.cbi-button-remove { + border-color: #c44; + color: #c44; +} + +.btn.primary, +.cbi-button-action.important, +.cbi-page-actions .cbi-button-apply, +.cbi-section-actions .cbi-button-edit { + color: #fff; + background: #0069d6; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); +} + +.cbi-button-positive.important, +.cbi-page-actions .cbi-button-save { + color: #fff; + background: #4a4; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); +} + +.cbi-page-actions .cbi-button-apply + .cbi-button-save { + background: linear-gradient(#ffffff, #ffffff 25%, #e6e6e6); + text-shadow: 0 -1px 0 rgba(255, 255, 255, 0.75); + color: #4a4; } .cbi-dropdown { @@ -1525,6 +1535,58 @@ footer { opacity: .6; } +.cbi-tooltip-container { + cursor: help; +} + +.cbi-tooltip { + position: absolute; + z-index: 1000; + left: -1000px; + opacity: 0; + transition: opacity .25s ease-out; +} + +.cbi-tooltip-container:hover .cbi-tooltip:not(:empty) { + left: auto; + opacity: 1; + transition: opacity .25s ease-in; +} + +.zonebadge .cbi-tooltip { + padding: 1px; + background: inherit; + margin: -1.6em 0 0 -5px; + border-radius: 3px; + pointer-events: none; + box-shadow: 0 0 3px #444; +} + +.zonebadge .cbi-tooltip > * { + margin: 1px; +} + +.zone-forwards { + display: flex; + flex-wrap: wrap; +} + +.zone-forwards > * { + flex: 1 1 40%; + padding: 1px; +} + +.zone-forwards > span { + flex-basis: 10%; + text-align: center; +} + +.zone-forwards .zone-src, +.zone-forwards .zone-dest { + display: flex; + flex-direction: column; +} + .btn.active, .btn:active { box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.25), 0 1px 2px rgba(0, 0, 0, 0.05); } @@ -1555,46 +1617,6 @@ footer { font-size: 11px; } -/* Button icons for specific pages */ -.Startup .cbi-section-table input.cbi-input-apply, -.Startup .cbi-section-table input.cbi-button-apply { - background-image: url("../resources/cbi/apply.gif"); - background-position: 7px 4px; - padding: 3px 9px 3px 27px; -} - -.Processes .cbi-section-table input.cbi-input-reload, -.Startup .cbi-section-table input.cbi-input-reload { - background-image: url("../resources/cbi/reload.gif"); - background-position: 7px 4px; - padding: 3px 9px 3px 27px; -} - -.Processes .cbi-section-table input.cbi-input-remove, -.Processes .cbi-section-table div.cbi-section-remove input, -.Startup .cbi-section-table input.cbi-input-remove, -.Startup .cbi-section-table div.cbi-section-remove input { - background-image: url("../resources/cbi/remove.gif"); - background-position: 7px 4px; - padding: 3px 9px 3px 27px; -} - -.Processes .cbi-section-table input.cbi-input-reset, -.Processes .cbi-section-table input.cbi-button-reset, -.Startup .cbi-section-table input.cbi-input-reset, -.Startup .cbi-section-table input.cbi-button-reset { - background-image: url("../resources/cbi/reset.gif"); - background-position: 7px 4px; - padding: 3px 9px 3px 27px; -} - -.Startup .cbi-section-table input.cbi-input-save, -.Startup .cbi-section-table input.cbi-button-save { - background-image: url("../resources/cbi/save.gif"); - background-position: 7px 4px; - padding: 3px 9px 3px 27px; -} - button.btn::-moz-focus-inner, input[type=submit].btn::-moz-focus-inner { padding: 0; border: 0; @@ -1746,6 +1768,20 @@ header .pull-right { padding-top: 8px; } font-weight: normal; } +.cbi-section-table-titles.named::before, +.cbi-section-table-descr.named::before, +.cbi-section-table-row[data-title]::before { + content: attr(data-title) " "; + display: table-cell; + padding: 10px 10px 9px; + line-height: 18px; + font-weight: bold; +} + +.cbi-section-table-row[data-title]::before { + border-top: 1px solid #ddd; +} + .left { text-align: left !important; } .right { text-align: right !important; } @@ -1784,9 +1820,13 @@ table table td, vertical-align: middle; } -.cbi-value-description { display: inline; } - -.cbi-value-description img { vertical-align: middle; } +.cbi-value-description { + background-image: url(/luci-static/resources/cbi/help.gif); + background-position: .25em .2em; + background-repeat: no-repeat; + margin: .25em 0 0 0; + padding: 0 0 0 1.7em; +} .cbi-section-error { border: 1px solid #FF0000; @@ -1885,6 +1925,7 @@ table table td, flex-wrap: wrap; } +.ifacebadge.large, .network-status-table .ifacebox-body .ifacebadge { flex: 1; margin: .5em .25em 0 .25em; @@ -1899,7 +1940,6 @@ table table td, white-space: nowrap; color: #666666; text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75); - cursor: pointer; } .zonebadge > em,