From 5b1309505c9a4aa8fb75f309b233bde502564142 Mon Sep 17 00:00:00 2001 From: bergware Date: Sat, 19 Jan 2019 11:04:23 +0100 Subject: [PATCH 1/6] Dashboard: display UPS summary in table --- plugins/dynamix.apcupsd/UPSsummary.page | 33 ------------------- plugins/dynamix/DashStats.page | 44 ++++++++++++++++++++----- 2 files changed, 36 insertions(+), 41 deletions(-) delete mode 100644 plugins/dynamix.apcupsd/UPSsummary.page diff --git a/plugins/dynamix.apcupsd/UPSsummary.page b/plugins/dynamix.apcupsd/UPSsummary.page deleted file mode 100644 index bc14653f0..000000000 --- a/plugins/dynamix.apcupsd/UPSsummary.page +++ /dev/null @@ -1,33 +0,0 @@ -Menu="Dashboard:1" -Cond="file_exists('/var/run/apcupsd.pid')" ---- - - - - - - -
UPS StatusBattery ChargeRuntime LeftNominal PowerUPS LoadUPS Load %
 
diff --git a/plugins/dynamix/DashStats.page b/plugins/dynamix/DashStats.page index 68c11bfc2..a364490a7 100644 --- a/plugins/dynamix/DashStats.page +++ b/plugins/dynamix/DashStats.page @@ -43,6 +43,7 @@ function cache_devices($disk) { $dockerd = pgrep('dockerd'); $libvirtd = pgrep('libvirtd'); +$apcupsd = file_exists('/var/run/apcupsd.pid'); $started = $var['fsState']=='Started'; $array_size = $array_used = 0; $cache_size = $cache_used = 0; @@ -148,6 +149,7 @@ if ($low) $memory_maximum = pow(2,ceil(log($memory_installed)/log(2))); span.outer{float:left} span.inner{width:124px} +span.ups{width:124px;display:inline-block} @@ -241,15 +243,28 @@ foreach ($ports as $port) { } ?> -0) { - echo ""; - echo "
Airflow
Fan count: $fans

"; - for ($f=0; $f<$fans; $f+=2) { - if ($f+1<$fans) echo "FAN ".($f)." - FAN ".($f+1)."".""; - else echo "FAN ".($f).""; - } - echo ""; + + +
Power
+UPS Load:

+ +UPS status:
+Battery charge:
+Runtime left:
+Nominal power:
+ + + +0):?> + +
Airflow
Fan count:

