diff options
| author | Pim van den Berg | 2012-08-10 18:56:30 +0200 |
|---|---|---|
| committer | Pim van den Berg | 2012-08-10 19:00:16 +0200 |
| commit | fd04134830d3111c137b47c7ba25a049ab597715 (patch) | |
| tree | c2390f06640f2127ab3e987cd3bdaf1d639b3dc2 /plugin/df.php | |
| parent | type: add scale support to default/generic stacked types (diff) | |
| download | apt-panopticon_cgp-fd04134830d3111c137b47c7ba25a049ab597715.zip apt-panopticon_cgp-fd04134830d3111c137b47c7ba25a049ab597715.tar.gz apt-panopticon_cgp-fd04134830d3111c137b47c7ba25a049ab597715.tar.bz2 apt-panopticon_cgp-fd04134830d3111c137b47c7ba25a049ab597715.tar.xz | |
introduce config option datasize to show graphs in bits or bytes
Config setting $CONFIG['datasize'] can be set to bits or bytes to show graph
data in bits or bytes.
Inspired-by: Neptune Ning (Plan) <frostyplanet@gmail.com>
Diffstat (limited to 'plugin/df.php')
| -rw-r--r-- | plugin/df.php | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/plugin/df.php b/plugin/df.php index b5c7e73..33dded9 100644 --- a/plugin/df.php +++ b/plugin/df.php | |||
| @@ -29,8 +29,9 @@ $obj->width = $width; | |||
| 29 | $obj->heigth = $heigth; | 29 | $obj->heigth = $heigth; |
| 30 | 30 | ||
| 31 | $obj->rrd_title = sprintf('Free space (%s)', $obj->args['pinstance']); | 31 | $obj->rrd_title = sprintf('Free space (%s)', $obj->args['pinstance']); |
| 32 | $obj->rrd_vertical = 'Bytes'; | 32 | $obj->rrd_vertical = ucfirst($CONFIG['datasize']); |
| 33 | $obj->rrd_format = '%5.1lf%sB'; | 33 | $obj->scale = $CONFIG['datasize'] == 'bits' ? 8 : 1; |
| 34 | $obj->rrd_format = '%5.1lf%s'; | ||
| 34 | 35 | ||
| 35 | # backwards compatibility | 36 | # backwards compatibility |
| 36 | if ($CONFIG['version'] < 5) { | 37 | if ($CONFIG['version'] < 5) { |
