summaryrefslogtreecommitdiffstats
path: root/frontends/php/map.html
diff options
context:
space:
mode:
authorhugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2001-07-18 20:07:53 +0000
committerhugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2001-07-18 20:07:53 +0000
commita35c3ce4c7f950bb95908151664651d809cf611e (patch)
treedad3bf426de1027854f2be3b0b9183cf477a898a /frontends/php/map.html
parent444bb44a507825b675897a39077b22d6542bb92d (diff)
downloadzabbix-a35c3ce4c7f950bb95908151664651d809cf611e.tar.gz
zabbix-a35c3ce4c7f950bb95908151664651d809cf611e.tar.xz
zabbix-a35c3ce4c7f950bb95908151664651d809cf611e.zip
Improved performance of rendering network map
git-svn-id: svn://svn.zabbix.com/trunk@136 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/map.html')
-rw-r--r--frontends/php/map.html10
1 files changed, 8 insertions, 2 deletions
diff --git a/frontends/php/map.html b/frontends/php/map.html
index 0f6a79af..694337ed 100644
--- a/frontends/php/map.html
+++ b/frontends/php/map.html
@@ -75,6 +75,7 @@
# Draw hosts
+ $icons=array();
$result=DBselect("select h.host,sh.shostid,sh.sysmapid,sh.hostid,sh.label,sh.x,sh.y,h.status,sh.icon from sysmaps_hosts sh,hosts h where sh.sysmapid=$sysmapid and h.hostid=sh.hostid");
for($i=0;$i<DBnum_rows($result);$i++)
{
@@ -88,7 +89,12 @@
$status=DBget_field($result,$i,7);
$icon=DBget_field($result,$i,8);
- $img=ImageCreateFromPNG("images/sysmaps/$icon.png");
+ if(@gettype($icons["$icon"])!="resource")
+ {
+ $icons[$icon]=ImageCreateFromPNG("images/sysmaps/$icon.png");
+ }
+
+ $img=$icons[$icon];
ImageCopy($im,$img,$x,$y,0,0,ImageSX($img),ImageSY($img));
@@ -130,7 +136,7 @@
# ImageFilledRectangle($im,$x+ImageSX($img)/2-ImageFontWidth(2)*strlen($label)/2-2, $y+ImageSY($img),$x+ImageSX($img)/2+ImageFontWidth(2)*strlen($label)/2, $y+ImageSY($img)+ImageFontHeight(2),$white);
# ImageString($im, 2, $x+ImageSX($img)/2-ImageFontWidth(2)*strlen($label)/2, $y+ImageSY($img)+ImageFontHeight(2), $label,$color);
- ImageDestroy($img);
+# ImageDestroy($img);
}
ImageString($im,0,$width-147,$height-10, "http://zabbix.sourceforge.net", $gray);