source: branches/0.4/web/addons/job_monarch/dwoo/compiled/templates/job_monarch/header.tpl.d17.php @ 755

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