1 | <?php |
---|
2 | /* template head */ |
---|
3 | if (function_exists('Dwoo_Plugin_include')===false) |
---|
4 | $this->getLoader()->loadPlugin('include'); |
---|
5 | /* end template head */ ob_start(); /* template body */ ?><!-- Begin header.tpl --> |
---|
6 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> |
---|
7 | <html> |
---|
8 | <head> |
---|
9 | <title>Ganglia:: <?php echo $this->scope["page_title"];?></title> |
---|
10 | <meta http-equiv="Content-type" content="text/html; charset=utf-8"> |
---|
11 | <link type="text/css" href="css/smoothness/jquery-ui-1.9.1.custom.min.css" rel="stylesheet" /> |
---|
12 | <link type="text/css" href="css/jquery.liveSearch.css" rel="stylesheet" /> |
---|
13 | <link type="text/css" href="css/jquery.multiselect.css" rel="stylesheet" /> |
---|
14 | <link type="text/css" href="css/jquery.flot.events.css" rel="stylesheet" /> |
---|
15 | <link type="text/css" href="./styles.css" rel="stylesheet" /> |
---|
16 | <script type="text/javascript" src="js/jquery-1.9.1.min.js"></script> |
---|
17 | <script type="text/javascript" src="js/jquery-ui-1.9.1.custom.min.js"></script> |
---|
18 | <script type="text/javascript" src="js/jquery.livesearch.min.js"></script> |
---|
19 | <script type="text/javascript" src="js/ganglia.js"></script> |
---|
20 | <script type="text/javascript" src="js/jquery.gangZoom.js"></script> |
---|
21 | <script type="text/javascript" src="js/jquery.cookie.js"></script> |
---|
22 | <script type="text/javascript" src="js/jquery-ui-timepicker-addon.js"></script> |
---|
23 | <script type="text/javascript" src="js/jquery.ba-bbq.min.js"></script> |
---|
24 | <script type="text/javascript" src="js/combobox.js"></script> |
---|
25 | <script type="text/javascript" src="js/jquery.scrollTo-1.4.2-min.js"></script> |
---|
26 | <script type="text/javascript" src="js/jquery.buttonsetv.js"></script> |
---|
27 | <script type="text/javascript"> |
---|
28 | var server_utc_offset=<?php echo $this->scope["server_utc_offset"];?>; |
---|
29 | |
---|
30 | var g_refresh_timer = setTimeout("refresh()", <?php echo $this->scope["refresh"];?> * 1000); |
---|
31 | |
---|
32 | function refreshHeader() { |
---|
33 | $.get('header.php?date_only=1', function(data) { |
---|
34 | var title = $("#page_title").text(); |
---|
35 | var l = title.lastIndexOf(" for "); |
---|
36 | title = title.substring(0, l); |
---|
37 | title += " for " + data; |
---|
38 | $("#page_title").text(title); |
---|
39 | }); |
---|
40 | } |
---|
41 | |
---|
42 | function refresh() { |
---|
43 | var selected_tab = $("#selected_tab").val(); |
---|
44 | if (selected_tab == "agg") { |
---|
45 | refreshAggregateGraph(); |
---|
46 | g_refresh_timer = setTimeout("refresh()", <?php echo $this->scope["refresh"];?> * 1000); |
---|
47 | } else if (selected_tab == "v") { |
---|
48 | refreshHeader(); |
---|
49 | if ($.isFunction(window.refreshView)) { |
---|
50 | refreshView(); |
---|
51 | g_refresh_timer = setTimeout("refresh()", <?php echo $this->scope["refresh"];?> * 1000); |
---|
52 | } else if ($.isFunction(window.refreshDecomposeGraph)) { |
---|
53 | refreshDecomposeGraph(); |
---|
54 | g_refresh_timer = setTimeout("refresh()", <?php echo $this->scope["refresh"];?> * 1000); |
---|
55 | } else |
---|
56 | ganglia_form.submit(); |
---|
57 | } else if (selected_tab == "ev") { |
---|
58 | refreshOverlayEvent(); |
---|
59 | g_refresh_timer = setTimeout("refresh()", <?php echo $this->scope["refresh"];?> * 1000); |
---|
60 | } else if (selected_tab == "m") { |
---|
61 | if ($.isFunction(window.refreshClusterView)) { |
---|
62 | refreshHeader(); |
---|
63 | refreshClusterView(); |
---|
64 | g_refresh_timer = setTimeout("refresh()", <?php echo $this->scope["refresh"];?> * 1000); |
---|
65 | } else if ($.isFunction(window.refreshHostView)) { |
---|
66 | refreshHeader(); |
---|
67 | refreshHostView(); |
---|
68 | g_refresh_timer = setTimeout("refresh()", <?php echo $this->scope["refresh"];?> * 1000); |
---|
69 | } else |
---|
70 | ganglia_form.submit(); |
---|
71 | } else |
---|
72 | ganglia_form.submit(); |
---|
73 | } |
---|
74 | |
---|
75 | $(function() { |
---|
76 | g_overlay_events = ($("#overlay_events").val() == "true"); |
---|
77 | |
---|
78 | g_tabIndex = new Object(); |
---|
79 | g_tabName = []; |
---|
80 | var tabName = ["m", "s", "v", "agg", "ch", "ev", "rot", "mob"]; |
---|
81 | var j = 0; |
---|
82 | for (var i in tabName) { |
---|
83 | if (tabName[i] == "ev" && !g_overlay_events) |
---|
84 | continue; |
---|
85 | g_tabIndex[tabName[i]] = j++; |
---|
86 | g_tabName.push(tabName[i]); |
---|
87 | } |
---|
88 | |
---|
89 | // Follow tab's URL instead of loading its content via ajax |
---|
90 | var tabs = $("#tabs"); |
---|
91 | if (tabs[0]) { |
---|
92 | tabs.tabs(); |
---|
93 | // Restore previously selected tab |
---|
94 | var selected_tab = $("#selected_tab").val(); |
---|
95 | //alert("selected_tab = " + selected_tab); |
---|
96 | if (typeof g_tabIndex[selected_tab] != 'undefined') { |
---|
97 | try { |
---|
98 | //alert("Selecting tab: " + selected_tab); |
---|
99 | tabs.tabs("select", g_tabIndex[selected_tab]); |
---|
100 | if (selected_tab == "rot") |
---|
101 | autoRotationChooser(); |
---|
102 | } catch (err) { |
---|
103 | try { |
---|
104 | alert("Error(ganglia.js): Unable to select tab: " + |
---|
105 | selected_tab + ". " + err.getDescription()); |
---|
106 | } catch (err) { |
---|
107 | // If we can't even show the error, fail silently. |
---|
108 | } |
---|
109 | } |
---|
110 | } |
---|
111 | |
---|
112 | tabs.bind("tabsselect", function(event, ui) { |
---|
113 | $("#selected_tab").val(g_tabName[ui.index]); |
---|
114 | if (g_tabName[ui.index] != "mob") |
---|
115 | $.cookie("ganglia-selected-tab-" + window.name, ui.index); |
---|
116 | if (ui.index == g_tabIndex["m"] || |
---|
117 | ui.index == g_tabIndex["v"] || |
---|
118 | ui.index == g_tabIndex["ch"]) |
---|
119 | ganglia_form.submit(); |
---|
120 | }); |
---|
121 | } |
---|
122 | }); |
---|
123 | |
---|
124 | $(function() { |
---|
125 | $("#metrics-picker").combobox(); |
---|
126 | |
---|
127 | <?php echo $this->scope["is_metrics_picker_disabled"];?> |
---|
128 | |
---|
129 | |
---|
130 | $(".header_btn").button(); |
---|
131 | }); |
---|
132 | |
---|
133 | $(function () { |
---|
134 | |
---|
135 | done = function done(startTime, endTime) { |
---|
136 | setStartAndEnd(startTime, endTime); |
---|
137 | document.forms['ganglia_form'].submit(); |
---|
138 | } |
---|
139 | |
---|
140 | cancel = function (startTime, endTime) { |
---|
141 | setStartAndEnd(startTime, endTime); |
---|
142 | } |
---|
143 | |
---|
144 | defaults = { |
---|
145 | startTime: <?php echo $this->scope["start_timestamp"];?>, |
---|
146 | endTime: <?php echo $this->scope["end_timestamp"];?>, |
---|
147 | done: done, |
---|
148 | cancel: cancel |
---|
149 | } |
---|
150 | |
---|
151 | $(".host_small_zoomable").gangZoom($.extend({ |
---|
152 | paddingLeft: 67, |
---|
153 | paddingRight: 30, |
---|
154 | paddingTop: 38, |
---|
155 | paddingBottom: 25 |
---|
156 | }, defaults)); |
---|
157 | |
---|
158 | $(".host_medium_zoomable").gangZoom($.extend({ |
---|
159 | paddingLeft: 67, |
---|
160 | paddingRight: 30, |
---|
161 | paddingTop: 38, |
---|
162 | paddingBottom: 40 |
---|
163 | }, defaults)); |
---|
164 | |
---|
165 | $(".host_default_zoomable").gangZoom($.extend({ |
---|
166 | paddingLeft: 66, |
---|
167 | paddingRight: 30, |
---|
168 | paddingTop: 37, |
---|
169 | paddingBottom: 50 |
---|
170 | }, defaults)); |
---|
171 | |
---|
172 | $(".host_large_zoomable").gangZoom($.extend({ |
---|
173 | paddingLeft: 66, |
---|
174 | paddingRight: 29, |
---|
175 | paddingTop: 37, |
---|
176 | paddingBottom: 56 |
---|
177 | }, defaults)); |
---|
178 | |
---|
179 | $(".cluster_zoomable").gangZoom($.extend({ |
---|
180 | paddingLeft: 67, |
---|
181 | paddingRight: 30, |
---|
182 | paddingTop: 37, |
---|
183 | paddingBottom: 50 |
---|
184 | }, defaults)); |
---|
185 | |
---|
186 | function rrdDateTimeString(date) { |
---|
187 | return (date.getMonth() + 1) + "/" + date.getDate() + "/" + date.getFullYear() + " " + date.getHours() + ":" + date.getMinutes(); |
---|
188 | } |
---|
189 | |
---|
190 | function setStartAndEnd(startTime, endTime) { |
---|
191 | // we're getting local start/end times. |
---|
192 | |
---|
193 | // getTimezoneOffset returns negative values east of UTC, |
---|
194 | // which is the opposite of PHP. we want negative values to the west. |
---|
195 | var local_offset = new Date().getTimezoneOffset() * 60 * -1; |
---|
196 | var delta = local_offset - server_utc_offset; |
---|
197 | var date = new Date((Math.floor(startTime) - delta) * 1000); |
---|
198 | $("#datepicker-cs").val(rrdDateTimeString(date)); |
---|
199 | date = new Date((Math.floor(endTime) - delta) * 1000); |
---|
200 | $("#datepicker-ce").val(rrdDateTimeString(date)); |
---|
201 | } |
---|
202 | |
---|
203 | initShowEvent(); |
---|
204 | initTimeShift(); |
---|
205 | }); |
---|
206 | |
---|
207 | |
---|
208 | </script> |
---|
209 | <?php echo $this->scope["custom_time_head"];?> |
---|
210 | |
---|
211 | </head> |
---|
212 | <body style="background-color: #ffffff;" onunload="g_refresh_timer=null"> |
---|
213 | <?php if (((isset($this->scope["user_header"]) ? $this->scope["user_header"] : null) !== null)) { |
---|
214 | ?> |
---|
215 | <?php echo Dwoo_Plugin_include($this, "user_header.tpl", null, null, null, '_root', null);?> |
---|
216 | |
---|
217 | <?php |
---|
218 | }?> |
---|
219 | |
---|
220 | |
---|
221 | <?php if ((isset($this->scope["auth_system_enabled"]) ? $this->scope["auth_system_enabled"] : null)) { |
---|
222 | ?> |
---|
223 | <div style="float:right"> |
---|
224 | <?php if ((isset($this->scope["username"]) ? $this->scope["username"] : null)) { |
---|
225 | ?> |
---|
226 | Currently logged in as: <?php echo $this->scope["username"];?> | <a href="logout.php">Logout</a> |
---|
227 | <?php |
---|
228 | } |
---|
229 | else { |
---|
230 | ?> |
---|
231 | You are not currently logged in. | <a href="login.php">Login</a> |
---|
232 | <?php |
---|
233 | }?> |
---|
234 | |
---|
235 | </div> |
---|
236 | <br style="clear:both"/> |
---|
237 | <?php |
---|
238 | }?> |
---|
239 | |
---|
240 | |
---|
241 | <div id="tabs"> |
---|
242 | <ul> |
---|
243 | <li><a href="#tabs-main">Main</a></li> |
---|
244 | <li><a href="#tabs-search">Search</a></li> |
---|
245 | <li><a href="#tabs-main">Views</a></li> |
---|
246 | <li><a href="aggregate_graphs.php">Aggregate Graphs</a></li> |
---|
247 | <li><a href="#tabs-main">Compare Hosts</a></li> |
---|
248 | <?php if ((isset($this->scope["overlay_events"]) ? $this->scope["overlay_events"] : null)) { |
---|
249 | ?> |
---|
250 | <li><a href="events.php">Events</a></li> |
---|
251 | <?php |
---|
252 | }?> |
---|
253 | |
---|
254 | <li><a href="#tabs-autorotation" onclick="autoRotationChooser();">Automatic Rotation</a></li> |
---|
255 | <li><a href="#tabs-livedashboard" onclick="liveDashboardChooser();">Live Dashboard</a></li> |
---|
256 | <li><a href="#tabs-mobile" onclick="window.location.href='mobile.php';">Mobile</a></li> |
---|
257 | </ul> |
---|
258 | |
---|
259 | <div id="tabs-main"> |
---|
260 | <form action="<?php echo $this->scope["page"];?>" method="GET" name="ganglia_form"> |
---|
261 | <div style="background-color:#dddddd;padding:5px;"> |
---|
262 | <big style="float:left;"><b id="page_title"><?php echo $this->scope["page_title"];?> for <?php echo $this->scope["date"];?></b></big><input style="float:right;" class="header_btn" type="submit" value="Get Fresh Data"/><div style="clear:both"></div> |
---|
263 | </div> |
---|
264 | <div style="padding:5px 5px 0 5px;"> |
---|
265 | <div style="float:left;" id="range_menu" class="nobr"><?php echo $this->scope["range_menu"];?></div> |
---|
266 | <div style="float:left;" id="custom_range_menu"><?php echo $this->scope["custom_time"];?></div> |
---|
267 | <div style="float:right;"><?php echo $this->scope["additional_buttons"];?> <?php echo $this->scope["alt_view"];?></div> |
---|
268 | <div style="clear:both;"></div> |
---|
269 | </div> |
---|
270 | <div id="sort_menu" style="padding:5px 5px 0 5px;"> |
---|
271 | Metric <select name="m" id="metrics-picker"><?php echo $this->scope["picker_metrics"];?></select> |
---|
272 | <?php echo $this->scope["sort_menu"];?> |
---|
273 | |
---|
274 | </div> |
---|
275 | <?php if ((isset($this->scope["node_menu"]) ? $this->scope["node_menu"] : null) != "") { |
---|
276 | ?> |
---|
277 | <div id="sort_menu" style="padding:5px 5px 0 5px;"> |
---|
278 | <?php echo $this->scope["node_menu"];?> <?php echo $this->scope["additional_filter_options"];?> |
---|
279 | |
---|
280 | </div> |
---|
281 | <?php |
---|
282 | }?> |
---|
283 | |
---|
284 | |
---|
285 | <input type="hidden" name="tab" id="selected_tab" value="<?php echo $this->scope["selected_tab"];?>"> |
---|
286 | <input type="hidden" id="vn" name="vn" value="<?php echo $this->scope["view_name"];?>"> |
---|
287 | <?php if ((isset($this->scope["overlay_events"]) ? $this->scope["overlay_events"] : null)) { |
---|
288 | ?> |
---|
289 | <input type="hidden" id="overlay_events" value="true"> |
---|
290 | <?php |
---|
291 | } |
---|
292 | else { |
---|
293 | ?> |
---|
294 | <input type="hidden" id="overlay_events" value="false"> |
---|
295 | <?php |
---|
296 | }?> |
---|
297 | |
---|
298 | <hr size="1" noshade> |
---|
299 | <!-- End header.tpl --> |
---|
300 | <?php /* end template body */ |
---|
301 | return $this->buffer . ob_get_clean(); |
---|
302 | ?> |
---|