Code

added new progressbar to info tab
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 13 Jun 2005 11:37:55 +0000 (11:37 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 13 Jun 2005 11:37:55 +0000 (11:37 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@693 594d385d-05f5-0310-b6e9-bd551577e9d8

include/functions.inc
plugins/admin/systems/class_terminalInfo.inc
plugins/admin/systems/info.tpl

index 4fc438f06114844ecf3882cdff85f6255704af03..4571a66431733870867c0344f57368a89303e65d 100644 (file)
@@ -1737,9 +1737,7 @@ function progressbar($percentage,$width=100,$height=15,$showvalue=false)
                 background-color:#000000;
                 padding:1px;\">
 
-          <div style=\" border-style: solid;
-                        border-width: 0pt;
-                        width:".($width)."px;
+          <div style=\" width:".($width)."px;
                         background-color:#DDDDDD;
                         height:".($height)."px;\">
 
@@ -1749,7 +1747,7 @@ function progressbar($percentage,$width=100,$height=15,$showvalue=false)
 
 
     if($height >10){
-      $str.=                 "<font style=\"font-size:".($height-2)."px;color:#FF5555;align:middle;padding-left:".((int)(($width*0.7)/2))."px;\">
+      $str.=                 "<font style=\"font-size:".($height-2)."px;color:#FF5555;align:middle;padding-left:".((int)(($width*0.4)))."px;\">
                                <b>".$percentage."%</b>
                              </font>";
    }
index a13ad989d320e4ebdd2be1341b169fcbf061639c..7316c3fb06494b84a2365b69e8989ce5d1965884 100644 (file)
@@ -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");
index 002c9728b401df2d1a317c29a7279f5e3fd40a43..7deba94d2a4faa8b81e0cd7eb20d5f16f9fc7898 100644 (file)
      <td><b>{t}Up since{/t}</b></td><td>{$uptime}</td>
     </tr>
     <tr>
-     <td><b>{t}CPU load{/t}</b></td><td><img alt="" src="progress.php?x=100&amp;y=16&amp;p={$load}" align="middle"></td>
+     <td><b>{t}CPU load{/t}</b></td><td>{$load}</td>
     </tr>
     <tr>
-     <td><b>{t}Memory usage{/t}</b></td><td><img alt="" src="progress.php?x=100&amp;y=16&amp;p={$mem}" align="middle"></td>
+     <td><b>{t}Memory usage{/t}</b></td><td>{$mem}</td>
     </tr>
     <tr>
-     <td><b>{t}Swap usage{/t}</b></td><td><img alt="" src="progress.php?x=100&amp;y=16&amp;p={$swap}" align="middle"></td>
+     <td><b>{t}Swap usage{/t}</b></td><td>{$swap}</td>
     </tr>
     <tr>
      <td colspan=2>&nbsp;</td>