diff options
author | Simon Rettberg | 2019-11-07 10:30:37 +0100 |
---|---|---|
committer | Simon Rettberg | 2019-11-07 10:30:37 +0100 |
commit | a03f1f478a5f75de79ff2348461c8e9ed9872d3f (patch) | |
tree | bc552f1456733f017ae6fda320ea80af6de76af5 /modules-available/statistics/inc/statisticsstyling.inc.php | |
parent | [translation] Get rid of up_json_encode (diff) | |
download | slx-admin-a03f1f478a5f75de79ff2348461c8e9ed9872d3f.tar.gz slx-admin-a03f1f478a5f75de79ff2348461c8e9ed9872d3f.tar.xz slx-admin-a03f1f478a5f75de79ff2348461c8e9ed9872d3f.zip |
[statistics] Modularize
Diffstat (limited to 'modules-available/statistics/inc/statisticsstyling.inc.php')
-rw-r--r-- | modules-available/statistics/inc/statisticsstyling.inc.php | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/modules-available/statistics/inc/statisticsstyling.inc.php b/modules-available/statistics/inc/statisticsstyling.inc.php new file mode 100644 index 00000000..1fd1d326 --- /dev/null +++ b/modules-available/statistics/inc/statisticsstyling.inc.php @@ -0,0 +1,42 @@ +<?php + +class StatisticsStyling +{ + + public static function ramColorClass($mb) + { + if ($mb < 1500) { + return 'danger'; + } + if ($mb < 2500) { + return 'warning'; + } + + return ''; + } + + public static function kvmColorClass($state) + { + if ($state === 'DISABLED') { + return 'danger'; + } + if ($state === 'UNKNOWN' || $state === 'UNSUPPORTED') { + return 'warning'; + } + + return ''; + } + + public static function hddColorClass($gb) + { + if ($gb < 7) { + return 'danger'; + } + if ($gb < 25) { + return 'warning'; + } + + return ''; + } + +}
\ No newline at end of file |