From 7088aacc5cba0024c26f8df978f8e639de121712 Mon Sep 17 00:00:00 2001 From: bergware Date: Fri, 14 May 2021 21:39:21 +0200 Subject: [PATCH 1/9] Dashboard: cpu bar in header section --- plugins/dynamix/DashStats.page | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/plugins/dynamix/DashStats.page b/plugins/dynamix/DashStats.page index 593cf4d22..acd1c58ee 100644 --- a/plugins/dynamix/DashStats.page +++ b/plugins/dynamix/DashStats.page @@ -166,7 +166,7 @@ span.ups{width:200px;display:inline-block} span.tx{width:75px;display:inline-block} span.busy,i.inactive{opacity:0.5} span#inbound{width:75px;display:inline-block} -span#load{width:120px;display:inline-block} +span#load{width:170px;display:inline-block} span#util{margin-left:20px} span[id^=cpu],span[id^=sys]{width:0} i.heat{margin-left:8px} @@ -247,17 +247,16 @@ form[name=boot]{display:none}
_(Processor)_
-_(Load)_: 0%

+_(Load)_:0%
+


_(Show details)_ -_(Overall Load)_: -0%
"; if ($cpu2) echo "CPU $cpu1 - HT $cpu20%
0%
"; From 5c022ef821741ed29347db5ea457e24a18c555fc Mon Sep 17 00:00:00 2001 From: bergware Date: Fri, 14 May 2021 21:45:08 +0200 Subject: [PATCH 2/9] Plugin: disable version select when reboot is required --- plugins/dynamix.plugin.manager/Update.page | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/dynamix.plugin.manager/Update.page b/plugins/dynamix.plugin.manager/Update.page index abc2cc1c5..eb5b33978 100644 --- a/plugins/dynamix.plugin.manager/Update.page +++ b/plugins/dynamix.plugin.manager/Update.page @@ -89,6 +89,7 @@ function loadlist(id,check) { case 'return' : updateInfo(data); break; case 'install': list.find(tr).remove(); list.append(warning(data)); break; } + $('#change_branch').prop('disabled',true); } else { updateInfo(data); From 1becbebb6e071f8e6e2e2894c648d7146a82dcd2 Mon Sep 17 00:00:00 2001 From: bergware Date: Fri, 14 May 2021 21:59:28 +0200 Subject: [PATCH 3/9] Revert "Dashboard: cpu bar in header section" This reverts commit 7088aacc5cba0024c26f8df978f8e639de121712. --- plugins/dynamix/DashStats.page | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/plugins/dynamix/DashStats.page b/plugins/dynamix/DashStats.page index acd1c58ee..593cf4d22 100644 --- a/plugins/dynamix/DashStats.page +++ b/plugins/dynamix/DashStats.page @@ -166,7 +166,7 @@ span.ups{width:200px;display:inline-block} span.tx{width:75px;display:inline-block} span.busy,i.inactive{opacity:0.5} span#inbound{width:75px;display:inline-block} -span#load{width:170px;display:inline-block} +span#load{width:120px;display:inline-block} span#util{margin-left:20px} span[id^=cpu],span[id^=sys]{width:0} i.heat{margin-left:8px} @@ -247,16 +247,17 @@ form[name=boot]{display:none}
_(Processor)_
-_(Load)_:0%
-

+_(Load)_: 0%


