summaryrefslogtreecommitdiffstats
path: root/modules-available/statistics/inc/statisticsstyling.inc.php
diff options
context:
space:
mode:
authorSimon Rettberg2019-11-07 10:30:37 +0100
committerSimon Rettberg2019-11-07 10:30:37 +0100
commita03f1f478a5f75de79ff2348461c8e9ed9872d3f (patch)
treebc552f1456733f017ae6fda320ea80af6de76af5 /modules-available/statistics/inc/statisticsstyling.inc.php
parent[translation] Get rid of up_json_encode (diff)
downloadslx-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.php42
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