diff options
author | Simon Rettberg | 2022-10-27 16:16:36 +0200 |
---|---|---|
committer | Simon Rettberg | 2022-10-27 16:16:36 +0200 |
commit | 6e183c043091cf4a6c261b57fbfd9595cf76e93e (patch) | |
tree | bdd60e215324fbbbad3c64d2a9b889ec39f219f6 /modules-available/statistics/inc | |
parent | [statistics] Don't wrap partition name column in machine view (diff) | |
download | slx-admin-6e183c043091cf4a6c261b57fbfd9595cf76e93e.tar.gz slx-admin-6e183c043091cf4a6c261b57fbfd9595cf76e93e.tar.xz slx-admin-6e183c043091cf4a6c261b57fbfd9595cf76e93e.zip |
[statistics] Add machine state icon to hints tables
Diffstat (limited to 'modules-available/statistics/inc')
-rw-r--r-- | modules-available/statistics/inc/statisticsstyling.inc.php | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/modules-available/statistics/inc/statisticsstyling.inc.php b/modules-available/statistics/inc/statisticsstyling.inc.php index 9d0bb8cc..1843fe30 100644 --- a/modules-available/statistics/inc/statisticsstyling.inc.php +++ b/modules-available/statistics/inc/statisticsstyling.inc.php @@ -39,4 +39,24 @@ class StatisticsStyling return ''; } + /** + * Take a machine state enum value, return a matching glyphicon class. + * @param string $state State value (OFFLINE, IDLE, ...) + */ + public static function machineStateToIcon(string $state): string + { + switch ($state) { + case 'OFFLINE': + return 'glyphicon-off'; + case 'IDLE': + return 'glyphicon-ok green'; + case 'OCCUPIED': + return 'glyphicon-user red'; + case 'STANDBY': + return 'glyphicon-off green'; + default: + return 'glyphicon-question-sign'; + } + } + }
\ No newline at end of file |