diff options
Diffstat (limited to 'modules/luci-mod-admin-full/luasrc')
11 files changed, 32 insertions, 38 deletions
diff --git a/modules/luci-mod-admin-full/luasrc/view/admin_network/diagnostics.htm b/modules/luci-mod-admin-full/luasrc/view/admin_network/diagnostics.htm index 5607e59dfb..d9217894fd 100644 --- a/modules/luci-mod-admin-full/luasrc/view/admin_network/diagnostics.htm +++ b/modules/luci-mod-admin-full/luasrc/view/admin_network/diagnostics.htm @@ -15,7 +15,6 @@ local ping_host = luci.config.diag and luci.config.diag.ping or "dev.openwrt.org local route_host = luci.config.diag and luci.config.diag.route or "dev.openwrt.org" %> -<script type="text/javascript" src="<%=resource%>/cbi.js"></script> <script type="text/javascript">//<![CDATA[ var stxhr = new XHR(); diff --git a/modules/luci-mod-admin-full/luasrc/view/admin_network/iface_overview.htm b/modules/luci-mod-admin-full/luasrc/view/admin_network/iface_overview.htm index 473e2275ce..00ef8944c6 100644 --- a/modules/luci-mod-admin-full/luasrc/view/admin_network/iface_overview.htm +++ b/modules/luci-mod-admin-full/luasrc/view/admin_network/iface_overview.htm @@ -30,7 +30,6 @@ end) -%> -<script type="text/javascript" src="<%=resource%>/cbi.js"></script> <script type="text/javascript">//<![CDATA[ function iface_shutdown(id, reconnect) { if (!reconnect && !confirm(<%=luci.http.write_json(translate('Really shutdown interface "%s"? You might lose access to this device if you are connected via this interface.'))%>.format(id))) diff --git a/modules/luci-mod-admin-full/luasrc/view/admin_network/wifi_overview.htm b/modules/luci-mod-admin-full/luasrc/view/admin_network/wifi_overview.htm index b9602785f4..f3809ea941 100644 --- a/modules/luci-mod-admin-full/luasrc/view/admin_network/wifi_overview.htm +++ b/modules/luci-mod-admin-full/luasrc/view/admin_network/wifi_overview.htm @@ -107,7 +107,6 @@ </div> <% end %> -<script type="text/javascript" src="<%=resource%>/cbi.js"></script> <script type="text/javascript">//<![CDATA[ var wifidevs = <%=luci.http.write_json(netdevs)%>; diff --git a/modules/luci-mod-admin-full/luasrc/view/admin_status/bandwidth.htm b/modules/luci-mod-admin-full/luasrc/view/admin_status/bandwidth.htm index ba0ab0f680..935e8d2b72 100644 --- a/modules/luci-mod-admin-full/luasrc/view/admin_status/bandwidth.htm +++ b/modules/luci-mod-admin-full/luasrc/view/admin_status/bandwidth.htm @@ -19,7 +19,6 @@ <%+header%> -<script type="text/javascript" src="<%=resource%>/cbi.js"></script> <script type="text/javascript">//<![CDATA[ var bwxhr = new XHR(); @@ -59,6 +58,8 @@ var label_scale; + Math.log2 = Math.log2 || function(x) { return Math.log(x) * Math.LOG2E; }; + function bandwidth_label(bytes, br) { var uby = '<%:kB/s%>'; @@ -149,7 +150,7 @@ var text = G.createElementNS('http://www.w3.org/2000/svg', 'text'); text.setAttribute('x', i + 5); text.setAttribute('y', 15); - text.setAttribute('style', 'fill:#999999; font-size:9pt'); + text.setAttribute('style', 'fill:#999999; font-size:9pt; font-family:sans-serif'); text.appendChild(G.createTextNode(Math.round((width - i) / step / 60) + 'm')); label_25.parentNode.appendChild(line); diff --git a/modules/luci-mod-admin-full/luasrc/view/admin_status/connections.htm b/modules/luci-mod-admin-full/luasrc/view/admin_status/connections.htm index ae8a6bb7ce..19f8284298 100644 --- a/modules/luci-mod-admin-full/luasrc/view/admin_status/connections.htm +++ b/modules/luci-mod-admin-full/luasrc/view/admin_status/connections.htm @@ -5,7 +5,6 @@ <%+header%> -<script type="text/javascript" src="<%=resource%>/cbi.js"></script> <script type="text/javascript">//<![CDATA[ var bwxhr = new XHR(); @@ -124,7 +123,7 @@ var text = G.createElementNS('http://www.w3.org/2000/svg', 'text'); text.setAttribute('x', i + 5); text.setAttribute('y', 15); - text.setAttribute('style', 'fill:#999999; font-size:9pt'); + text.setAttribute('style', 'fill:#999999; font-size:9pt; font-family:sans-serif'); text.appendChild(G.createTextNode(Math.round((width - i) / step / 60) + 'm')); label_25.parentNode.appendChild(line); @@ -137,12 +136,9 @@ XHR.poll(3, '<%=build_url("admin/status/realtime/connections_status")%>', null, function(x, json) { + var rows = []; var conn = json.connections; - while (conn_table.firstElementChild !== conn_table.lastElementChild) - conn_table.removeChild(conn_table.lastElementChild); - - var lookup_queue = [ ]; conn.sort(function(a, b) { @@ -166,15 +162,17 @@ var src = dns_cache[c.src] || (c.layer3 == 'ipv6' ? '[' + c.src + ']' : c.src); var dst = dns_cache[c.dst] || (c.layer3 == 'ipv6' ? '[' + c.dst + ']' : c.dst); - conn_table.appendChild(E('<div class="tr cbi-section-table-row cbi-rowstyle-%d">'.format(1 + (i % 2)), [ - E('<div class="td">', c.layer3.toUpperCase()), - E('<div class="td">', c.layer4.toUpperCase()), - E('<div class="td">', [ src, ':', c.sport ]), - E('<div class="td">', [ dst, ':', c.dport ]), - E('<div class="td" style="white-space:nowrap">', '%1024.2mB (%d <%:Pkts.%>)'.format(c.bytes, c.packets)), - ])); + rows.push([ + c.layer3.toUpperCase(), + c.layer4.toUpperCase(), + src + ':' + c.sport, + dst + ':' + c.dport, + '%1024.2mB (%d <%:Pkts.%>)'.format(c.bytes, c.packets) + ]); } + cbi_update_table(conn_table, rows, '<em><%:No information available%></em>'); + if (lookup_queue.length > 0) XHR.get('<%=build_url("admin/status/nameinfo")%>/' + lookup_queue.slice(0, 100).join('/'), null, function(x, json) @@ -322,7 +320,7 @@ <div style="text-align:right"><small id="scale">-</small></div> <br /> - <div class="table" style="width:100%; table-layout:fixed" cellspacing="5"> + <div class="table"> <div class="tr"> <div class="td" style="text-align:right; vertical-align:top"><strong style="border-bottom:2px solid blue"><%:UDP:%></strong></div> <div class="td" id="lb_udp_cur">0</div> @@ -357,16 +355,20 @@ <br /> <div class="cbi-section-node"> - <div class="table cbi-section-table" id="connections"> - <div class="tr cbi-section-table-titles"> - <div class="th cbi-section-table-cell"><%:Network%></div> - <div class="th cbi-section-table-cell"><%:Protocol%></div> - <div class="th cbi-section-table-cell"><%:Source%></div> - <div class="th cbi-section-table-cell"><%:Destination%></div> - <div class="th cbi-section-table-cell"><%:Transfer%></div> + <div class="table" id="connections"> + <div class="tr table-titles"> + <div class="th col-2 hide-xs"><%:Network%></div> + <div class="th col-2"><%:Protocol%></div> + <div class="th col-7"><%:Source%></div> + <div class="th col-7"><%:Destination%></div> + <div class="th col-4"><%:Transfer%></div> </div> - <div class="tr"><div class="td" colspan="5"><em><%:Collecting data...%></em></div></div> + <div class="tr placeholder"> + <div class="td"> + <em><%:Collecting data...%></em> + </div> + </div> </div> </div> </fieldset> diff --git a/modules/luci-mod-admin-full/luasrc/view/admin_status/index.htm b/modules/luci-mod-admin-full/luasrc/view/admin_status/index.htm index 9aee30b5f9..03155dbb62 100644 --- a/modules/luci-mod-admin-full/luasrc/view/admin_status/index.htm +++ b/modules/luci-mod-admin-full/luasrc/view/admin_status/index.htm @@ -114,7 +114,6 @@ <%+header%> -<script type="text/javascript" src="<%=resource%>/cbi.js"></script> <script type="text/javascript">//<![CDATA[ function progressbar(v, m) { @@ -435,7 +434,7 @@ <h3><%:Network%></h3> <div id="upstream_status_table" class="network-status-table"> - <em><%:Collecting data...%></em> + <p><em><%:Collecting data...%></em></p> </div> <div class="table" width="100%"> @@ -474,7 +473,7 @@ <h3><%:Wireless%></h3> <div id="wifi_status_table" class="network-status-table"> - <em><%:Collecting data...%></em> + <p><em><%:Collecting data...%></em></p> </div> </div> diff --git a/modules/luci-mod-admin-full/luasrc/view/admin_status/iptables.htm b/modules/luci-mod-admin-full/luasrc/view/admin_status/iptables.htm index 5d544ca60b..51e428e40e 100644 --- a/modules/luci-mod-admin-full/luasrc/view/admin_status/iptables.htm +++ b/modules/luci-mod-admin-full/luasrc/view/admin_status/iptables.htm @@ -62,7 +62,6 @@ <%+header%> -<script type="text/javascript" src="<%=resource%>/cbi.js"></script> <style type="text/css"> span:target { color: blue; diff --git a/modules/luci-mod-admin-full/luasrc/view/admin_status/load.htm b/modules/luci-mod-admin-full/luasrc/view/admin_status/load.htm index dc7d927de8..d60d3c0003 100644 --- a/modules/luci-mod-admin-full/luasrc/view/admin_status/load.htm +++ b/modules/luci-mod-admin-full/luasrc/view/admin_status/load.htm @@ -5,7 +5,6 @@ <%+header%> -<script type="text/javascript" src="<%=resource%>/cbi.js"></script> <script type="text/javascript">//<![CDATA[ var bwxhr = new XHR(); @@ -119,7 +118,7 @@ var text = G.createElementNS('http://www.w3.org/2000/svg', 'text'); text.setAttribute('x', i + 5); text.setAttribute('y', 15); - text.setAttribute('style', 'fill:#999999; font-size:9pt'); + text.setAttribute('style', 'fill:#999999; font-size:9pt; font-family:sans-serif'); text.appendChild(G.createTextNode(Math.round((width - i) / step / 60) + 'm')); label_25.parentNode.appendChild(line); diff --git a/modules/luci-mod-admin-full/luasrc/view/admin_status/routes.htm b/modules/luci-mod-admin-full/luasrc/view/admin_status/routes.htm index 9ed37939fe..74779f6ad8 100644 --- a/modules/luci-mod-admin-full/luasrc/view/admin_status/routes.htm +++ b/modules/luci-mod-admin-full/luasrc/view/admin_status/routes.htm @@ -32,7 +32,6 @@ <%+header%> -<script type="text/javascript" src="<%=resource%>/cbi.js"></script> <div class="cbi-map" id="cbi-network"> <h2 name="content"><%:Routes%></h2> diff --git a/modules/luci-mod-admin-full/luasrc/view/admin_status/wireless.htm b/modules/luci-mod-admin-full/luasrc/view/admin_status/wireless.htm index 1806f4a6c8..e188a9a4ba 100644 --- a/modules/luci-mod-admin-full/luasrc/view/admin_status/wireless.htm +++ b/modules/luci-mod-admin-full/luasrc/view/admin_status/wireless.htm @@ -19,7 +19,6 @@ <%+header%> -<script type="text/javascript" src="<%=resource%>/cbi.js"></script> <script type="text/javascript">//<![CDATA[ var bwxhr = new XHR(); @@ -141,7 +140,7 @@ var text = G.createElementNS('http://www.w3.org/2000/svg', 'text'); text.setAttribute('x', i + 5); text.setAttribute('y', 15); - text.setAttribute('style', 'fill:#999999; font-size:9pt'); + text.setAttribute('style', 'fill:#999999; font-size:9pt; font-family:sans-serif'); text.appendChild(G.createTextNode(Math.round((width - i) / step / 60) + 'm')); label_25.parentNode.appendChild(line); @@ -158,7 +157,7 @@ var text2 = G2.createElementNS('http://www.w3.org/2000/svg', 'text'); text2.setAttribute('x', i + 5); text2.setAttribute('y', 15); - text2.setAttribute('style', 'fill:#999999; font-size:9pt'); + text2.setAttribute('style', 'fill:#999999; font-size:9pt; font-family:sans-serif'); text2.appendChild(G.createTextNode(Math.round((width - i) / step / 60) + 'm')); label_25_2.parentNode.appendChild(line2); diff --git a/modules/luci-mod-admin-full/luasrc/view/admin_system/packages.htm b/modules/luci-mod-admin-full/luasrc/view/admin_system/packages.htm index ef13a91672..1b959afc54 100644 --- a/modules/luci-mod-admin-full/luasrc/view/admin_system/packages.htm +++ b/modules/luci-mod-admin-full/luasrc/view/admin_system/packages.htm @@ -44,7 +44,6 @@ end <%+header%> -<script type="text/javascript" src="<%=resource%>/cbi.js"></script> <h2 name="content"><%:Software%></h2> |