From 9555d5e6613a1b005c877cef95d425720a636390 Mon Sep 17 00:00:00 2001 From: hickert Date: Mon, 13 Jun 2005 11:37:55 +0000 Subject: [PATCH] added new progressbar to info tab git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@693 594d385d-05f5-0310-b6e9-bd551577e9d8 --- include/functions.inc | 6 ++---- plugins/admin/systems/class_terminalInfo.inc | 11 +++++++++-- plugins/admin/systems/info.tpl | 6 +++--- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/include/functions.inc b/include/functions.inc index 4fc438f06..4571a6643 100644 --- a/include/functions.inc +++ b/include/functions.inc @@ -1737,9 +1737,7 @@ function progressbar($percentage,$width=100,$height=15,$showvalue=false) background-color:#000000; padding:1px;\"> -
@@ -1749,7 +1747,7 @@ function progressbar($percentage,$width=100,$height=15,$showvalue=false) if($height >10){ - $str.= " + $str.= " ".$percentage."% "; } diff --git a/plugins/admin/systems/class_terminalInfo.inc b/plugins/admin/systems/class_terminalInfo.inc index a13ad989d..7316c3fb0 100644 --- a/plugins/admin/systems/class_terminalInfo.inc +++ b/plugins/admin/systems/class_terminalInfo.inc @@ -74,7 +74,13 @@ class terminfo extends plugin $display= ""; $smarty->assign("staticAddress", ""); - + + + /* Prevent undefined variable .... */ + $smarty->assign("load", progressbar(0,100,15)); + $smarty->assign("mem", progressbar(0,100,15)); + $smarty->assign("swap", progressbar(0,100,15)); + /* Check if terminal is online */ $query= "fping -q -r 1 -t 500 ".$this->cn; exec ($query, $dummy, $retval); @@ -112,7 +118,8 @@ class terminfo extends plugin /* Get system load */ $sysload= @snmpget($host, $community, "UCD-SNMP-MIB::laLoad.2"); $sysload= preg_replace('/^.*[=:] ([0-9.]+)$/', '\\1', $sysload); - $smarty->assign("load", $sysload*100); + + $smarty->assign("load", progressbar($sysload*100,100,20)); /* Get status for key processes */ $processes= @snmpwalk($host, $community, "UCD-SNMP-MIB::prNames"); diff --git a/plugins/admin/systems/info.tpl b/plugins/admin/systems/info.tpl index 002c9728b..7deba94d2 100644 --- a/plugins/admin/systems/info.tpl +++ b/plugins/admin/systems/info.tpl @@ -93,13 +93,13 @@ {t}Up since{/t}{$uptime} - {t}CPU load{/t} + {t}CPU load{/t}{$load} - {t}Memory usage{/t} + {t}Memory usage{/t}{$mem} - {t}Swap usage{/t} + {t}Swap usage{/t}{$swap}   -- 2.30.2