OSDN Git Service

luci-mod-status: fix align of "Online Users"
authorZiMing Mo <msylgj@immortalwrt.org>
Fri, 25 Mar 2022 21:48:28 +0000 (05:48 +0800)
committerZiMing Mo <msylgj@immortalwrt.org>
Fri, 25 Mar 2022 21:48:28 +0000 (05:48 +0800)
modules/luci-mod-status/htdocs/luci-static/resources/view/status/include/30_network.js

index eff75d1..4a39e22 100644 (file)
@@ -87,26 +87,29 @@ return baseclass.extend({
 
                var fields = [
                        _('Active Connections'), ct_max ? ct_count : null,
+                       _('Online Users'), onlineusers
                ];
 
                var ctstatus = E('table', { 'class': 'table' });
 
                for (var i = 0; i < fields.length; i += 2) {
-                       ctstatus.appendChild(E('tr', { 'class': 'tr' }, [
-                               E('td', { 'class': 'td left', 'width': '33%' }, [ fields[i] ]),
-                               E('td', { 'class': 'td left' }, [
-                                       (fields[i + 1] != null) ? progressbar(fields[i + 1], ct_max) : '?'
-                               ])
-                       ]));
+                       if (fields[i] == _('Online Users')) {
+                               ctstatus.appendChild(E('tr', { 'class': 'tr' }, [
+                                       E('td', { 'class': 'td left', 'width': '33%' }, [ fields[i] ]),
+                                       E('td', { 'class': 'td left' }, [
+                                               (fields[i + 1] != null) ? fields[i + 1] : '?'
+                                       ])
+                               ]));
+                       } else {
+                               ctstatus.appendChild(E('tr', { 'class': 'tr' }, [
+                                       E('td', { 'class': 'td left', 'width': '33%' }, [ fields[i] ]),
+                                       E('td', { 'class': 'td left' }, [
+                                               (fields[i + 1] != null) ? progressbar(fields[i + 1], ct_max) : '?'
+                                       ])
+                               ]));
+                       }
                }
 
-               ctstatus.appendChild(E('tr', {'clash': 'tr'}, [
-                       E('td', { 'class': 'td left', 'width': '33%' }, [ _('Online Users') ]),
-                       E('td', { 'class': 'td left' }, [
-                               (onlineusers != null ) ? onlineusers : '?'
-                       ])
-               ]));
-
                var netstatus = E('div', { 'class': 'network-status-table' });
 
                for (var i = 0; i < wan_nets.length; i++)