vigiboard / vigiboard / templates / vigiboard_event_table.html @ 20367931
History | View | Annotate | Download (6.07 KB)
1 |
<html xmlns:py="http://genshi.edgewall.org/" |
---|---|
2 |
xmlns:xi="http://www.w3.org/2001/XInclude" |
3 |
py:strip=""> |
4 |
|
5 |
<py:def function="event_table(events,page,pages,id_first_row,id_last_row,total_row,edit_event_status_options)"> |
6 |
<?python from genshi import HTML ?>
|
7 |
|
8 |
<div style="text-align: right"> |
9 |
<a id="SearchLien" href="javascript:vigiboard_searchdialog()"> |
10 |
<img src="${tg.url('/images/vigiboard/filter.png')}" /> |
11 |
</a>
|
12 |
</div>
|
13 |
<py:if test="len(events) > 1"> |
14 |
<table class="vigitable"> |
15 |
|
16 |
<thead>
|
17 |
<tr>
|
18 |
<td style="width:27px"> |
19 |
<a py:if="page > pages[0]" href="${tg.url('%d' % (page-1))}"><img src="${tg.url('/images/vigiboard/fleche_up.png')}" alt="" /></a> |
20 |
<img py:if="page == pages[0]" src="${tg.url('/images/vigiboard/fleche_up.png')}" alt="" /> |
21 |
</td>
|
22 |
<td colspan="${8+len(events[1][6])}" style="background-color:#4682B4;color:white;text-align:center">Showing rows ${id_first_row} to ${id_last_row} of ${total_row}<br /> |
23 |
Pages <py:for each="p in pages"> |
24 |
<a py:if="p != page" href="${tg.url('%d' % p)}" py:content="p" /> |
25 |
<span py:if="p == page" py:replace="p" /> |
26 |
</py:for>
|
27 |
</td>
|
28 |
<td style="width:27px"> |
29 |
<a py:if="pages[-1] > page" href="${tg.url('%d' % (page+1))}"><img src="${tg.url('/images/vigiboard/fleche_down.png')}" alt="" /></a> |
30 |
<img py:if="page == pages[-1]" src="${tg.url('/images/vigiboard/fleche_down.png')}" alt="" /> |
31 |
</td>
|
32 |
</tr>
|
33 |
<tr style="background-color:#F8F8F8;font-weight: bold"> |
34 |
<td py:for="item in events[0]">${HTML(item)}</td> |
35 |
<td><a class="Edit_EventsLien" href="javascript:vigiboard_edit_eventdialog('all')"><img src="${tg.url('/images/vigiboard/icon_page_edit.png')}" /></a></td> |
36 |
<td><input id="vigiboard_checkall_checkbox" type="checkbox" onclick="javascript:vigiboard_checkall()" /></td> |
37 |
</tr>
|
38 |
</thead>
|
39 |
|
40 |
<tbody>
|
41 |
|
42 |
<py:for each="(event,class_tr,class_td_severity,class_td_date,img_fleche,img_statu,plugin) in events[1:]"> |
43 |
<tr py:attrs="class_tr"> |
44 |
<td py:attrs="class_td_severity"><a href="javascript:vigiboard_historydialog('${event.idevent}')" class="HistoryLien"><img src="${tg.url(img_fleche['src'])}" style="width:20px"/></a></td> |
45 |
<td py:attrs="class_td_date">${event.GetDate('timestamp_active')}<br />[${event.GetSinceDate('timestamp_active')}]</td> |
46 |
<td py:attrs="class_td_date">${event.occurence}</td> |
47 |
<td>${event.hostname}</td> |
48 |
<td>${event.servicename}</td> |
49 |
<td>${event.output}</td> |
50 |
<td py:for="plug in plugin" py:attrs="plug[1]">${plug[0]}</td> |
51 |
<td>${event.trouble_ticket}</td> |
52 |
<td><img py:attrs="img_statu" py:if="img_statu != None" /></td> |
53 |
<td py:attrs="class_td_date"><a class="Edit_EventsLien" href="javascript:vigiboard_edit_eventdialog('${event.idevent}')"><img src="${tg.url('/images/vigiboard/icon_page_edit.png')}" /></a></td> |
54 |
<td py:attrs="class_td_date"><input type="checkbox" class="Edit_EventsCheckBox" value="${event.idevent}"/></td> |
55 |
|
56 |
</tr>
|
57 |
</py:for>
|
58 |
|
59 |
</tbody>
|
60 |
|
61 |
</table>
|
62 |
|
63 |
${tmpl_context.historydialog()} |
64 |
${tmpl_context.edit_eventdialog()} |
65 |
${tmpl_context.searchdialog()} |
66 |
|
67 |
<script type="text/javascript"> |
68 |
function vigiboard_historydialog(idd) {
|
69 |
$.getJSON("${tg.url('HistoryDialog')}",{id:idd},function(json){
|
70 |
$('#HistoryDialog_initial_state').html(json.initial_state);
|
71 |
$('#HistoryDialog_current_state').html(json.current_state);
|
72 |
$('#HistoryDialog_detailed_event').attr('href' , '${tg.url('event/')}' + json.idevent);
|
73 |
$('#HistoryDialog_detailed_host').attr('href', '${tg.url('host_service/')}' + json.host + "/" + json.service);
|
74 |
$('#HistoryDialog_nagios').attr('href', json.nagios_link);
|
75 |
$('#HistoryDialog_metrology').attr('href', json.metrology_link);
|
76 |
$('#HistoryDialog_security').attr('href', json.security_link);
|
77 |
$('#HistoryDialog_servicetype').attr('href', json.servicetype_link);
|
78 |
$('#HistoryDialog').dialog('open');
|
79 |
})
|
80 |
}
|
81 |
function vigiboard_edit_eventdialog(idd) {
|
82 |
$('#edit_event_form_comment').attr('value','');
|
83 |
$('#edit_event_form_trouble_ticket').attr('value','');
|
84 |
$('#edit_event_form_tt_create').attr('checked',false);
|
85 |
$('#edit_event_form_status').find('option:first').attr('selected', 'selected').parent('select');;
|
86 |
if ( idd == 'all' ) {
|
87 |
var a = '';
|
88 |
$('.Edit_EventsCheckBox').each(function() {
|
89 |
if ( $(this).attr('checked'))
|
90 |
a += $(this).attr('value') + ',';
|
91 |
});
|
92 |
idd = a;
|
93 |
}
|
94 |
$('#edit_event_form_id').attr('value',idd);
|
95 |
$('#Edit_EventsDialog').dialog('open');
|
96 |
}
|
97 |
function vigiboard_searchdialog() {
|
98 |
$('#search_form_host').attr('value','');
|
99 |
$('#search_form_service').attr('value','');
|
100 |
$('#search_form_output').attr('value','');
|
101 |
$('#search_form_trouble_ticket').attr('value', '');
|
102 |
$('#SearchDialog').dialog('open');
|
103 |
}
|
104 |
function vigiboard_checkall() {
|
105 |
var val = $('#vigiboard_checkall_checkbox').attr('checked');
|
106 |
$('input[type=checkbox]').each(function(){$(this).attr('checked',val);});
|
107 |
}
|
108 |
$('.HistoryLien').each(function() {
|
109 |
$(this).click(function(e){
|
110 |
$('#HistoryDialog').dialog('option','position',[e.clientX+10,e.clientY]);
|
111 |
})});
|
112 |
$('.Edit_EventsLien').each(function() {
|
113 |
$(this).click(function(e){
|
114 |
$('#Edit_EventsDialog').dialog('option','position',[e.clientX-400-20,e.clientY]);
|
115 |
})});
|
116 |
$('#SearchLien').click(function(e){
|
117 |
$('#SearchDialog').dialog('option','position','center');
|
118 |
});
|
119 |
|
120 |
|
121 |
</script>
|
122 |
|
123 |
<div id="HistoryDialog"> |
124 |
Initial State: <span id="HistoryDialog_initial_state" /><br /> |
125 |
Current State: <span id="HistoryDialog_current_state" /><br /> |
126 |
<ul>
|
127 |
<li><a id="HistoryDialog_detailed_event" href="" >Detailed history for this event</a></li> |
128 |
<li><a id="HistoryDialog_detailed_host" href="" >Detailed history for this host/service</a></li> |
129 |
<li><a id="HistoryDialog_nagios" href="" >Nagios host details</a></li> |
130 |
<li><a id="HistoryDialog_metrology" href="" >Metrology details</a></li> |
131 |
<li><a id="HistoryDialog_security" href="" >Security details</a></li> |
132 |
<li><a id="HistoryDialog_servicetype" href="" >Service Type</a></li> |
133 |
</ul>
|
134 |
</div>
|
135 |
|
136 |
<div id="Edit_EventsDialog"> |
137 |
${tmpl_context.edit_event_form()} |
138 |
</div>
|
139 |
<div id="SearchDialog"> |
140 |
${tmpl_context.search_form()} |
141 |
</div>
|
142 |
|
143 |
</py:if>
|
144 |
|
145 |
<py:if test="1 >= len(events)"> |
146 |
Aucun évènement disponible. |
147 |
</py:if>
|
148 |
|
149 |
</py:def>
|
150 |
|
151 |
</html>
|