source: trunk/web/addons/toga/templates/overview.tpl @ 119

Last change on this file since 119 was 119, checked in by bastiaans, 18 years ago

web/addons/toga/overview.php, web/addons/toga/index.php, web/addons/toga/templates/overview.tpl:

  • Added clickable filters to joblist
File size: 2.8 KB
Line 
1<BR><BR>
2
3<CENTER>
4<TABLE>
5<TR>
6  <TD>
7    <IMG SRC="{clusterimage}"><BR>
8    reported: {heartbeat}
9  </TD>
10  <TD>
11    <IMG SRC="{pie}">
12  </TD>
13</TR>
14</TABLE>
15
16<BR><BR>
17
18<SCRIPT TYPE="text/javascript">
19        function setSort( sortbyval ) {
20
21                if( sortbyval != document.toga_form.sortby.value ) {
22
23                        document.toga_form.sortby.value = sortbyval;
24                        document.toga_form.sortorder.value = "asc";
25
26                } else {
27
28                        if( document.toga_form.sortorder.value == "desc" )
29                                document.toga_form.sortorder.value = "asc";
30                        else if( document.toga_form.sortorder.value == "asc" )
31                                document.toga_form.sortorder.value = "desc";
32                }
33
34                document.forms['toga_form'].submit();
35        }
36
37        function setFilter( filtername, filterval ) {
38
39                document.toga_form.id.value = '';
40                document.toga_form.queue.value = '';
41                document.toga_form.state.value = '';
42                document.toga_form.user.value = '';
43
44                if( document.toga_form.elements[filtername] ) {
45                        document.toga_form.elements[filtername].value = filterval;
46                }
47
48                document.forms['toga_form'].submit();
49        }
50</SCRIPT>
51
52<FORM NAME="toga_form" ACTION="./" METHOD="GET">
53
54<INPUT TYPE="HIDDEN" NAME="sortby" VALUE="{sortby}">
55<INPUT TYPE="HIDDEN" NAME="sortorder" VALUE="{sortorder}">
56<INPUT TYPE="HIDDEN" NAME="c" VALUE="{clustername}">
57<INPUT TYPE="HIDDEN" NAME="id" VALUE="{f_id}">
58<INPUT TYPE="HIDDEN" NAME="queue" VALUE="{f_queue}">
59<INPUT TYPE="HIDDEN" NAME="state" VALUE="{f_state}">
60<INPUT TYPE="HIDDEN" NAME="user" VALUE="{f_user}">
61
62</FORM>
63
64<TABLE WIDTH="90%" CELLPADDING="8" CELLSPACING="3" BORDER=0>
65<TR CLASS="toga">
66<TH><B><A HREF="#" onClick="setSort( 'id' )">Id</A></B></TH>
67<TH><B><A HREF="#" onClick="setSort( 'state' )">State</A></B></TH>
68<TH><B><A HREF="#" onClick="setSort( 'user' )">User</A></B></TH>
69<TH><B><A HREF="#" onClick="setSort( 'queue' )">Queue</A></B></TH>
70<TH><B><A HREF="#" onClick="setSort( 'name' )">Name</A></B></TH>
71<TH><B><A HREF="#" onClick="setSort( 'req_cpu' )">Requested CPU time</A></B></TH>
72<TH><B><A HREF="#" onClick="setSort( 'req_mem' )">Requested Memory</A></B></TH>
73<TH><B>Current <A HREF="#" onClick="setSort( 'nodes' )">Nodes</A>/<A HREF="#" onClick="setSort( 'cpus' )">Cpus</A></B></TH>
74<TH><B><A HREF="#" onClick="setSort( 'start' )">Started</A></B></TH>
75<TH><B><A HREF="#" onClick="setSort( 'runningtime' )">Runningtime</A></B></TH>
76</TR>
77
78<!-- START BLOCK : node -->
79  <TR CLASS="{nodeclass}">
80    <TD><A HREF="#" onClick="setFilter( 'id', '{id}' )">{id}</A></TD>
81    <TD><A HREF="#" onClick="setFilter( 'state', '{state}' )">{state}</A></TD>
82    <TD><A HREF="#" onClick="setFilter( 'user', '{user}' )">{user}</A></TD>
83    <TD><A HREF="#" onClick="setFilter( 'queue', '{queue}' )">{queue}</A></TD>
84    <TD>{name}</TD>
85    <TD>{req_cpu}</TD>
86    <TD>{req_memory}</TD>
87    <TD>{nodes}/{cpus}</TD>
88    <TD>{started}</TD>
89    <TD>{runningtime}</TD>
90  </TR>
91<!-- END BLOCK : node -->
92</TABLE>
93</CENTER>
Note: See TracBrowser for help on using the repository browser.