diff options
author | hugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2001-07-10 18:17:11 +0000 |
---|---|---|
committer | hugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2001-07-10 18:17:11 +0000 |
commit | 6565f3dae74a0265140df7a6997e30ff5aa56c05 (patch) | |
tree | 7b00ac18cbb6e9062d90d0976d2c8c865efa3034 /frontends | |
parent | f135f34fc12e290a666eb746dada33730e924880 (diff) | |
download | zabbix-6565f3dae74a0265140df7a6997e30ff5aa56c05.tar.gz zabbix-6565f3dae74a0265140df7a6997e30ff5aa56c05.tar.xz zabbix-6565f3dae74a0265140df7a6997e30ff5aa56c05.zip |
Added column icon to table sysmaps_hosts. Added table help.
git-svn-id: svn://svn.zabbix.com/trunk@134 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends')
-rw-r--r-- | frontends/php/include/config.inc | 8 | ||||
-rw-r--r-- | frontends/php/map.html | 9 | ||||
-rw-r--r-- | frontends/php/sysmap.html | 46 |
3 files changed, 40 insertions, 23 deletions
diff --git a/frontends/php/include/config.inc b/frontends/php/include/config.inc index b098bc32..6d3f49ae 100644 --- a/frontends/php/include/config.inc +++ b/frontends/php/include/config.inc @@ -1008,15 +1008,15 @@ # Add Host to system map - function add_host_to_sysmap($sysmapid,$hostid,$label,$x,$y) + function add_host_to_sysmap($sysmapid,$hostid,$label,$x,$y,$icon) { - $sql="insert into sysmaps_hosts (sysmapid,hostid,label,x,y) values ($sysmapid,$hostid,'$label',$x,$y)"; + $sql="insert into sysmaps_hosts (sysmapid,hostid,label,x,y,icon) values ($sysmapid,$hostid,'$label',$x,$y,'$icon')"; $result=DBexecute($sql); } - function update_sysmap_host($shostid,$sysmapid,$hostid,$label,$x,$y) + function update_sysmap_host($shostid,$sysmapid,$hostid,$label,$x,$y,$icon) { - $sql="update sysmaps_hosts set hostid=$hostid,label='$label',x=$x,y=$y where shostid=$shostid"; + $sql="update sysmaps_hosts set hostid=$hostid,label='$label',x=$x,y=$y,icon='$icon' where shostid=$shostid"; $result=DBexecute($sql); } diff --git a/frontends/php/map.html b/frontends/php/map.html index 07686ec2..0f6a79af 100644 --- a/frontends/php/map.html +++ b/frontends/php/map.html @@ -74,9 +74,8 @@ } # Draw hosts - $img=ImageCreateFromPNG("images/sysmaps/host.png"); - $result=DBselect("select h.host,sh.shostid,sh.sysmapid,sh.hostid,sh.label,sh.x,sh.y,h.status from sysmaps_hosts sh,hosts h where sh.sysmapid=$sysmapid and h.hostid=sh.hostid"); + $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++) { $host=DBget_field($result,$i,0); @@ -87,6 +86,9 @@ $x=DBget_field($result,$i,5); $y=DBget_field($result,$i,6); $status=DBget_field($result,$i,7); + $icon=DBget_field($result,$i,8); + + $img=ImageCreateFromPNG("images/sysmaps/$icon.png"); ImageCopy($im,$img,$x,$y,0,0,ImageSX($img),ImageSY($img)); @@ -128,9 +130,8 @@ # 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); diff --git a/frontends/php/sysmap.html b/frontends/php/sysmap.html index 7d3f0a09..dc8c49cd 100644 --- a/frontends/php/sysmap.html +++ b/frontends/php/sysmap.html @@ -15,11 +15,11 @@ { if($register=="add") { - add_host_to_sysmap($sysmapid,$hostid,$label,$x,$y); + add_host_to_sysmap($sysmapid,$hostid,$label,$x,$y,$icon); } if($register=="update") { - update_sysmap_host($shostid,$sysmapid,$hostid,$label,$x,$y); + update_sysmap_host($shostid,$sysmapid,$hostid,$label,$x,$y,$icon); } if($register=="add link") { @@ -77,10 +77,11 @@ echo "<TD WIDTH=\"10%\" NOSAVE><B>Label</B></TD>"; echo "<TD WIDTH=\"10%\" NOSAVE><B>X</B></TD>"; echo "<TD WIDTH=\"10%\" NOSAVE><B>Y</B></TD>"; + echo "<TD WIDTH=\"10%\" NOSAVE><B>Icon</B></TD>"; echo "<TD WIDTH=\"10%\" NOSAVE><B>Actions</B></TD>"; echo "</TR>"; - $result=DBselect("select h.host,sh.shostid,sh.sysmapid,sh.hostid,sh.label,sh.x,sh.y from sysmaps_hosts sh,hosts h where sh.sysmapid=$sysmapid and h.hostid=sh.hostid order by h.host"); + $result=DBselect("select h.host,sh.shostid,sh.sysmapid,sh.hostid,sh.label,sh.x,sh.y,sh.icon from sysmaps_hosts sh,hosts h where sh.sysmapid=$sysmapid and h.hostid=sh.hostid order by h.host"); echo "<CENTER>"; $col=0; for($i=0;$i<DBnum_rows($result);$i++) @@ -102,11 +103,13 @@ $label_=DBget_field($result,$i,4); $x_=DBget_field($result,$i,5); $y_=DBget_field($result,$i,6); + $icon_=DBget_field($result,$i,7); echo "<TD>$host</TD>"; echo "<TD>$label_</TD>"; echo "<TD>$x_</TD>"; echo "<TD>$y_</TD>"; + echo "<TD>$icon_</TD>"; echo "<TD><A HREF=\"sysmap.html?sysmapid=$sysmapid_&shostid=$shostid_#form\">Change</A> - <A HREF=\"sysmap.html?register=delete&sysmapid=$sysmapid_&shostid=$shostid_\">Delete</A></TD>"; echo "</TR>"; } @@ -159,11 +162,12 @@ if(isset($shostid)) { - $result=DBselect("select hostid,label,x,y from sysmaps_hosts where shostid=$shostid"); + $result=DBselect("select hostid,label,x,y,icon from sysmaps_hosts where shostid=$shostid"); $hostid=DBget_field($result,0,0); $label=DBget_field($result,0,1); $x=DBget_field($result,0,2); $y=DBget_field($result,0,3); + $icon=DBget_field($result,0,4); } else { @@ -201,6 +205,29 @@ echo "</SELECT>"; show_table2_v_delimiter(); + echo "Icon"; + show_table2_h_delimiter(); + echo "<select name=\"icon\" size=1>"; + $icons=array(); + $icons[0]="Server"; + $icons[1]="Printer"; + $icons[2]="Router"; + $icons[3]="Hub"; + $icons[4]="Notebook"; + for($i=0;$i<5;$i++) + { + if(isset($hostid) && ($icon==$icons[$i])) + { + echo "<OPTION VALUE='".$icons[$i]."' SELECTED>".$icons[$i]; + } + else + { + echo "<OPTION VALUE='".$icons[$i]."'>".$icons[$i]; + } + } + echo "</SELECT>"; + + show_table2_v_delimiter(); echo "Label"; show_table2_h_delimiter(); echo "<input name=\"label\" size=32 value=\"$label\">"; @@ -225,17 +252,6 @@ show_table2_header_end(); ?> - - - - - - - - - - - <? echo "<br>"; show_table2_header_begin(); |