source: branches/1.0/web/addons/job_monarch/templates/search.tpl @ 880

Last change on this file since 880 was 880, checked in by ramonb, 8 years ago

libtoga.php:

  • allow searchDbase query to include running jobs

templates/search.tpl:

  • added "include running jobs" checkbox

search.php:

  • pass include running option submit to searchDbase
  • some modifications to start/stop times for running jobs
  • closes #167
File size: 9.9 KB
Line 
1<CENTER>
2
3<SCRIPT LANGUAGE="javascript">
4function setSort( sortbyval ) {
5
6        if( sortbyval != document.archive_search_form.sortby.value ) {
7
8                document.archive_search_form.sortby.value = sortbyval;
9                document.archive_search_form.sortorder.value = "asc";
10
11        } else {
12
13                if( document.archive_search_form.sortorder.value == "desc" )
14                        document.archive_search_form.sortorder.value = "asc";
15                else if( document.archive_search_form.sortorder.value == "asc" )
16                        document.archive_search_form.sortorder.value = "desc";
17        }
18
19        document.forms['archive_search_form'].submit();
20}
21
22function setFilter( filtername, filterval ) {
23
24        var myfilterorder = document.archive_search_form.elements['filterorder'].value;
25
26        if( document.archive_search_form.elements[filtername] ) {
27                document.archive_search_form.elements[filtername].value = filterval;
28                if( myfilterorder != '')
29                        myfilterorder = myfilterorder + "," + filtername;
30                else
31                        myfilterorder = filtername;
32
33        }
34        document.archive_search_form.elements['filterorder'].value = myfilterorder;
35
36        //setTimeout( "document.forms['archive_search_form'].submit();", 1000 );
37
38        document.forms['archive_search_form'].submit();
39}
40</SCRIPT>
41<SCRIPT LANGUAGE="javascript">
42
43        function setSearchTimestamps() {
44
45                document.archive_search_form.start_from_time.value = document.archive_search_form.start_from_pick.value;
46                document.archive_search_form.start_to_time.value = document.archive_search_form.start_to_pick.value;
47                document.archive_search_form.end_from_time.value = document.archive_search_form.end_from_pick.value;
48                document.archive_search_form.end_to_time.value = document.archive_search_form.end_to_pick.value;
49        }
50
51</SCRIPT>
52
53<!-- <FORM NAME="archive_search_form" ACTION="./"> -->
54
55<!-- <INPUT TYPE="hidden" NAME="view" VALUE="search"> -->
56
57<BR><BR>
58
59<TABLE WIDTH="100%">
60
61<TR>
62  <TD CLASS=title COLSPAN="2">
63  <B>Search job archive</B>
64  </TD>
65</TR>
66
67</TABLE>
68
69<BR><BR>
70
71<TABLE WIDTH="90%">
72
73<TR>
74  <TD></TD>
75  <TD></TD>
76  <TD></TD>
77  <TD></TD>
78  <TD></TD>
79  <TD></TD>
80</TR>
81
82<TR>
83
84  <TD>
85  Id:
86  </TD>
87  <TD>
88  <INPUT TYPE="TEXT" NAME="id" VALUE="{$id_value}">
89  </TD>
90
91</TR>
92
93<TR>
94
95  <TD>
96  User:
97  </TD>
98  <TD>
99  <INPUT TYPE="TEXT" NAME="owner" VALUE="{$owner_value}">
100  </TD>
101
102  <TD>
103  Queue:
104  </TD>
105  <TD>
106  <INPUT TYPE="TEXT" NAME="queue" VALUE="{$queue_value}">
107  </TD>
108
109  <TD>
110  Name:
111  </TD>
112  <TD>
113  <INPUT TYPE="TEXT" NAME="name" VALUE="{$name_value}">
114  </TD>
115
116</TR>
117
118<TR>
119
120  <TD></TD>
121  <TD>
122  Job <B>start</B>
123  </TD>
124
125  <TD>
126  From:
127  </TD>
128  <TD>
129  <INPUT TYPE="HIDDEN" NAME="start_from_time" VALUE="{$start_from_value}">
130  <INPUT TYPE="TEXT" NAME="start_from_pick" VALUE="{$start_from_value}" DISABLED="TRUE">
131  <A HREF="javascript:show_calendar('document.archive_search_form.start_from_pick', document.archive_search_form.start_from_pick.value );">
132  <IMG SRC="cal.gif" width="16" height="16" border="0" title="Click to select a date/time" alt="Click to select a date/time"></a>
133  <a href="#" onClick="document.archive_search_form.start_from_pick.value=''" alt="Click here to clear field" title="Click here to clear field"><IMG SRC="redcross.jpg" BORDER=0></A>
134  </TD>
135 
136  <TD>
137  To:
138  </TD>
139  <TD>
140  <INPUT TYPE="HIDDEN" NAME="start_to_time" VALUE="{$start_to_value}">
141  <INPUT TYPE="TEXT" NAME="start_to_pick" VALUE="{$start_to_value}" DISABLED="TRUE">
142  <a href="javascript:show_calendar('document.archive_search_form.start_to_pick', document.archive_search_form.start_to_pick.value );">
143  <img src="cal.gif" width="16" height="16" border="0" title="Click to select a date/time" alt="Click to select a date/time"></a>
144  <a href="#" onClick="document.archive_search_form.start_to_pick.value=''" alt="Click here to clear field" title="Click here to clear field">
145  <IMG SRC="redcross.jpg" BORDER=0></A>
146  </TD>
147 
148</TR>
149
150<TR>
151
152  <TD></TD>
153  <TD>
154  Job <B>finish</B>
155  </TD>
156
157  <TD>
158  From:
159  </TD>
160  <TD>
161  <INPUT TYPE="HIDDEN" NAME="end_from_time" VALUE="{$end_from_value}">
162  <INPUT TYPE="TEXT" NAME="end_from_pick" VALUE="{$end_from_value}" DISABLED="TRUE">
163  <A HREF="javascript:show_calendar('document.archive_search_form.end_from_pick', document.archive_search_form.end_from_pick.value );">
164  <IMG SRC="cal.gif" width="16" height="16" border="0" title="Click to select a date/time" alt="Click to select a date/time"></a>
165  <a href="#" onClick="document.archive_search_form.end_from_pick.value=''" alt="Click here to clear field" title="Click here to clear field">
166  <IMG SRC="redcross.jpg" BORDER=0></A>
167  </TD>
168 
169  <TD>
170  To:
171  </TD>
172  <TD>
173  <INPUT TYPE="HIDDEN" NAME="end_to_time" VALUE="{$end_to_value}">
174  <INPUT TYPE="TEXT" NAME="end_to_pick" VALUE="{$end_to_value}" DISABLED="TRUE">
175  <a href="javascript:show_calendar('document.archive_search_form.end_to_pick', document.archive_search_form.end_to_pick.value );">
176  <img src="cal.gif" width="16" height="16" border="0" title="Click to select a date/time" alt="Click to select a date/time"></a>
177  <a href="#" onClick="document.archive_search_form.end_to_pick.value=''" alt="Click here to clear field" title="Click here to clear field">
178  <IMG SRC="redcross.jpg" BORDER=0></A>
179  </TD>
180 
181</TR>
182
183<TR>
184
185  <TD></TD>
186  <TD></TD>
187  <TD></TD>
188  <TD></TD>
189  <TD><input type="checkbox" name="include_running" {$running_checked}>Include running jobs</TD>
190  <TD>
191  <INPUT TYPE="submit" VALUE="Search archive" onClick="setSearchTimestamps();">
192  </TD>
193
194</TR>
195
196</TABLE>
197{$form_error_msg}<BR><BR>
198
199{if "$search_results" == "yes" }
200
201<INPUT TYPE="HIDDEN" NAME="sortby" VALUE="{$sortby}">
202<INPUT TYPE="HIDDEN" NAME="sortorder" VALUE="{$sortorder}">
203<INPUT TYPE="HIDDEN" NAME="filterorder" VALUE="{$order}">
204
205<TABLE WIDTH="100%" CELLPADDING="2" CELLSPACING="2" BORDER=0>
206<TR CLASS="monarch">
207<TH><B><A HREF="#" onClick="setSort( 'id' )" ALT="Jobid" TITLE="Jobid">Id</A></B></TH>
208<TH><B><A HREF="#" onClick="setSort( 'state' )" ALT="State" TITLE="State">S</A></B></TH>
209<TH><B><A HREF="#" onClick="setSort( 'owner' )">Owner</A></B></TH>
210<TH><B><A HREF="#" onClick="setSort( 'queue' )">Queue</A></B></TH>
211<TH><B><A HREF="#" onClick="setSort( 'name' )" ALT="Jobname" TITLE="Jobname">Name</A></B></TH>
212<TH><B><A HREF="#" onClick="setSort( 'req_cpu' )" ALT="Requested CPU Time (walltime)" TITLE="Requested CPU Time (walltime)">Req. CPU time</A></B></TH>
213{if "$column_header_req_mem" == "yes"}
214<TH><B><A HREF="#" onClick="setSort( 'req_mem' )" ALT="Requested Memory" TITLE="Requested Memory">Req. Memory</A></B></TH>
215{/if}
216<TH><B><A HREF="#" onClick="setSort( 'nodes' )" ALT="Nodes" TITLE="Nodes">N</A>/<A HREF="#" onClick="setSort( 'cpus' )" ALT="Processors" TITLE="Processors">P</A></B></TH>
217{if "$column_header_nodes" == "yes"}
218<TH><B><A HREF="#" onClick="setSort( 'nodes' )" ALT="Nodes" TITLE="Nodes">Nodes</A></B></TH>
219{/if}
220<TH><B><A HREF="#" onClick="setSort( 'start' )">Started</A></B></TH>
221<TH><B><A HREF="#" onClick="setSort( 'finished' )">Finished</A></B></TH>
222<TH><B><A HREF="#" onClick="setSort( 'runningtime' )">Runningtime</A></B></TH>
223</TR>
224
225{loop $node_list}
226  <TR CLASS="{$nodeclass}">
227    <TD><A HREF="#" onClick="setFilter( 'id', '{$id}' )">{$id}</A></TD>
228    <TD><A HREF="#" onClick="setFilter( 'state', '{$state}' )">{$state}</A></TD>
229    <TD><A HREF="#" onClick="setFilter( 'owner', '{$owner}' )">{$owner}</A></TD>
230    <TD><A HREF="#" onClick="setFilter( 'queue', '{$queue}' )">{$queue}</A></TD>
231    <TD ALT="{$fulljobname}" TITLE="{$fulljobname}">
232{if "$jobname_hint_start" == "yes"}
233    <FONT CLASS="jobname_hint">
234{/if}
235    {$name}
236{if "$jobname_hint_end" == "yes"}
237    </FONT>
238{/if}
239    </TD>
240    <TD>{$req_cpu}</TD>
241{if "$column_req_mem" == "yes"}
242    <TD>{$req_memory}</TD>
243{/if}
244    <TD>{$nodes}/{$cpus}</TD>
245{if "$column_nodes_hostnames" == "yes"}
246    <TD>{$nodes_hostnames}</TD>
247{/if}
248    <TD>{$started}</TD>
249    <TD>{$finished}</TD>
250    <TD>{$runningtime}</TD>
251  </TR>
252{/loop}
253</TABLE>
254</CENTER>
255
256{if "$showhosts" == "yes" }
257<TABLE BORDER="0" WIDTH="100%">
258<TR>
259  <TD CLASS=title COLSPAN="2">
260  <FONT SIZE="-1">
261  Show Hosts:
262  yes<INPUT type=radio name="sh" value="1" OnClick="archive_search_form.submit();" {$checked1}>
263  no<INPUT type=radio name="sh" value="0" OnClick="archive_search_form.submit();" {$checked0}>
264  </FONT>
265{if "$timeperiod" == "yes"}
266    <INPUT TYPE="HIDDEN" NAME="period_start" VALUE="{$period_start}">
267    <INPUT TYPE="HIDDEN" NAME="period_stop" VALUE="{$period_stop}">
268    <BR><B>Graph {$metric_menu} from
269    <INPUT TYPE="text" NAME="period_start_pick" VALUE="{$period_start}" ALT="Start time" DISABLED="TRUE">
270    <a href="javascript:show_calendar('document.{$form_name}.period_start_pick', document.{$form_name}.period_start_pick.value);" alt="Click to select a date/time" title="Click to select a date/time">
271    <img src="cal.gif" width="16" height="16" border="0"></a>
272    <a href="#" onClick="javascript: document.{$form_name}.period_start_pick.value=''" alt="Click here to clear field" title="Click here to clear field">
273    <IMG SRC="redcross.jpg" BORDER=0></A>
274    to <INPUT TYPE="text" NAME="period_stop_pick" VALUE="{$period_stop}" ALT="Stop time" DISABLED="TRUE">
275    <a href="javascript:show_calendar('document.{$form_name}.period_stop_pick', document.{$form_name}.period_stop_pick.value);" alt="Click to select a date/time" title="Click to select a date/time">
276    <img src="cal.gif" width="16" height="16" border="0"></a>
277    <a href="#" onClick="javascript: document.{$form_name}.period_stop_pick.value=''" alt="Click here to clear field" title="Click here to clear field">
278    </B>
279    <IMG SRC="redcross.jpg" BORDER=0></A>
280
281{if "$hostview" == "yes"}
282    <INPUT TYPE="HIDDEN" NAME="job_start" VALUE="{$job_start}">
283    <INPUT TYPE="HIDDEN" NAME="job_stop" VALUE="{$job_stop}">
284{/if}
285    <INPUT TYPE="submit" onClick="setPeriodTimestamps();" VALUE="Refresh graphs">
286{/if}
287  </TD>
288</TR>
289
290</TABLE>
291
292<CENTER>
293
294<div id="monarchimage">
295{loop $sorted_list}
296{$metric_image}
297{/loop}
298</div>
299
300</CENTER>
301
302{/if}
303{/if}
304</CENTER>
Note: See TracBrowser for help on using the repository browser.