d9cc923f373e3a7869742d2769dcb5c14065bb32
[monitor.git] / web / MonitorWeb / monitorweb / templates / actionlist.kid
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2 <?python
3 layout_params['page_title'] = "Monitor Node View"
4 from monitor.util import diff_time
5 from monitor import config
6 from time import mktime
7 from links import *
8
9 def zabbix_event_ack_link(eventid):
10         return "http://" + config.MONITOR_HOSTNAME + "/zabbix/acknow.php?eventid=" + str(eventid)
11
12 ?>
13 <html py:layout="'sitemenu.kid'"
14       xmlns:py="http://purl.org/kid/ns#"
15           xmlns:mochi="http://www.mochi.org">
16
17   <div py:match="item.tag == 'content'">
18         <table width="100%">
19                 <thead>
20                         <tr>
21                                 <th></th>
22                                 <th><a href="${tg.url('action', filter='active')}">Not Acknowledged(${fc['active']})</a></th>
23                                 <th><a href="${tg.url('action', filter='acknowledged')}">Acknowledged(${fc['acknowledged']})</a></th>
24                                 <th><a href="${tg.url('action', filter='all')}">All(${fc['all']})</a></th>
25                         </tr>
26                 </thead>
27                 <tbody>
28                 <tr>
29                 <td colspan="5">
30                 <table id="sortable_table" class="datagrid" border="1" width="100%">
31                         <thead>
32                                 <tr>
33                                         <th mochi:format="int"></th>
34                                         <th mochi:format="str">Site</th>
35                                         <th>Hostname</th>
36                                         <th>Issue (severity)</th>
37                                         <th>Last change</th>
38                                         <th>Notes (acknowledged)</th>
39                                         <th></th>
40                                 </tr>
41                         </thead>
42                         <tbody>
43                                 <tr py:for="i,node in enumerate(query)" class="${i%2 and 'odd' or 'even'}" >
44                                         <td></td>
45                                         <td><a href="${link('pcuview', loginbase=node[0])}">${node[0]}</a></td>
46                                         <td nowrap="true" py:content="node[1]"></td>
47                                         <td nowrap='true' id="severity-${node[3]}" py:content="node[2]"></td>
48                                         <td nowrap='true' py:content="diff_time(int(node[4]))"></td>
49                                         <?python
50                                                 try:
51                                                         int(node[5])
52                                                         val = True
53                                                 except:
54                                                         val = False
55                                         ?>
56                                         <!-- NOTE: only one of the next two columns will be displayed. -->
57                                         <td py:if="val"><a href="${zabbix_event_ack_link(node[5])}">Provide Ack</a></td>
58                                         <td py:if="not val" py:content="node[5]">Message from user</td>
59                                         <td py:if="not val"><a href="${zabbix_event_ack_link(node[6])}">Add</a></td>
60                                 </tr>
61                         </tbody>
62                 </table>
63                 </td>
64                 </tr>
65                 </tbody>
66         </table>
67   </div>
68
69 </html>