Opened 16 years ago

Closed 16 years ago

#6 closed enhancement (fixed)

Treeview Uitgeklapt

Reported by: richardvm Owned by: somebody
Priority: major Milestone: Design a overview page
Component: component1 Version:
Keywords: Cc:

Description

Zoek uit hoe de treeview uitgeklapts weergegeven kan worden bij eerste opening. (standaard alleen is alleen de root uitgeklapt)

Change History (2)

comment:1 by richardvm, 16 years ago

Apparently an expanded cacti tree was requested since Cacti first hit the marked, but was never implemented.

There are probably nicer ways to expand the tree (but was unable to find them after a lot of googling), but it works.

Added the following text to the end of "graph_view.php" (I added it just before the footer).

Only run this hack the first time you open a cacti tree (the second time it remembers the settings from the first).
if ($_SESSION[WL_1]==false) {

Query the TreeID of the tree called 'Public';
$WLQUERY = mysql_query("select * from graph_tree where name = 'Public';");
$WLDATA = mysql_fetch_array($WLQUERY);
$WLTREE = $WLDATA[id];

Initialize the Javascript and expand the Public tree.
echo "<script language=\"javascript\">
clickOnNode(\"tree_" . $WLTREE . "\");\r\n";

Query the leaf objects of the Public tree, hosts have an empty title.
$WLQUERY = mysql_query("select * from graph_tree_items where graph_tree_id = '$WLTREE' and title <> ;");


Run trough all the leaf object and open them
while ($WLDATA = mysql_fetch_array($WLQUERY)) {

echo " clickOnNode(\"tree_" . $WLTREE . "_leaf_" . $WLDATA[id] . "\");\r\n";

}


Close the Javascript
echo "

</script>";

Make sure this script is not run again this session (so the tree is not partially closed).
$_SESSION[WL_1]=true;

}

comment:2 by richardvm, 16 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.