[Nagios-db-checkins] nagios-db/ui/templates groupnav.tpl,NONE,1.1 navedit.tpl,NONE,1.1 status_header
Status: Beta
Brought to you by:
bench23
From: Matthew K. <mat...@us...> - 2005-02-15 06:59:54
|
Update of /cvsroot/nagios-db/nagios-db/ui/templates In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13864/templates Modified Files: default.tpl tac.tpl Added Files: groupnav.tpl navedit.tpl status_header.tpl Log Message: Initial checkin of supporting files for dynamic tree navigation Index: tac.tpl =================================================================== RCS file: /cvsroot/nagios-db/nagios-db/ui/templates/tac.tpl,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- tac.tpl 25 Jan 2005 07:11:54 -0000 1.1 +++ tac.tpl 15 Feb 2005 06:59:45 -0000 1.2 @@ -1,3 +1,14 @@ +<? // $Id$ ?> + +<!-- begin $RCSfile --> + +<table border=0 width=100%> +<tr> +<td valign="top"> +<?= $groupnav ?> +</td> +<td> + <table align="right" cellpadding = 3> <tr> <td colspan=4><b>Monitoring Performance Statistics</b></td> @@ -106,4 +117,59 @@ <a href="<?= $base ?>/../serviceDetails.php?servicestates[]=3&hoststates[]=0"><?= isset($spending["good_hosts"]) ? $spending["good_hosts"] : 0 ?> on OK hosts</a> <br> <a href="<?= $base ?>/../serviceDetails.php?servicestates[]=3&hoststates[]=-1&hoststates[]=1&hoststates[]=2"><?= isset($spending["bad_hosts"]) ? $spending["bad_hosts"] : 0 ?> on problem hosts</a> -</td> \ No newline at end of file +</td> + +<table cellpadding=3> +<tr> + <td colspan=5 bgcolor="#000000"><font color="#ffffff"><b>Monitoring Features</b></font></td> +</tr> +<tr bgcolor="tan"> + <td>Flap Detection</td> + <td>Notifications</td> + <td>Event Handlers</td> + <td>Active Checks</td> + <td>Passive Checks</td> +</tr> +<tr> + <td> + <table cellpadding=2> + <tr><td align="top" bgcolor=#66ff33>On</td> + <td> + <table> + <tr> + <td bgcolor=#66ff33><?= $flappinghosts ?> hosts enabled</td> + </tr> + <tr> + <td bgcolor=#66ff33>All services enabled</td> + </tr> + </table> + </td> + </tr> + </table> + </td> + + <td> + <table cellpadding=2> + <tr><td align="top" bgcolor=#66ff33>On</td> + <td> + <table> + <tr> + <td bgcolor=#66ff33>All hosts enabled</td> + </tr> + <tr> + <td bgcolor=#66ff33>All services enabled</td> + </tr> + </table> + </td> + </tr> + </table> + </td> + +</tr> +</table> + +</td> +</tr> +</table> + +<!-- end $RCSfile --> \ No newline at end of file --- NEW FILE: groupnav.tpl --- <? // $Id: groupnav.tpl,v 1.1 2005/02/15 06:59:45 mattkent Exp $ ?> <? /* our host and service group tree navigation lots of inline logic, but meant to be used in multiple places usage: */ // handle collapsing our tree if (isset ($_GET["collapse"])) { if ($_GET["collapse"] == "yes") { $foo = $_SERVER["REQUEST_URI"]; $foo = preg_replace("/&collapse=yes/","",$foo); echo "<a href=\"$foo&collapse=no\">Expand Nav</a>"; return 0; } } ?> <!-- begin $RCSfile: groupnav.tpl,v $ --> <a href="<?= $_SERVER["REQUEST_URI"] ?>&collapse=yes">Collapse Nav</a> <link rel="stylesheet" type="text/css" href="/neb/css/dynamictree.css" /> <script type="text/javascript" src="/neb/js/ie5.js"></script> <script type="text/javascript" src="/neb/js/dynamictree.js"></script> <ul id="tabmenu"> <? // what type of nav is this? // this should be a bitmask if ($style == "HOSTGROUP") { echo '<li><a class="active" href="index.php?display=hostgroup">Hostgroup</a></li>'."\n"; } else if ($style == "BOTH") { echo '<li><a href="index.php?display=servicegroup">Servicegroup</a></li>'; } ?> </ul> <div class="DynamicTree"> <div class="wrap1"> <div class="top"><a href="index.php">Nagios</a></div> <div class="wrap" id="tree"> <? /* sort our query into a unique hostgroup_grouping name => hostgroup name array */ $tree = array(); foreach ($groupednavdata as $group) { if ( ! isset($tree[$group["unit"]])) { $tree[$group["unit"]] = array(); } array_push($tree[$group["unit"]], $group["name"]); } if (isset($_POST["openfolders"])) { $toexpand = array(); foreach (explode("|", $_POST["openfolders"]) as $open) { $toexpand[$open] = TRUE; } } $i=0; foreach ($tree as $branch => $keys) { $grouping = "&hostgroup[]="; foreach ($tree[$branch] as $leaf) { $grouping .= "$leaf,"; } $grouping = chop($grouping, ','); $i++; ?> <div class="folder" id="<?= $branch ?>"><a href="index.php?<?= $grouping ?>" name="<?= $i ?>"><?= $branch ?></a> <? if (isset($toexpand[$branch])) { foreach ($tree[$branch] as $leaf) { ?> <div class="doc"><a href="index.php?hostgroup=<?= $leaf ?>"><?= $leaf ?></a></div> <? } } else { ?> <div class="doc">Loading...</div> <? } ?> </div> <? } foreach ($ungroupednavdata as $leaf) { ?> <div class="doc"><a href="index.php?hostgroup=<?= $leaf["name"] ?>"><?= $leaf["name"] ?></a></div> <? } ?> </div> </div> <script type="text/javascript"> var tree = new DynamicTree("tree"); tree.foldersAsLinks = true; tree.path = '<?= $base ?>/../images/'; <? if (isset($_POST["openfolders"])) { ?> tree.expand = '<?= $_POST["openfolders"] ?>'; <? } ?> tree.init(); </script> <a href="navedit.php">Edit</a> <!-- finish $RCSfile: groupnav.tpl,v $ --> Index: default.tpl =================================================================== RCS file: /cvsroot/nagios-db/nagios-db/ui/templates/default.tpl,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- default.tpl 25 Jan 2005 07:11:54 -0000 1.1 +++ default.tpl 15 Feb 2005 06:59:45 -0000 1.2 @@ -8,13 +8,12 @@ <script type="text/javascript" src="<?= $base ?>/js/dropdown.js"></script> </head> <body> - <div id="navbar"> <div id="toolbar"> <table border=0 cellspacing="0" cellpadding="0" id="menu1" class="ddm1"> <tr> <td> - <a class="item1 left" href="<?= $base ?>/">Home</a> + <a class="item1 left" href="<?= $base ?>/index.php">Home</a> </td> <td> <a class="item1" href="javascript:void(0)">Tactical Views</a> @@ -38,7 +37,7 @@ </div> </td> <td> - <a class="item1" href="javascript:void(0)">Reports</a> + <a class="item1 right" href="javascript:void(0)">Reports</a> <div class="section"> <a class="item2" href="<?= $base ?>/statusHostgroup/selector.php">Service Details, By Hostgroup</a> <a class="item2" href="<?= $base ?>/statusService/selector.php">Service Details, By Service</a> @@ -52,14 +51,14 @@ <td class="toolbar" width="100%"> <table border=0 width="100%"><tr> - <td class="header" align=center style="color: #ffffff"> + <td class="header" width="50%"> nagios with nagios-db! </td> <td align=right> <!-- <input type=hidden name=hl value=en> --> <!-- what's max len in nagios? --> <input maxLength=256 size=16 name=word value="Enter Host or Group" onfocus="this.value = '';"> - <input type=submit value="FInd Object" name=search class="button"> + <input type=submit value="Find Object" name=search class="button"> </td> </tr></table> @@ -70,17 +69,137 @@ </div> </div> + <? + /* little inline block to do our navbar status */ + + $down = 0; + $unreachable = 0; + $up = 0; + $pending = 0; + + foreach ($navbar_hosts as $out) { + switch ($out["soft_state"]) { + case 1: + $down = $out["count"]; + break; + case 2: + $unreachable = $out["count"]; + break; + case 0: + $up = $out["count"]; + break; + case -1: + $h_pending = $out["count"]; + break; + } + } + + $critical = 0; + $warning = 0; + $unknown = 0; + $ok = 0; + $pending = 0; + + foreach ($navbar_services as $out) { + switch ($out["state"]) { + case 2: + $critical = $out["total"]; + break; + case 1: + $warning = $out["total"]; + break; + case 3: + $unknown = $out["total"]; + break; + case 0: + $ok = $out["total"]; + break; + case -1: + $s_pending = $out["total"]; + break; + } + } + + ?> + + <div id="navbar_totals"> + <table border=0 cellspacing="0" cellpadding="0" id="menu1" class="navbar_totals1"> + <tr> + <td> + <div class="wrap header"> + Hosts + </div> + </td> + <td> + <div class="wrap problem"> + <a href="<?= $base ?>/serviceDetails.php?hoststates[]=1"><?= $down ?></a> + </div> + </td> + <td> + <div class="wrap unknown"> + <a href="<?= $base ?>/serviceDetails.php?hoststates[]=2"><?= $unreachable ?></a> + </div> + </td> + <td> + <div class="wrap ok"> + <a href="<?= $base ?>/serviceDetails.php?hoststates[]=0"><?= $up ?></a> + </div> + </td> + <td> + <div class="wrap pending"> + <a href="<?= $base ?>/serviceDetails.php?hoststates[]=-1"><?= $h_pending ?></a> + </div> + </td> + <td> + <div class="wrap header"> + Services + </div> + </td> + <td> + <div class="wrap problem"> + <a href="<?= $base ?>/serviceDetails.php?servicestates[]=2"><?= $critical ?></a> + </div> + </td> + <td> + <div class="wrap warning"> + <a href="<?= $base ?>/serviceDetails.php?servicestates[]=1"><?= $warning ?></a> + </div> + </td> + <td> + <div class="wrap unknown"> + <a href="<?= $base ?>/serviceDetails.php?servicestates[]=3"><?= $unknown ?></a> + </div> + </td> + <td> + <div class="wrap ok"> + <a href="<?= $base ?>/serviceDetails.php?servicestates[]=0"><?= $ok ?></a> + </div> + </td> + <td> + <div class="wrap pending"> + <a href="<?= $base ?>/serviceDetails.php?servicestates[]=-1"><?= $s_pending ?></a> + </div> + </td> + <td width="100%"> + <div class="time"> + <?= $timestamp ?> + </div> + </td> + </tr> + </table> + </div> <script type="text/javascript"> var ddm1 = new DropDownMenu1('menu1'); ddm1.position.top = -1; ddm1.init(); </script> - -<div id="content"> - <div id="header"><?= $title ?></div> - <br/> - <?= $content ?> -</div> + + <div id="content"> + <div id="header"><?= $title ?></div> + <br/> + <?= $content ?> + </div> + </body> </html> \ No newline at end of file --- NEW FILE: navedit.tpl --- <? // $Id: navedit.tpl,v 1.1 2005/02/15 06:59:45 mattkent Exp $ ?> <!-- begin $RCSfile: navedit.tpl,v $ --> <table border=1 width=100%> <tr> <td valign="top" align="left"> <?= $groupnav ?> </td> <td width=100%> <form action="navedit.php" method="get"> <table border=1> <tr> <td> <select multiple size="15" width="100%" name="hostgroups[]"> <? foreach ($freegroups as $hg) { ?> <option value="<?= $hg["id"] ?>"><?= $hg["name"] ?></option> <? } ?> </select> </td> <td> <input maxLength=256 size=16 name=word value="Enter Group Name" onfocus="this.value = '';"> <input type="submit" value="Create Group >>" name="type" class="button"> </form> <form action="navedit.php" method="get"> <input type="submit" value="<< Delete Group" name="type" class="button"> </td> <td> <select multiple size="15" width="100%" name="hostgroup_groupings[]"> <? foreach ($configuredgroups as $hg) { ?> <option value="<?= $hg["id"] ?>"><?= $hg["name"] ?></option> <? } ?> </select> </td> </form> </tr> </td> </tr> </table> <!-- end $RCSfile: navedit.tpl,v $ --> --- NEW FILE: status_header.tpl --- |