+ +FAN ".($f)." - FAN ".($f+1)."".""; + else echo "FAN ".($f).""; }?> + + @@ -566,6 +581,16 @@ function update15() { $.post('',{cmd:'shares',com:tag,names:''},function(data) { $.each(data.split('\0'),function(k,v) {$('#share'+(k+1)).html(v);}); }); + + + $.get('/plugins/dynamix.apcupsd/include/UPSstatus.php',{all:'false'},function(d) { + var data = d.replace(/<\/?tr>/,'').replace(/ -0):?> + @@ -429,7 +430,7 @@ foreach ($users as $user) { - + @@ -560,7 +561,7 @@ function moreInfo(data,table) { return info.length ? "
"+table+" has "+info.join('. ')+".
" : ""; } function update5() { -0):?> + $.post('',{cmd:'fan'},function(data) { $.each(data.split('\0'),function(k,v) {$('#fan'+k).html(v);}); }); @@ -774,7 +775,7 @@ $(function() { toggleView('cpu_view',true); toggleView('mem_view',true); toggleView('port_view',true); -0):?> + toggleView('fan_view',true); @@ -788,7 +789,9 @@ $(function() { toggleView('parity_view',true); toggleView('array_view',true); + toggleView('cache_view',true); + toggleView('extra_view',true); From 5e37aab3da24bed8562d0ccd0fc09f7ead1a066b Mon Sep 17 00:00:00 2001 From: bergware Date: Sat, 19 Jan 2019 11:56:24 +0100 Subject: [PATCH 3/6] Dashboard: textual adjustment --- plugins/dynamix/DashStats.page | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/dynamix/DashStats.page b/plugins/dynamix/DashStats.page index b4786f81b..a85b1ff29 100644 --- a/plugins/dynamix/DashStats.page +++ b/plugins/dynamix/DashStats.page @@ -423,7 +423,7 @@ foreach ($users as $user) { - @@ -431,7 +431,7 @@ foreach ($users as $user) { - From 3ae444326608a1dced449e2a764a664eb0d7ba3f Mon Sep 17 00:00:00 2001 From: bergware Date: Sat, 19 Jan 2019 12:05:45 +0100 Subject: [PATCH 4/6] Dashboard: textual enhancements --- plugins/dynamix/DashStats.page | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/dynamix/DashStats.page b/plugins/dynamix/DashStats.page index a85b1ff29..2de3f1619 100644 --- a/plugins/dynamix/DashStats.page +++ b/plugins/dynamix/DashStats.page @@ -98,11 +98,11 @@ $mycase = file_exists("$boot/$myfile") ? file_get_contents("$boot/$myfile") : fa $board = dmidecode('Base Board Information','2',0); $serial = "s/n: {$board['Serial Number']}"; -$board = "{$board['Manufacturer']} {$board['Product Name']} - v{$board['Version']}"; +$board = "{$board['Manufacturer']} {$board['Product Name']}".($board['Version'] ? ", Version {$board['Version']}" : ""); $bios = dmidecode('BIOS Information','0',0); $biosdate = "BIOS dated: ".my_time(strtotime($bios['Release Date']),$display['date']); -$bios = "{$bios['Vendor']} - v{$bios['Version']}"; +$bios = $bios['Vendor'].($bios['Version'] ? ", Version {$bios['Version']}" : ""); $cpu = dmidecode('Processor Information','4',0); $cpumodel = str_ireplace(["Processor","(C)","(R)","(TM)"],["","©","®","™"],$cpu['Version']); From eb399bc04bd4c60ee92b51b93ea5293081d5d503 Mon Sep 17 00:00:00 2001 From: bergware Date: Sat, 19 Jan 2019 12:47:00 +0100 Subject: [PATCH 5/6] Dashboard: fix "back-to-top" arrow --- plugins/dynamix/DashStats.page | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/dynamix/DashStats.page b/plugins/dynamix/DashStats.page index 2de3f1619..464ed0231 100644 --- a/plugins/dynamix/DashStats.page +++ b/plugins/dynamix/DashStats.page @@ -156,7 +156,7 @@ span.ups{width:124px;display:inline-block} -
+
/g,'span>;').split(';'); + $('#ups_status').html(data[0]); + $('#ups_bcharge').html(data[1]); + $('#ups_timeleft').html(data[2]); + $('#ups_nompower').html(data[3]); + $('#ups_loadpct').html(data[5]+(data[5].search('-')==-1 ? '%':'')+(data[4].search('-')==-1 ? ' ('+data[4].replace(' Watts','W')+')':'')); + }); $.post('',{cmd:'status',number:''},function(data) {$('span.info.title').html(data);}); $.post('',{cmd:'parity',time:''},function(d) { @@ -752,6 +777,9 @@ $(function() { 0):?> toggleView('fan_view',true); + + toggleView('ups_view',true); + toggleView('docker_view',true); From 42de67f84b5391afbf119127b3d971e35029bc79 Mon Sep 17 00:00:00 2001 From: bergware Date: Sat, 19 Jan 2019 11:47:03 +0100 Subject: [PATCH 2/6] Dashboard: hide Cache devices if not present --- plugins/dynamix/DashStats.page | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/plugins/dynamix/DashStats.page b/plugins/dynamix/DashStats.page index a364490a7..b4786f81b 100644 --- a/plugins/dynamix/DashStats.page +++ b/plugins/dynamix/DashStats.page @@ -45,6 +45,7 @@ $dockerd = pgrep('dockerd'); $libvirtd = pgrep('libvirtd'); $apcupsd = file_exists('/var/run/apcupsd.pid'); $started = $var['fsState']=='Started'; +$cache_pool = $var['cacheSbNumDisks']; $array_size = $array_used = 0; $cache_size = $cache_used = 0; $extra_size = $extra_used = 0; @@ -255,7 +256,7 @@ foreach ($ports as $port) {
Airflow
Fan count:

Cache (not started) used of ( %)
Array (not started) +
Array (stopped) used of ( %)
Cache (not started) +
Cache (stopped) used of ( %)
From 1216d63cf95fa7bdb324400985d94fde22615442 Mon Sep 17 00:00:00 2001 From: bergware Date: Sat, 19 Jan 2019 15:28:56 +0100 Subject: [PATCH 6/6] Dashboard: keep "back-to-top" always visible --- plugins/dynamix/include/DefaultPageLayout.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/dynamix/include/DefaultPageLayout.php b/plugins/dynamix/include/DefaultPageLayout.php index a5d103297..77e5bc8cd 100644 --- a/plugins/dynamix/include/DefaultPageLayout.php +++ b/plugins/dynamix/include/DefaultPageLayout.php @@ -55,7 +55,7 @@ html{font-size:} .inline_help{display:none} .upgrade_notice{position:fixed;top:1px;left:0;width:100%;height:40px;line-height:40px;color:#e68a00;background:#feefb3;border-bottom:#e68a00 1px solid;text-align:center;font-size:1.4rem;z-index:999} .upgrade_notice i{margin:14px;float:right;cursor:pointer} -.back_to_top{display:none;position:fixed;bottom:30px;right:12px;color:#e22828;font-size:2.5rem} +.back_to_top{display:none;position:fixed;bottom:30px;right:12px;color:#e22828;font-size:2.5rem;z-index:999}