From 90a2ced901c0bf8fd19468d4396b5f8ce2811230 Mon Sep 17 00:00:00 2001 From: bergware Date: Thu, 12 Oct 2023 23:20:06 +0200 Subject: [PATCH 1/3] Improve Dashboard tiles when hidden --- emhttp/plugins/dynamix/DashStats.page | 45 +++++++++++++++++++++++---- 1 file changed, 39 insertions(+), 6 deletions(-) diff --git a/emhttp/plugins/dynamix/DashStats.page b/emhttp/plugins/dynamix/DashStats.page index aa31e3eae..ee8522523 100644 --- a/emhttp/plugins/dynamix/DashStats.page +++ b/emhttp/plugins/dynamix/DashStats.page @@ -183,6 +183,9 @@ div.leftside{float:left;width:66%} div.rightside{float:right;margin:0;text-align:center} div[id$=chart]{margin:-12px 8px -24px -18px} div.template,div#dialogWindow,input#upload{display:none} +span.head_info{display:inline-block;width:240px} +span#head_cpu,span#head_ram,#head_ups,#head_apps,#head_vms{display:none;margin-left:0} +span.head_bar{display:inline-block;width:200px} span.green,span.red,span.orange{padding-left:0} span.ctrl{float:right;margin-top:0;margin-right:10px} span.ctrl span{font-size:2rem!important} @@ -287,7 +290,9 @@ input[value=Edit]{margin:12px 0 0 0;padding:5px 10px} -
_(Processor)_

+
_(Processor)_
+ +_(Load)_:0%

@@ -315,7 +320,9 @@ foreach ($cpus as $pair) { -
_(System)_
_(Memory)_:
+
_(System)_
+_(Memory)_: +_(RAM)_:0%

_(Usable size)_: _(Maximum size)_: @@ -393,7 +400,8 @@ foreach ($ports as $port) {
_(Power)_
-_(UPS Model)_:
+_(UPS Model)_: +_(UPS Load)_:
_(UPS status)_: @@ -449,7 +457,8 @@ echo "";
_(Docker Containers)_
-
+ +
@@ -457,7 +466,8 @@ echo "";
_(Virtual Machines)_
-
+ +
@@ -778,9 +788,19 @@ jQuery.prototype.hideMe = function() { jQuery.prototype.mixedView = function(s) { if (s==0) { this.find('tr:gt(0)').hide(); + this.find('span[id^="head_"]').show(); + this.find('span[id^="tile_"]').hide(); + this.find('span#_cpu_').prop('id','cpu'); + this.find('span#_sys0_').prop('id','sys0'); + this.find('span#_ups_loadpct_').prop('id','ups_loadpct'); return; } this.find('tr:gt(0)').show(); + this.find('span#cpu:first').prop('id','_cpu_'); + this.find('span#sys0:first').prop('id','_sys0_'); + this.find('span#ups_loadpct:first').prop('id','_ups_loadpct_'); + this.find('span[id^="head_"]').hide(); + this.find('span[id^="tile_"]').show(); if (this.attr('data')) { setTimeout(this.attr('data')); } @@ -998,6 +1018,14 @@ function loadlist(init) { $('#docker_view').append(data[0]).hideMe(); $('#vm_view tr.updated').remove(); $('#vm_view').append(data[1]).hideMe(); + var started_apps = $('#docker_view').find('span.outer.apps.started').length; + var stopped_apps = $('#docker_view').find('span.outer.apps.stopped').length; + var paused_apps = $('#docker_view').find('span.outer.apps.paused').length; + var started_vms = $('#vm_view').find('span.outer.vms.started').length; + var stopped_vms = $('#vm_view').find('span.outer.vms.stopped').length; + var paused_vms = $('#vm_view').find('span.outer.vms.paused').length; + $('#head_apps').html("_(Containers)_ -- _(Started)_: "+started_apps+", _(Stopped)_: "+stopped_apps+", _(Paused)_: "+paused_apps); + $('#head_vms').html("_(VMs)_ -- _(Started)_: "+started_vms+", _(Stopped)_: "+stopped_vms+", _(Paused)_: "+paused_vms); if ($.cookie('my_apps')!=null) $('span.apps.stopped').hide(0,noApps()); if ($.cookie('my_vms')!=null) $('span.vms.stopped').hide(0,noVMs()); }); @@ -1253,7 +1281,7 @@ function addProperties() { $(this).find('td:first').prepend(""); }); $('div.frame tr').attr('title',''); - $('tr#var0').hover(function(){$.post('/webGui/include/DashboardApps.php',{sys:0},function(val){$('.sys0').text(val);})}); + $('tr#var0').hover(function(){$.post('/webGui/include/DashboardApps.php',{sys:0},function(val){$('.sys0').not('.fixed').text(val);})}); $('tr#var1').show().hover(function(){$.post('/webGui/include/DashboardApps.php',{sys:1},function(val){$('.sys1').text(val);})}); @@ -1283,6 +1311,11 @@ function showContent() { var tbody = $('div.frame tbody[sort="'+md5+'"]'); tbody.find('.openclose').removeClass('fa-chevron-up fa-chevron-down').addClass('fa-chevron-down'); tbody.find('tr:gt(0)').hide(); + tbody.find('span[id^="head_"]').show(); + tbody.find('span[id^="tile_"]').hide(); + tbody.find('span#_cpu_').prop('id','cpu'); + tbody.find('span#_sys0_').prop('id','sys0'); + tbody.find('span#_ups_loadpct_').prop('id','ups_loadpct'); } } if (count['db-box1']>0) $('div#tile1').show(); From 9b0fbf1256a787598281c4b75f660c09c3efe9bc Mon Sep 17 00:00:00 2001 From: bergware Date: Thu, 12 Oct 2023 23:42:43 +0200 Subject: [PATCH 2/3] Improve Dashboard tiles when hidden --- emhttp/plugins/dynamix/DashStats.page | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/emhttp/plugins/dynamix/DashStats.page b/emhttp/plugins/dynamix/DashStats.page index ee8522523..bdccdd516 100644 --- a/emhttp/plugins/dynamix/DashStats.page +++ b/emhttp/plugins/dynamix/DashStats.page @@ -183,7 +183,7 @@ div.leftside{float:left;width:66%} div.rightside{float:right;margin:0;text-align:center} div[id$=chart]{margin:-12px 8px -24px -18px} div.template,div#dialogWindow,input#upload{display:none} -span.head_info{display:inline-block;width:240px} +span.head_info{width:240px;display:inline-block} span#head_cpu,span#head_ram,#head_ups,#head_apps,#head_vms{display:none;margin-left:0} span.head_bar{display:inline-block;width:200px} span.green,span.red,span.orange{padding-left:0} @@ -334,14 +334,13 @@ foreach ($cpus as $pair) { -
_(Interface)_
-_(Inbound)_: ---_(Outbound)_: --- - - -
+
+_(Inbound)_: ---_(Outbound)_: ---