summaryrefslogtreecommitdiffstats
path: root/frontends/php/map.php
diff options
context:
space:
mode:
authorhugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2004-01-04 10:13:41 +0000
committerhugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2004-01-04 10:13:41 +0000
commit2a4c603bb433fc21d4deaa87d1c0b41cc55a1bea (patch)
treef09277f20f2f31e37ab0833770f27aa510a78cc7 /frontends/php/map.php
parent5d64930fe2b5ca25c3a7b4ad2182b9cb28a6dad3 (diff)
downloadzabbix-2a4c603bb433fc21d4deaa87d1c0b41cc55a1bea.tar.gz
zabbix-2a4c603bb433fc21d4deaa87d1c0b41cc55a1bea.tar.xz
zabbix-2a4c603bb433fc21d4deaa87d1c0b41cc55a1bea.zip
More support for different connector types/colors.
git-svn-id: svn://svn.zabbix.com/trunk@1130 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/map.php')
-rw-r--r--frontends/php/map.php44
1 files changed, 38 insertions, 6 deletions
diff --git a/frontends/php/map.php b/frontends/php/map.php
index e811201d..698f5f89 100644
--- a/frontends/php/map.php
+++ b/frontends/php/map.php
@@ -54,6 +54,19 @@
$black=ImageColorAllocate($im,0,0,0);
$gray=ImageColorAllocate($im,150,150,150);
+ $colors["Red"]=ImageColorAllocate($im,255,0,0);
+ $colors["Dark Red"]=ImageColorAllocate($im,150,0,0);
+ $colors["Green"]=ImageColorAllocate($im,0,255,0);
+ $colors["Dark Green"]=ImageColorAllocate($im,0,150,0);
+ $colors["Blue"]=ImageColorAllocate($im,0,0,255);
+ $colors["Dark Blue"]=ImageColorAllocate($im,0,0,150);
+ $colors["Yellow"]=ImageColorAllocate($im,255,255,0);
+ $colors["Dark Yellow"]=ImageColorAllocate($im,150,150,0);
+ $colors["Cyan"]=ImageColorAllocate($im,0,255,255);
+ $colors["Black"]=ImageColorAllocate($im,0,0,0);
+ $colors["Gray"]=ImageColorAllocate($im,150,150,150);
+ $colors["White"]=ImageColorAllocate($im,255,255,255);
+
$x=imagesx($im);
$y=imagesy($im);
@@ -62,11 +75,11 @@
if(!isset($HTTP_GET_VARS["border"]))
{
- ImageRectangle($im,0,0,$width-1,$height-1,$black);
+ ImageRectangle($im,0,0,$width-1,$height-1,$colors["Black"]);
}
$x=imagesx($im)/2-ImageFontWidth(4)*strlen($name)/2;
- ImageString($im, 4,$x,1, $name , $darkred);
+ ImageString($im, 4,$x,1, $name , $colors["Dark Red"]);
$str=date("m.d.Y H:i:s",time(NULL));
ImageString($im, 0,imagesx($im)-120,imagesy($im)-12,"$str", $gray);
@@ -96,12 +109,16 @@
# Draw connectors
- $result=DBselect("select shostid1,shostid2,triggerid from sysmaps_links where sysmapid=".$HTTP_GET_VARS["sysmapid"]);
+ $result=DBselect("select shostid1,shostid2,triggerid,color_off,drawtype_off,color_on,drawtype_on from sysmaps_links where sysmapid=".$HTTP_GET_VARS["sysmapid"]);
for($i=0;$i<DBnum_rows($result);$i++)
{
$shostid1=DBget_field($result,$i,0);
$shostid2=DBget_field($result,$i,1);
$triggerid=DBget_field($result,$i,2);
+ $color_off=DBget_field($result,$i,3);
+ $drawtype_off=DBget_field($result,$i,4);
+ $color_on=DBget_field($result,$i,5);
+ $drawtype_on=DBget_field($result,$i,6);
$result1=DBselect("select x,y from sysmaps_hosts where shostid=$shostid1");
$x1=DBget_field($result1,0,0);
@@ -116,16 +133,31 @@
$trigger=get_trigger_by_triggerid($triggerid);
if($trigger["value"] == TRIGGER_VALUE_TRUE)
{
- ImageLine($im,$x1+16,$y1+16,$x2+16,$y2+16,$red);
+ if($drawtype_on == GRAPH_DRAW_TYPE_BOLDLINE)
+ {
+ ImageLine($im,$x1+16,$y1+16,$x2+16,$y2+16,$colors[$color_on]);
+ ImageLine($im,$x1+16,$y1+16+1,$x2+16,$y2+16+1,$colors[$color_on]);
+ }
+ else
+ {
+ ImageLine($im,$x1+16,$y1+16,$x2+16,$y2+16,$colors[$color_on]);
+ }
}
else
{
- ImageLine($im,$x1+16,$y1+16,$x2+16,$y2+16,$black);
+ if($drawtype_off == GRAPH_DRAW_TYPE_BOLDLINE)
+ {
+ ImageLine($im,$x1+16,$y1+16,$x2+16,$y2+16,$colors[$color_off]);
+ }
+ else
+ {
+ ImageLine($im,$x1+16,$y1+16+1,$x2+16,$y2+16+1,$colors[$color_off]);
+ }
}
}
else
{
- ImageLine($im,$x1+16,$y1+16,$x2+16,$y2+16,$black);
+ ImageLine($im,$x1+16,$y1+16,$x2+16,$y2+16,$colors["Black"]);
}
}