diff options
| author | osmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2006-02-23 09:19:39 +0000 |
|---|---|---|
| committer | osmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2006-02-23 09:19:39 +0000 |
| commit | 80f4db7614471e99bbcf303e2702bbe44b0a72c2 (patch) | |
| tree | 6873e04ad27ad82545bf7bf9ee1ac0b2ec490eb1 /frontends/php/graphs.php | |
| parent | cfdccc6dd4f9d313f6cdc34f62f6453a1f5a1a0b (diff) | |
| download | zabbix-80f4db7614471e99bbcf303e2702bbe44b0a72c2.tar.gz zabbix-80f4db7614471e99bbcf303e2702bbe44b0a72c2.tar.xz zabbix-80f4db7614471e99bbcf303e2702bbe44b0a72c2.zip | |
- added Hostname for graphs displaying (Eugene)
git-svn-id: svn://svn.zabbix.com/trunk@2676 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/graphs.php')
| -rw-r--r-- | frontends/php/graphs.php | 32 |
1 files changed, 30 insertions, 2 deletions
diff --git a/frontends/php/graphs.php b/frontends/php/graphs.php index 59981614..7fc30500 100644 --- a/frontends/php/graphs.php +++ b/frontends/php/graphs.php @@ -167,7 +167,9 @@ $form->AddItem(SPACE.S_HOST.SPACE); $cmbHosts = new CComboBox("hostid", $_REQUEST["hostid"], "submit()"); - $cmbHosts->AddItem(0,S_ALL_SMALL); + if($_REQUEST["groupid"]==0) + $cmbHosts->AddItem(0,S_ALL_SMALL); + if(isset($_REQUEST["groupid"]) && $_REQUEST["groupid"] > 0) { $sql="select h.hostid,h.host from hosts h,items i,hosts_groups hg". @@ -181,13 +183,20 @@ " and h.status not in (".HOST_STATUS_DELETED.") group by h.hostid,h.host". " order by h.host"; } + $result=DBselect($sql); + $host_ok = 0; + $first_host = 0; while($row=DBfetch($result)) { if(!check_right("Host","R",$row["hostid"])) continue; $cmbHosts->AddItem($row["hostid"],$row["host"]); + if($first_host == 0) $first_host = $row["hostid"]; + if($_REQUEST["hostid"] == $row["hostid"]) $host_ok = 1; } $form->AddItem($cmbHosts); + if(!$host_ok && $_REQUEST["hostid"]!=0) + $_REQUEST["hostid"] = $first_host; $form->AddItem(SPACE."|".SPACE); $form->AddItem(new CButton("form",S_CREATE_GRAPH)); @@ -196,7 +205,8 @@ /* TABLE */ $table = new CTableInfo(S_NO_GRAPHS_DEFINED); - $table->setHeader(array(S_ID,S_NAME,S_WIDTH,S_HEIGHT,S_GRAPH)); + $table->setHeader(array(S_ID, + $_REQUEST["hostid"] != 0 ? NULL : S_HOSTS, S_NAME,S_WIDTH,S_HEIGHT,S_GRAPH)); if(isset($_REQUEST["hostid"])&&($_REQUEST["hostid"]!=0)) { @@ -212,12 +222,29 @@ { if(!check_right("Graph","U",$row["graphid"])) continue; +/* if(!isset($_REQUEST["hostid"])) { $sql="select * from graphs_items where graphid=".$row["graphid"]; $result2=DBselect($sql); if(DBnum_rows($result2)>0) continue; } +*/ + + if($_REQUEST["hostid"] != 0) + { + $host_list = NULL; + } + else + { + $host_list = ""; + $db_hosts = get_hosts_by_graphid($row["graphid"]); + while($db_host = DBfetch($db_hosts)) + { + $host_list .= $db_host["host"].","; + } + $host_list = trim($host_list,','); + } if($row["templateid"]==0) { @@ -252,6 +279,7 @@ $table->AddRow(array( $row["graphid"], + $host_list, $name, $row["width"], $row["height"], |
