X-Git-Url: https://defaria.com/gitweb/?a=blobdiff_plain;ds=inline;f=clearadm%2Fplotstorage.cgi;fp=clearadm%2Fplotstorage.cgi;h=f017de6ed82fb0f027a3c960a5fcb4194a055296;hb=c8ff289be5d7e6a63d08eca398cc7be875a4978b;hp=22c20ba775ee4ef07f4a8f6692aaf426838351ae;hpb=15f4731495714d8cdcf9c64344858f139cc892a2;p=clearscm.git diff --git a/clearadm/plotstorage.cgi b/clearadm/plotstorage.cgi index 22c20ba..f017de6 100755 --- a/clearadm/plotstorage.cgi +++ b/clearadm/plotstorage.cgi @@ -40,7 +40,7 @@ $Date: 2011/01/14 16:37:04 $ : Name of the Clearcase storage pool to plot information for : Height of chart (Default: 480px - tiny: 40) : Width of chart (Default: 800px - tiny: 150) - : A GD::Color color value (Default: lblue) + : A GD::Color color value (Default: purple) : Currently one of Minute, Hour, Day or Month. Specifies how Clearadm::GetFS will scale the data returned (Default: Minute - tiny: Day) @@ -61,6 +61,7 @@ use strict; use warnings; use FindBin; +use Convert::Base64; use lib "$FindBin::Bin/lib", "$FindBin::Bin/../lib"; @@ -77,7 +78,7 @@ my %opts = Vars; my $VERSION = '$Revision: 1.13 $'; ($VERSION) = ($VERSION =~ /\$Revision: (.*) /); -$opts{color} ||= 'lblue'; +$opts{color} ||= $opts{type} eq 'vob' ? 'purple' : 'marine'; $opts{height} ||= 350; $opts{width} ||= 800; @@ -168,8 +169,12 @@ $graph->set ( my $image = $graph->plot(\@data) or croak $graph->error; -print "Content-type: image/png\n\n"; -print $image->png; +unless ($opts{generate}) { + print "Content-type: image/png\n\n"; + print $image->png; +} else { + print encode_base64 $image->png; +} # unless =pod