_(Show details)_ +_(Overall Load)_: +0%
"; if ($cpu2) echo "CPU $cpu1 - HT $cpu20%
0%
"; From 6dcfc2950b3f32270afd76c96bf414b20432abea Mon Sep 17 00:00:00 2001 From: bergware Date: Sat, 15 May 2021 07:47:06 +0200 Subject: [PATCH 4/9] Bug fixes --- plugins/dynamix/DashStats.page | 3 ++- plugins/dynamix/nchan/update_2 | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/plugins/dynamix/DashStats.page b/plugins/dynamix/DashStats.page index 593cf4d22..d7170dc8d 100644 --- a/plugins/dynamix/DashStats.page +++ b/plugins/dynamix/DashStats.page @@ -704,7 +704,8 @@ function identity(page,disk) { location.replace('/Dashboard/'+page+'?name='+disk); } function acknowledge(disk) { - $.post('/webGui/include/Acknowledge.php',{disk:disk}); + update2.stop(); + $.post('/webGui/include/Acknowledge.php',{disk:disk},function(){update2.start();}); } function dropdown(menu) { var select = 'select[name="'+menu+'"]'; diff --git a/plugins/dynamix/nchan/update_2 b/plugins/dynamix/nchan/update_2 index c7f238bae..335ca92a0 100755 --- a/plugins/dynamix/nchan/update_2 +++ b/plugins/dynamix/nchan/update_2 @@ -182,7 +182,7 @@ function device_smart(&$disk, &$fail, &$smart) { $color = 'green'; $file = "state/smart/$name"; if (file_exists("$file") && exec("grep -Pom1 '^SMART.*: \K[A-Z]+' ".escapeshellarg($file)." |tr -d '\n' 2>/dev/null", $ssa) && in_array("$ssa",$failed)) { - $title = "S.M.A.R.T health-check failed\n"; $thumb = 'thumbs-o-down'; $color = 'red'; $text = 'fail'; $fail++; + $title = _('SMART health-check failed')."\n"; $thumb = 'thumbs-o-down'; $color = 'red'; $text = 'fail'; $fail++; } else { if (empty($saved["smart"]["$name.ack"])) { exec("awk 'NR>7{print $1,$2,$4,$6,$9,$10}' ".escapeshellarg($file)." 2>/dev/null", $codes); From e27e70d968aee22ccdab289e9855cf1d3f3f313f Mon Sep 17 00:00:00 2001 From: bergware Date: Sat, 15 May 2021 08:35:49 +0200 Subject: [PATCH 5/9] Revert "Bug fixes" This reverts commit 6dcfc2950b3f32270afd76c96bf414b20432abea. --- plugins/dynamix/DashStats.page | 3 +-- plugins/dynamix/nchan/update_2 | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/plugins/dynamix/DashStats.page b/plugins/dynamix/DashStats.page index d7170dc8d..593cf4d22 100644 --- a/plugins/dynamix/DashStats.page +++ b/plugins/dynamix/DashStats.page @@ -704,8 +704,7 @@ function identity(page,disk) { location.replace('/Dashboard/'+page+'?name='+disk); } function acknowledge(disk) { - update2.stop(); - $.post('/webGui/include/Acknowledge.php',{disk:disk},function(){update2.start();}); + $.post('/webGui/include/Acknowledge.php',{disk:disk}); } function dropdown(menu) { var select = 'select[name="'+menu+'"]'; diff --git a/plugins/dynamix/nchan/update_2 b/plugins/dynamix/nchan/update_2 index 335ca92a0..c7f238bae 100755 --- a/plugins/dynamix/nchan/update_2 +++ b/plugins/dynamix/nchan/update_2 @@ -182,7 +182,7 @@ function device_smart(&$disk, &$fail, &$smart) { $color = 'green'; $file = "state/smart/$name"; if (file_exists("$file") && exec("grep -Pom1 '^SMART.*: \K[A-Z]+' ".escapeshellarg($file)." |tr -d '\n' 2>/dev/null", $ssa) && in_array("$ssa",$failed)) { - $title = _('SMART health-check failed')."\n"; $thumb = 'thumbs-o-down'; $color = 'red'; $text = 'fail'; $fail++; + $title = "S.M.A.R.T health-check failed\n"; $thumb = 'thumbs-o-down'; $color = 'red'; $text = 'fail'; $fail++; } else { if (empty($saved["smart"]["$name.ack"])) { exec("awk 'NR>7{print $1,$2,$4,$6,$9,$10}' ".escapeshellarg($file)." 2>/dev/null", $codes); From ef3d8dbad61e918ad1a6bb00dbe6a4f234fd3d1a Mon Sep 17 00:00:00 2001 From: bergware Date: Sat, 15 May 2021 09:44:44 +0200 Subject: [PATCH 6/9] Bug fixes --- plugins/dynamix/DashStats.page | 6 +++--- plugins/dynamix/nchan/update_2 | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/plugins/dynamix/DashStats.page b/plugins/dynamix/DashStats.page index 593cf4d22..2cd6cd12a 100644 --- a/plugins/dynamix/DashStats.page +++ b/plugins/dynamix/DashStats.page @@ -663,7 +663,7 @@ function smartMenu(table) { opts.push({text:"_(Identity)_",icon:'fa-home',action:function(e){e.preventDefault();identity(page,disk);}}); if (view.search('green-text') == -1) { opts.push({divider:true}); - opts.push({text:"_(Acknowledge)_",icon:'fa-check-square-o',action:function(e){e.preventDefault();acknowledge(disk);}}); + opts.push({text:"_(Acknowledge)_",icon:'fa-check-square-o',action:function(e){e.preventDefault();acknowledge(id,disk);}}); } $(id).bind('click',function(){update2.stop();}).bind('mouseout',function(){setTimeout(function(){update2.start();},15000);}); context.attach(id,opts); @@ -703,8 +703,8 @@ function identity(page,disk) { $.cookie('one',tab,{path:'/'}); location.replace('/Dashboard/'+page+'?name='+disk); } -function acknowledge(disk) { - $.post('/webGui/include/Acknowledge.php',{disk:disk}); +function acknowledge(id,disk) { + $.post('/webGui/include/Acknowledge.php',{disk:disk},function(){$(id).removeClass('fa-thumbs-o-down orange-text').addClass('fa-thumbs-o-up green-text');$(id.replace('smart','text')).text("");}); } function dropdown(menu) { var select = 'select[name="'+menu+'"]'; diff --git a/plugins/dynamix/nchan/update_2 b/plugins/dynamix/nchan/update_2 index c7f238bae..35418db23 100755 --- a/plugins/dynamix/nchan/update_2 +++ b/plugins/dynamix/nchan/update_2 @@ -182,7 +182,7 @@ function device_smart(&$disk, &$fail, &$smart) { $color = 'green'; $file = "state/smart/$name"; if (file_exists("$file") && exec("grep -Pom1 '^SMART.*: \K[A-Z]+' ".escapeshellarg($file)." |tr -d '\n' 2>/dev/null", $ssa) && in_array("$ssa",$failed)) { - $title = "S.M.A.R.T health-check failed\n"; $thumb = 'thumbs-o-down'; $color = 'red'; $text = 'fail'; $fail++; + $title = _('SMART health-check failed')."\n"; $thumb = 'thumbs-o-down'; $color = 'red'; $text = 'fail'; $fail++; } else { if (empty($saved["smart"]["$name.ack"])) { exec("awk 'NR>7{print $1,$2,$4,$6,$9,$10}' ".escapeshellarg($file)." 2>/dev/null", $codes); @@ -197,7 +197,7 @@ function device_smart(&$disk, &$fail, &$smart) { } } $title .= _('Click for context menu'); - return "$text"; + return "$text"; } function device_usage(&$disk, &$full, &$high) { global $display; From 51e840f0c8c8cab6eb4de9f5c5c3ca4b91ca562d Mon Sep 17 00:00:00 2001 From: bergware Date: Sat, 15 May 2021 14:40:27 +0200 Subject: [PATCH 7/9] Improve responsiveness --- plugins/dynamix/nchan/device_list | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/dynamix/nchan/device_list b/plugins/dynamix/nchan/device_list index d4e564e47..0f8b557e8 100755 --- a/plugins/dynamix/nchan/device_list +++ b/plugins/dynamix/nchan/device_list @@ -462,6 +462,6 @@ while (true) { } publish('devices', implode("\0",$echo)); - sleep(1); + usleep(250000); } ?> From 5c4e80021bc9b74c92edb60d6462954fb73f26b0 Mon Sep 17 00:00:00 2001 From: bergware Date: Sat, 15 May 2021 14:44:36 +0200 Subject: [PATCH 8/9] Improve responsiveness --- plugins/dynamix/nchan/disk_load | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/dynamix/nchan/disk_load b/plugins/dynamix/nchan/disk_load index e5c73a690..e50d157be 100755 --- a/plugins/dynamix/nchan/disk_load +++ b/plugins/dynamix/nchan/disk_load @@ -4,7 +4,7 @@ init=0 declare -a reads writes # t = poll interval in seconds -t=3 +t=2 while :; do stats=($(awk '/(sd[a-z]*|nvme[0-9]n1|vd[a-z]) /{print $3,$6,$10,$4,$8}' /proc/diskstats)) c=0; s=${#stats[@]} From a9104e521d283fd8a206b072007643ea941f705c Mon Sep 17 00:00:00 2001 From: bergware Date: Sat, 15 May 2021 14:51:43 +0200 Subject: [PATCH 9/9] Improve responsiveness --- plugins/dynamix/nchan/update_3 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/dynamix/nchan/update_3 b/plugins/dynamix/nchan/update_3 index dfe036e8a..8f484df4c 100755 --- a/plugins/dynamix/nchan/update_3 +++ b/plugins/dynamix/nchan/update_3 @@ -84,6 +84,6 @@ while (true) { $stat = implode("\0",$stat); publish('update3',"$echo\1$mode\1$rxtx\1$stat"); - sleep(3); + sleep(2); $time = microtime(true); }