Show
Ignore:
Timestamp:
06/24/08 14:20:34 (6 years ago)
Author:
Theo Schlossnagle <jesus@omniti.com>
git-committer:
Theo Schlossnagle <jesus@omniti.com> 1214317234 +0000
git-parent:

[cdec30d496e979d90c58ae58a967db6da2a2b503]

git-author:
Theo Schlossnagle <jesus@omniti.com> 1214317234 +0000
Message:

fix autounits

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • ui/web/htdocs/generic_settings.php

    re7e6b89 r42acb3f  
    1818 
    1919$i = 0; 
     20$autounits = 0; 
    2021foreach(split(";", $_GET['metric']) as $m) { 
    2122  preg_match('/^(d|n|t)(l|r)(~|-)([0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12})-(.*)$/', $m, 
    2223             $matches); 
    2324  $settings = $graph_settings[$i++]; 
    24   if($matches[3] == '~') $settings['expression'] = '$this->bw($value)'; 
     25  if($matches[3] == '~') { 
     26    $autounits = 1; 
     27    $settings['expression'] = '$this->autounits($value)'; 
     28  } 
    2529  $settings['axis'] = ($matches[2] == 'l') ? 'left' : 'right'; 
    2630  if($matches[1] == 'n') 
     
    4751  <min><?php print ($driver->min() > 0) ? '0' : '' ?></min> 
    4852  <max><?php print ($driver->max() < 0) ? '0' : '' ?></max> 
     53  <unit><?php print $autounits ? $driver->autounit() : "" ?></unit> 
    4954 </y_left> 
    5055</values>