From 80f4db7614471e99bbcf303e2702bbe44b0a72c2 Mon Sep 17 00:00:00 2001 From: osmiy Date: Thu, 23 Feb 2006 09:19:39 +0000 Subject: - added Hostname for graphs displaying (Eugene) git-svn-id: svn://svn.zabbix.com/trunk@2676 97f52cf1-0a1b-0410-bd0e-c28be96e8082 --- frontends/php/chart2.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'frontends/php/chart2.php') diff --git a/frontends/php/chart2.php b/frontends/php/chart2.php index 6df46a4f..34d7e47c 100644 --- a/frontends/php/chart2.php +++ b/frontends/php/chart2.php @@ -42,8 +42,14 @@ $result=DBselect("select name,width,height,yaxistype,yaxismin,yaxismax from graphs where graphid=".$_REQUEST["graphid"]); $row=DBfetch($result); - + $db_hosts = get_hosts_by_graphid($_REQUEST["graphid"]); $name=$row["name"]; + + if(DBnum_rows($db_hosts)==1) + { + $db_host = DBfetch($db_hosts); + $name = $db_host["host"].":".$name; + } if(isset($_REQUEST["width"])&&$_REQUEST["width"]>0) { $width=$_REQUEST["width"]; @@ -63,7 +69,7 @@ $graph->setWidth($width); $graph->setHeight($height); - $graph->setHeader($row["name"]); + $graph->setHeader($name); $graph->setYAxisType($row["yaxistype"]); $graph->setYAxisMin($row["yaxismin"]); $graph->setYAxisMax($row["yaxismax"]); -- cgit