diff --git a/emhttp/plugins/dynamix/include/DefaultPageLayout.php b/emhttp/plugins/dynamix/include/DefaultPageLayout.php index 27e0151e1..09781b99f 100644 --- a/emhttp/plugins/dynamix/include/DefaultPageLayout.php +++ b/emhttp/plugins/dynamix/include/DefaultPageLayout.php @@ -861,25 +861,52 @@ unset($pages,$page,$pgs,$pg,$icon,$nchan,$running,$start,$stop,$row,$script,$opt '; -$progress = (_var($var,'fsProgress')!='') ? "•{$var['fsProgress']}" : ""; -switch (_var($var,'fsState')) { -case 'Stopped': - echo " ",_('Array Stopped'),"$progress"; break; -case 'Starting': - echo " ",_('Array Starting'),"$progress"; break; -case 'Stopping': - echo " ",_('Array Stopping'),"$progress"; break; -default: - echo " ",_('Array Started'),"$progress"; break; + +function getArrayStatus($var) { + $progress = (_var($var,'fsProgress')!='') ? "•{$var['fsProgress']}" : ""; + + $statusMap = [ + 'Stopped' => ['class' => 'red', 'icon' => 'stop-circle', 'text' => _('Array Stopped')], + 'Starting' => ['class' => 'orange', 'icon' => 'pause-circle', 'text' => _('Array Starting')], + 'Stopping' => ['class' => 'orange', 'icon' => 'pause-circle', 'text' => _('Array Stopping')], + 'default' => ['class' => 'green', 'icon' => 'play-circle', 'text' => _('Array Started')] + ]; + + $state = _var($var,'fsState'); + $status = $statusMap[$state] ?? $statusMap['default']; + + return sprintf( + " %s%s", + $status['class'], + $status['icon'], + $status['text'], + $progress + ); } -echo ""; -if ($wlan0) echo ""; -echo "Unraid® webGui ©2024, Lime Technology, Inc."; -echo " "._('manual').""; -echo ""; -echo ""; + ?> + +