1 | <?php |
---|
2 | /* template head */ |
---|
3 | /* end template head */ ob_start(); /* template body */ ?><style type="text/css"> |
---|
4 | .img_view { |
---|
5 | float: left; |
---|
6 | margin: 0 0 10px 10px; |
---|
7 | } |
---|
8 | </style> |
---|
9 | |
---|
10 | <script type="text/javascript"> |
---|
11 | function refreshView() { |
---|
12 | $("#view_graphs img").each(function (index) { |
---|
13 | var src = $(this).attr("src"); |
---|
14 | if (src.indexOf("graph.php") == 0) { |
---|
15 | var d = new Date(); |
---|
16 | $(this).attr("src", jQuery.param.querystring(src, "&_=" + d.getTime())); |
---|
17 | } |
---|
18 | }); |
---|
19 | } |
---|
20 | |
---|
21 | $(function() { |
---|
22 | $( "#popup-dialog" ).dialog({ autoOpen: false, width:850 }); |
---|
23 | $("#create_view_button") |
---|
24 | .button() |
---|
25 | .click(function() { |
---|
26 | $( "#create-new-view-dialog" ).dialog( "open" ); |
---|
27 | }); |
---|
28 | $("#delete_view_button") |
---|
29 | .button() |
---|
30 | .click(function() { |
---|
31 | if ($("#vn").val() != "") { |
---|
32 | if (confirm("Are you sure you want to delete the view: " + $("#vn").val() + " ?")) { |
---|
33 | $.get('views_view.php?view_name=' + |
---|
34 | encodeURIComponent($("#vn").val()) + |
---|
35 | '&delete_view&views_menu', |
---|
36 | function(data) { |
---|
37 | $("#views_menu").html(data); |
---|
38 | $("#view_graphs").html(""); |
---|
39 | $.cookie('ganglia-selected-view-' + window.name, ""); |
---|
40 | $("#vn").val(""); |
---|
41 | }); |
---|
42 | } |
---|
43 | } else |
---|
44 | alert("Please select the view to delete"); |
---|
45 | }); |
---|
46 | }); |
---|
47 | </script> |
---|
48 | |
---|
49 | <div id="popup-dialog" title="Inspect Graph"> |
---|
50 | <div id="popup-dialog-content"> |
---|
51 | </div> |
---|
52 | </div> |
---|
53 | |
---|
54 | <table id="views_table"> |
---|
55 | <tr><td valign="top"> |
---|
56 | <div id="views_menu"> |
---|
57 | <?php echo $this->scope["existing_views"];?> |
---|
58 | |
---|
59 | </div> |
---|
60 | <script type="text/javascript">$(function() { $("#views_menu").buttonsetv(); });</script> |
---|
61 | </td> |
---|
62 | <td valign="top"> |
---|
63 | <div> |
---|
64 | <div id="views-content"> |
---|
65 | <div id=view_graphs> |
---|
66 | <?php if (((isset($this->scope["number_of_view_items"]) ? $this->scope["number_of_view_items"] : null) !== null)) { |
---|
67 | ?> |
---|
68 | <?php if ((isset($this->scope["number_of_view_items"]) ? $this->scope["number_of_view_items"] : null) == 0) { |
---|
69 | ?> |
---|
70 | <div class="ui-widget"> |
---|
71 | <div class="ui-state-default ui-corner-all" style="padding: 0 .7em;"> |
---|
72 | <p><span class="ui-icon ui-icon-alert" style="float: left; margin-right: .3em;"></span> |
---|
73 | No graphs defined for this view. Please add some |
---|
74 | </div> |
---|
75 | </div> |
---|
76 | <?php |
---|
77 | } |
---|
78 | else { |
---|
79 | ?> |
---|
80 | <?php $this->scope["i"]=0?> |
---|
81 | |
---|
82 | <?php |
---|
83 | $_fh0_data = (isset($this->scope["view_items"]) ? $this->scope["view_items"] : null); |
---|
84 | if ($this->isTraversable($_fh0_data) == true) |
---|
85 | { |
---|
86 | foreach ($_fh0_data as $this->scope['view_item']) |
---|
87 | { |
---|
88 | /* -- foreach start output */ |
---|
89 | ?> |
---|
90 | <?php $this->scope["graphId"]=((isset($this->scope["GRAPH_BASE_ID"]) ? $this->scope["GRAPH_BASE_ID"] : null)).("view_").((isset($this->scope["i"]) ? $this->scope["i"] : null))?> |
---|
91 | |
---|
92 | <?php $this->scope["showEventsId"]=((isset($this->scope["SHOW_EVENTS_BASE_ID"]) ? $this->scope["SHOW_EVENTS_BASE_ID"] : null)).("view_").((isset($this->scope["i"]) ? $this->scope["i"] : null))?> |
---|
93 | |
---|
94 | <div class="img_view"> |
---|
95 | <button title="Export to CSV" class="cupid-green" onClick="javascript:location.href='graph.php?<?php echo $this->scope["view_item"]["url_args"];?>&csv=1';return false;">CSV</button> |
---|
96 | <button title="Export to JSON" class="cupid-green" onClick="javascript:location.href='graph.php?<?php echo $this->scope["view_item"]["url_args"];?>&json=1';return false;">JSON</button> |
---|
97 | <?php if ((isset($this->scope["view_item"]["aggregate_graph"]) ? $this->scope["view_item"]["aggregate_graph"]:null) == 1) { |
---|
98 | ?> |
---|
99 | <button title="Decompose aggregate graph" class="shiny-blue" onClick="javascript:location.href='?<?php echo $this->scope["view_item"]["url_args"];?>&dg=1&tab=v';return false;">Decompose</button> |
---|
100 | <?php |
---|
101 | }?> |
---|
102 | |
---|
103 | <button title="Inspect Graph" onClick="inspectGraph('<?php echo $this->scope["view_item"]["url_args"];?>'); return false;" class="shiny-blue">Inspect</button> |
---|
104 | <input type="checkbox" id="<?php echo $this->scope["showEventsId"];?>" onclick="showEvents('<?php echo $this->scope["graphId"];?>', this.checked)"/><label title="Hide/Show Events" class="show_event_text" for="<?php echo $this->scope["showEventsId"];?>">Hide/Show Events</label> |
---|
105 | <br /> |
---|
106 | <?php if ((isset($this->scope["graph_engine"]) ? $this->scope["graph_engine"] : null) == "flot") { |
---|
107 | ?> |
---|
108 | <div id="placeholder_<?php echo $this->scope["view_item"]["url_args"];?>" class="flotgraph2 img_view"></div> |
---|
109 | <div id="placeholder_<?php echo $this->scope["view_item"]["url_args"];?>_legend" class="flotlegend"></div> |
---|
110 | <?php |
---|
111 | } |
---|
112 | else { |
---|
113 | ?> |
---|
114 | <a href="graph_all_periods.php?<?php echo $this->scope["view_item"]["url_args"];?>"><img id="<?php echo $this->scope["graphId"];?>" class="noborder <?php echo $this->scope["additional_host_img_css_classes"];?>" style="margin-top:5px;" src="graph.php?<?php echo $this->scope["view_item"]["url_args"];?>" /></a> |
---|
115 | <?php |
---|
116 | }?> |
---|
117 | |
---|
118 | </div> |
---|
119 | <?php echo ($this->assignInScope((isset($this->scope["i"]) ? $this->scope["i"] : null) + 1, 'i'));?> |
---|
120 | |
---|
121 | <?php |
---|
122 | /* -- foreach end output */ |
---|
123 | } |
---|
124 | }?> |
---|
125 | |
---|
126 | <?php |
---|
127 | }?> |
---|
128 | |
---|
129 | <?php |
---|
130 | }?> |
---|
131 | |
---|
132 | </div> |
---|
133 | </div> |
---|
134 | <div style="clear: left"></div> |
---|
135 | </div> |
---|
136 | </td> |
---|
137 | </tr> |
---|
138 | </table> |
---|
139 | |
---|
140 | <?php /* end template body */ |
---|
141 | return $this->buffer . ob_get_clean(); |
---|
142 | ?> |
---|