summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2003-01-26 16:21:41 +0000
committerhugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2003-01-26 16:21:41 +0000
commitde03b9ce1601c2ec461ab2d58b23e32ebc3e399b (patch)
tree5fba2a10d6947a170c653f6b2941c01510acfe8f
parent7196cd2a6275ab6ea866c59d8abe96af4aaae5ea (diff)
downloadzabbix-de03b9ce1601c2ec461ab2d58b23e32ebc3e399b.tar.gz
zabbix-de03b9ce1601c2ec461ab2d58b23e32ebc3e399b.tar.xz
zabbix-de03b9ce1601c2ec461ab2d58b23e32ebc3e399b.zip
- group selection for Item configuration form (Alexei)
git-svn-id: svn://svn.zabbix.com/trunk@671 97f52cf1-0a1b-0410-bd0e-c28be96e8082
-rw-r--r--ChangeLog1
-rw-r--r--frontends/php/hosts.php64
2 files changed, 61 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 3cd51820..6d5f389d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,6 @@
Changes for 1.0beta8:
+ - group selection for Item configuration form (Alexei)
- added support for SLA level in IT Services (Alexei)
- added fields services.showsla and services.goodsla (Alexei)
- added field items.snmp_port (Alexei)
diff --git a/frontends/php/hosts.php b/frontends/php/hosts.php
index df5b3e0e..16251689 100644
--- a/frontends/php/hosts.php
+++ b/frontends/php/hosts.php
@@ -25,7 +25,7 @@
}
if($HTTP_GET_VARS["register"]=="update")
{
- $result=update_host($HTTP_GET_VARS["hostid"],$HTTP_GET_VARS["host"],$HTTP_GET_VARS["port"],$HTTP_GET_VARS["status"],$HTTP_GET_VARS["useip"],$HTTP_GET_VARS["ip"],$HTTP_GET_VARS["newgroup"],$HTTP_GET_VARS["groups"]);
+ $result=@update_host($HTTP_GET_VARS["hostid"],$HTTP_GET_VARS["host"],$HTTP_GET_VARS["port"],$HTTP_GET_VARS["status"],$HTTP_GET_VARS["useip"],$HTTP_GET_VARS["ip"],$HTTP_GET_VARS["newgroup"],$HTTP_GET_VARS["groups"]);
show_messages($result,"Host details updated","Cannot update host details");
unset($HTTP_GET_VARS["hostid"]);
}
@@ -45,7 +45,42 @@
?>
<?php
- show_table_header("CONFIGURATION OF HOSTS");
+ show_table_header_begin();
+ echo "CONFIGURATION OF HOSTS";
+ show_table_v_delimiter();
+
+ if(isset($HTTP_GET_VARS["groupid"]))
+ {
+// echo "all ";
+ echo "<a href='hosts.php'>all</a> ";
+ }
+ else
+ {
+ echo "<b>[<a href='hosts.php'>all</a>]</b> ";
+ }
+
+ $result=DBselect("select groupid,name from groups order by name");
+
+ while($row=DBfetch($result))
+ {
+// if(!check_right("Host","R",$row["hostid"]))
+// {
+// continue;
+// }
+ if( isset($HTTP_GET_VARS["groupid"]) && ($HTTP_GET_VARS["groupid"] == $row["groupid"]) )
+ {
+ echo "<b>[";
+ }
+ echo "<a href='hosts.php?groupid=".$row["groupid"]."'>".$row["name"]."</a>";
+ if(isset($HTTP_GET_VARS["groupid"]) && ($HTTP_GET_VARS["groupid"] == $row["groupid"]) )
+ {
+ echo "]</b>";
+ }
+ echo " ";
+ }
+
+ show_table_header_end();
+ echo "<br>";
?>
<?php
@@ -60,7 +95,17 @@
echo "<TD WIDTH=10% NOSAVE><B>Actions</B></TD>";
echo "</TR>";
- $result=DBselect("select h.hostid,h.host,h.port,h.status from hosts h order by h.host");
+
+ if(isset($HTTP_GET_VARS["groupid"]))
+ {
+ $sql="select h.hostid,h.host,h.port,h.status from hosts h,hosts_groups hg where hg.groupid=".$HTTP_GET_VARS["groupid"]." and hg.hostid=h.hostid order by h.host";
+ }
+ else
+ {
+ $sql="select h.hostid,h.host,h.port,h.status from hosts h order by h.host";
+ }
+ $result=DBselect($sql);
+
$col=0;
while($row=DBfetch($result))
{
@@ -104,7 +149,14 @@
echo "</TD>";
if(check_right("Host","U",$row["hostid"]))
{
- echo "<TD><A HREF=\"hosts.php?register=change&hostid=".$row["hostid"]."#form\">Change</A></TD>";
+ if(isset($HTTP_GET_VARS["groupid"]))
+ {
+ echo "<TD><A HREF=\"hosts.php?register=change&hostid=".$row["hostid"]."&groupid=".$HTTP_GET_VARS["groupid"]."#form\">Change</A></TD>";
+ }
+ else
+ {
+ echo "<TD><A HREF=\"hosts.php?register=change&hostid=".$row["hostid"]."#form\">Change</A></TD>";
+ }
}
else
{
@@ -155,6 +207,10 @@
{
echo "<input class=\"biginput\" name=\"hostid\" type=\"hidden\" value=\"".$HTTP_GET_VARS["hostid"]."\">";
}
+ if(isset($HTTP_GET_VARS["groupid"]))
+ {
+ echo "<input class=\"biginput\" name=\"groupid\" type=\"hidden\" value=\"".$HTTP_GET_VARS["groupid"]."\">";
+ }
echo "Host";
show_table2_h_delimiter();
echo "<input class=\"biginput\" name=\"host\" value=\"$host\" size=20>";