mirror of
https://github.com/unraid/webgui.git
synced 2026-01-07 01:59:52 -06:00
Dashboard: fix stream counters
This commit is contained in:
@@ -454,7 +454,7 @@ if (_var($var,'shareSMBEnabled')=='yes') {
|
||||
$comment = $share['comment'] ?: ' ';
|
||||
$security = export_settings(_var($var,'shareSMBEnabled'), $sec[$name]);
|
||||
$last = $name==array_key_last($shares) ? ' last' : '';
|
||||
echo "<tr class='smb share share1{$last}'><td><span class='w26'><i class='icon-folder f14'></i>$list</span><span class='w44'>$comment</span><span class='w18'>$security</span><span id='share".$i++."'>0</span></td></tr>";
|
||||
echo "<tr class='smb share share1{$last}'><td><span class='w26'><i class='icon-folder f14'></i>$list</span><span class='w44'>$comment</span><span class='w18'>$security</span><span id='share",$i++,"'>0</span></td></tr>";
|
||||
}
|
||||
if (!count($shares)) echo "<tr class='smb share share1'><td class='none'>"._("No shares present")."</td></tr>";
|
||||
}
|
||||
|
||||
@@ -92,7 +92,7 @@ while (true) {
|
||||
// add fans information
|
||||
if (count($fans)) $echo['fan'] = array_map(function($fan){return "$fan RPM";},$fans);
|
||||
// add streams information
|
||||
exec("LANG='en_US.UTF8' lsof -Owl /mnt/disk[0-9]* 2>/dev/null|awk -F/ '/^shfs/{print \$4}'",$lsof);
|
||||
exec("LANG='en_US.UTF8' lsof -Fn /mnt/disk[0-9]* 2>/dev/null|awk -F/ '(NR>1){print \$4}'",$lsof);
|
||||
$share = array_keys(parse_ini_file("$varroot/shares.ini",true));
|
||||
$count = array_count_values($lsof);
|
||||
foreach ($share as $name) $echo['stream'][] = $count[$name]??0;
|
||||
|
||||
Reference in New Issue
Block a user