From ad36fb57ccd6b3be745efa6da35e7621d6cb26b2 Mon Sep 17 00:00:00 2001 From: bergware Date: Sun, 12 Jul 2020 08:48:52 +0200 Subject: [PATCH] Dashboard: fix stats of missing interface --- plugins/dynamix/DashStats.page | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/plugins/dynamix/DashStats.page b/plugins/dynamix/DashStats.page index 000793845..7faa84adc 100644 --- a/plugins/dynamix/DashStats.page +++ b/plugins/dynamix/DashStats.page @@ -124,7 +124,7 @@ $cpumodel = str_ireplace(["Processor","(C)","(R)","(TM)"],["","©","®", $cpumodel .= (strpos($cpumodel,'@')!==false ? "" : " @ {$cpu['Current Speed']}"); $total = exec("awk '/^MemTotal/{print $2*1024}' /proc/meminfo"); -exec("ls /sys/class/net|grep -Po '^(lo|(bond|eth)\d+)$'",$ports); +unset($ports); exec("ls /sys/class/net|grep -Po '^(lo|(bond|eth)\d+)$'",$ports); $sizes = ['MB','GB','TB']; $memory_type = $ecc = ''; @@ -559,7 +559,10 @@ var timer30 = null; var orange = 70; var red = 90; var timestamp = 0, rx_bytes = 0, tx_bytes = 0; -var port_select = $.cookie('port_select')||''; +var ports = []; + +if ($.cookie('port_select')!=null && !ports.includes($.cookie('port_select'))) $.removeCookie('port_select'); +var port_select = $.cookie('port_select')||ports[0]; Number.prototype.pad = function(size){var s=String(this);while(s.length<(size||2)){s='0'+s;}return s;} @@ -758,7 +761,7 @@ function update15() { } function update30() { var tag = $.cookie('enter_view')==0 ? 'main' : $.cookie('enter_view')==1 ? 'port' : $.cookie('enter_view')==2 ? 'link' : 'main'; - $.post('',{cmd:'port',view:tag,ports:''},function(data) { + $.post('',{cmd:'port',view:tag,ports:ports.join(',')},function(data) { $.each(data.split('\0'),function(k,v) {$('#'+tag+k).html(v);}); }); $.post('',{cmd:'array',path:'',hot:'',max:'',unit:'',text:,critical:'',warning:''},function(d) {