vnstat2: allow graphs side by side 5251/head
authorFritz D. Ansel <fdansel@yandex.ru>
Mon, 2 Aug 2021 18:24:40 +0000 (20:24 +0200)
committerFritz D. Ansel <fdansel@yandex.ru>
Wed, 11 Aug 2021 07:25:53 +0000 (09:25 +0200)
an a full-hd screen you will have now 2x3 graphs
instead scrolling through 1x6 graphs

Signed-off-by: Fritz D. Ansel <fdansel@yandex.ru>
applications/luci-app-vnstat2/htdocs/luci-static/resources/view/vnstat2/graphs.js

index fbe9d593372ce7d362b367349ff8f404ee2d7a1b..7ac3b3f7e779e239e3187ab961ffdab7976a97f3 100644 (file)
@@ -16,11 +16,11 @@ return view.extend({
                ]);
 
                ifaces.forEach(function(iface) {
-                       tab.appendChild(E('p', {}, E('img', { 'data-iface': iface, 'style': 'display:none' })));
+                       tab.appendChild(E('span', {}, E('img', { 'data-iface': iface, 'style': 'visibility:hidden; margin:5px 10px' })));
                        fs.exec_direct('/usr/bin/vnstati', [ '-'+style, '-i', iface, '-o', '-' ], 'blob').then(function(res) {
                                var img = tab.querySelector('img[data-iface="%s"]'.format(iface));
                                img.src = URL.createObjectURL(res);
-                               img.style.display = '';
+                               img.style.visibility = 'visible';
                                tab.firstElementChild.style.display = 'none';
                        });
                });