From 7d7486438d1cf560d88b756742a15b789533bef8 Mon Sep 17 00:00:00 2001 From: bergware Date: Wed, 19 May 2021 08:14:27 +0200 Subject: [PATCH] Dashboard updates using Nchan --- plugins/dynamix/DashStats.page | 2 +- plugins/dynamix/scripts/netconfig | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/plugins/dynamix/DashStats.page b/plugins/dynamix/DashStats.page index 54e9438db..60444bce2 100644 --- a/plugins/dynamix/DashStats.page +++ b/plugins/dynamix/DashStats.page @@ -786,7 +786,7 @@ function moreInfo(data,table) { if (data[2]>0) info.push(data[2]+" _(heat warning)_"+(data[2]==1?'':'s')); if (data[3]>0) info.push(data[3]+" _(SMART error)_"+(data[3]==1?'':'s')); if (data[4]>0) info.push(data[4]+" _(utilization warning)_"+(data[4]==1?'':'s')); - return info.length ? "
"+table+" _(has)_ "+info.join('. ')+".
" :""; + return info.length ? "
"+table+" _(has)_ "+info.join('. ')+".
" : ""; } function autoscale(value,text,size,kilo) { if (kilo==null) kilo = 1000; diff --git a/plugins/dynamix/scripts/netconfig b/plugins/dynamix/scripts/netconfig index a6b28f300..c5bca2c4d 100755 --- a/plugins/dynamix/scripts/netconfig +++ b/plugins/dynamix/scripts/netconfig @@ -115,7 +115,8 @@ if ($run) { exec("/usr/local/sbin/create_network_ini >/dev/null"); // restart dashboard Nchan port monitoring exec('pkill update_3'); - file_put_contents('/tmp/nchan',implode(',',array_filter(explode(',',file_get_contents('/tmp/nchan')),function($n){return $n!='update_3';}))); + $nchan = '/tmp/nchan'; + if (file_exists($nchan)) file_put_contents($nchan,implode(',',array_filter(explode(',',file_get_contents($nchan)),function($n){return $n!='update_3';}))); } exit(0); ?>