vigiboard / vigiboard / templates / vigiboard_event_table.html @ 693e96f1
History | View | Annotate | Download (9 KB)
1 |
<html xmlns:py="http://genshi.edgewall.org/" |
---|---|
2 |
xmlns:xi="http://www.w3.org/2001/XInclude" |
3 |
py:strip=""> |
4 |
|
5 |
|
6 |
<xi:include href="vigiboard_history_table.html" /> |
7 |
|
8 |
<py:def function="event_table(events,page,pages,id_first_row,id_last_row,total_row,edit_event_status_options,history,hist_error,search)"> |
9 |
<?python from genshi import HTML ?>
|
10 |
|
11 |
<py:if test="len(events) > 1"> |
12 |
<table class="vigitable" summary="Tableau des évènements"> |
13 |
|
14 |
<thead>
|
15 |
<tr > |
16 |
<td style="width:26px;border-right: solid 1px #4682b4"> |
17 |
<a py:if="page > pages[0]" href="${tg.url('/%d' % (page-1))}"><img src="${tg.url('/images/fleche_up.png')}" alt="Précédent" title="Page précédente"/></a> |
18 |
<img py:if="page == pages[0]" src="${tg.url('/images/fleche_up.png')}" alt="Précédent" title="Page précédente" /> |
19 |
</td>
|
20 |
<td colspan="${8+len(events[1][6])}" style="color: white;background-color: #4682b4" >Showing rows ${id_first_row} to ${id_last_row} of ${total_row}<br /> |
21 |
Pages <py:for each="p in pages"> |
22 |
<a py:if="p != page" href="${tg.url('/%d' % p)}" py:content="p" /> |
23 |
<span py:if="p == page" py:replace="p" /> |
24 |
</py:for>
|
25 |
</td>
|
26 |
<td style="width:26px;border-left: solid 1px #4682b4"> |
27 |
<a py:if="pages[-1] > page" href="${tg.url('/%d' % (page+1))}"><img src="${tg.url('/images/fleche_down.png')}" alt="Suivante" title="Page suivante"/></a> |
28 |
<img py:if="page == pages[-1]" src="${tg.url('/images/fleche_down.png')}" alt="" title="Page suivante" /> |
29 |
</td>
|
30 |
</tr>
|
31 |
|
32 |
<tr>
|
33 |
<py:for each="(pname,pstyle) in events[0]"> |
34 |
<th style="padding: 5px;" py:attrs="pstyle">${HTML(pname)}</th> |
35 |
</py:for>
|
36 |
<th style="width:26px;padding: 0px;"><a class="Edit_EventsLien" href="javascript:vigiboard_edit_eventdialog('all')"><img src="${tg.url('/images/icon_page_edit.png')}" alt="Edit all selected events" title="Edit all selected events"/></a></th> |
37 |
<th style="padding:0px;"><input title="Sélectioner tout" id="vigiboard_checkall_checkbox" type="checkbox" onclick="javascript:vigiboard_checkall()" /></th> |
38 |
</tr>
|
39 |
</thead>
|
40 |
|
41 |
<tbody>
|
42 |
|
43 |
<py:for each="(event,class_tr,class_td_severity,class_td_date,img_fleche,img_statu,plugin) in events[1:]"> |
44 |
<tr py:attrs="class_tr"> |
45 |
<td style="padding: 3px;" py:attrs="class_td_severity"><a href="javascript:vigiboard_historydialog('${event.idevent}')" class="HistoryLien"><img src="${tg.url(img_fleche['src'])}" style="width:20px" alt="detail" title="Détails sur l'évènement" /></a></td> |
46 |
<td py:attrs="class_td_date"><span style="font-weight: bold;">${event.get_date('timestamp_active')}</span><br />[${event.get_since_date('timestamp_active')}]</td> |
47 |
<td py:attrs="class_td_date" style="text-align:center">${event.occurence}</td> |
48 |
<td>${event.hostname}</td> |
49 |
<td>${event.servicename}</td> |
50 |
<td>${event.output}</td> |
51 |
<td py:for="plug in plugin" py:attrs="plug[1]">${HTML(plug[0])}</td> |
52 |
<td style="text-align: center"><a py:if="event.trouble_ticket is not None" href="${ |
53 |
tg.config['vigiboard_links.tt'] % {
|
54 |
'idevent' : event.idevent,
|
55 |
'host' : event.hostname,
|
56 |
'service' : event.servicename,
|
57 |
'tt' : event.trouble_ticket }}">[${event.trouble_ticket}]</a></td> |
58 |
<td style="text-align: center"><img py:attrs="img_statu" py:if="img_statu != None" alt="statut" title="Statut de l'évènement"/></td> |
59 |
<td py:attrs="class_td_date" style="padding: 0px;text-align: center"><a class="Edit_EventsLien" href="javascript:vigiboard_edit_eventdialog('${event.idevent}')"><img src="${tg.url('/images/icon_page_edit.png')}" alt="edit" title="Editer cet élément"/></a></td> |
60 |
<td py:attrs="class_td_date" style="padding:0px;text-align: center"><input type="checkbox" class="Edit_EventsCheckBox" value="${event.idevent}"/></td> |
61 |
|
62 |
</tr>
|
63 |
<py:if test="hist_error == True"> |
64 |
<tr><td colspan="${10+len(plugin)}"> |
65 |
${history_table(history[event.idevent],hist_error)} |
66 |
</td></tr> |
67 |
</py:if>
|
68 |
</py:for>
|
69 |
|
70 |
</tbody>
|
71 |
|
72 |
</table>
|
73 |
|
74 |
${tmpl_context.edit_eventdialog()} |
75 |
${tmpl_context.searchdialog} |
76 |
${tmpl_context.historydialog} |
77 |
<py:for each="fct,tpl in plugin_context"> |
78 |
${fct()} |
79 |
<xi:include href="vigiboard_plugin/${tpl}.html" /> |
80 |
</py:for>
|
81 |
|
82 |
<script type="text/javascript"> |
83 |
function vigiboard_historydialog(idd) {
|
84 |
$.getJSON("${tg.url('/history_dialog')}",{idevent:idd},function(json){
|
85 |
$('#HistoryDialog_initial_state').html(json.initial_state);
|
86 |
$('#HistoryDialog_current_state').html(json.current_state);
|
87 |
$('#HistoryDialog_detailed_event').attr('href' , '${tg.url('/event/')}' + json.idevent);
|
88 |
$('#HistoryDialog_detailed_host').attr('href', '${tg.url('/host_service/')}' + json.host + "/" + json.service);
|
89 |
<py:for each="edname, edit in tg.config['vigiboard_links.eventdetails'].iteritems()">
|
90 |
$('#HistoryDialog_${edname}').attr('href', json.eventdetails['${edname}']);
|
91 |
</py:for>
|
92 |
$('#HistoryDialog').dialog('open');
|
93 |
})
|
94 |
}
|
95 |
function vigiboard_edit_eventdialog(idd) {
|
96 |
$('#edit_event_form_comment').attr('value','');
|
97 |
$('#edit_event_form_trouble_ticket').attr('value','');
|
98 |
$('#edit_event_form_tt_create').attr('checked',false);
|
99 |
$('#edit_event_form_status').find('option:first').attr('selected', 'selected').parent('select');;
|
100 |
if ( idd == 'all' ) {
|
101 |
var a = '';
|
102 |
$('.Edit_EventsCheckBox').each(function() {
|
103 |
if ( $(this).attr('checked'))
|
104 |
a += $(this).attr('value') + ',';
|
105 |
});
|
106 |
idd = a;
|
107 |
}
|
108 |
$('#edit_event_form_id').attr('value',idd);
|
109 |
$('#Edit_EventsDialog').dialog('open');
|
110 |
}
|
111 |
function vigiboard_searchdialog() {
|
112 |
$('#search_form_host').attr('value','${search['host']}');
|
113 |
$('#search_form_service').attr('value','${search['service']}');
|
114 |
$('#search_form_output').attr('value','${search['output']}');
|
115 |
$('#search_form_trouble_ticket').attr('value', '${search['tt']}');
|
116 |
$('#SearchDialog').dialog('open');
|
117 |
}
|
118 |
function vigiboard_checkall() {
|
119 |
var val = $('#vigiboard_checkall_checkbox').attr('checked');
|
120 |
$('input[type=checkbox]').each(function(){$(this).attr('checked',val);});
|
121 |
}
|
122 |
$('.HistoryLien').each(function() {
|
123 |
$(this).click(function(e){
|
124 |
$('#HistoryDialog').dialog('option','position',[e.clientX+10,e.clientY]);
|
125 |
})});
|
126 |
$('.Edit_EventsLien').each(function() {
|
127 |
$(this).click(function(e){
|
128 |
$('#Edit_EventsDialog').dialog('option','position',[e.clientX-400-20,e.clientY]);
|
129 |
})});
|
130 |
$('#SearchLien').click(function(e){
|
131 |
$('#SearchDialog').dialog('option','position','center');
|
132 |
});
|
133 |
|
134 |
|
135 |
</script>
|
136 |
|
137 |
<div style="display:none" id="HistoryDialog"> |
138 |
Initial State: <span id="HistoryDialog_initial_state" /><br /> |
139 |
Current State: <span id="HistoryDialog_current_state" /><br /> |
140 |
<ul>
|
141 |
<li><a id="HistoryDialog_detailed_event" href="#" >Detailed history for this event</a></li> |
142 |
<li><a id="HistoryDialog_detailed_host" href="#" >Detailed history for this host/service</a></li> |
143 |
<li py:for="edname, edit in tg.config['vigiboard_links.eventdetails'].iteritems()"> |
144 |
<a href="#" id="HistoryDialog_${edname}">${edit[0]}</a> |
145 |
</li>
|
146 |
</ul>
|
147 |
</div>
|
148 |
|
149 |
<div style="display:none" id="Edit_EventsDialog"> |
150 |
${tmpl_context.edit_event_form()} |
151 |
</div>
|
152 |
<div style="display:none" id="SearchDialog"> |
153 |
${tmpl_context.search_form()} |
154 |
</div>
|
155 |
|
156 |
</py:if>
|
157 |
|
158 |
<py:if test="1 >= len(events)"> |
159 |
<table class="vigitable"> |
160 |
|
161 |
<thead>
|
162 |
<tr > |
163 |
<td style="width:26px;background-color: rgb(70, 130, 180);"> |
164 |
<img src="${tg.url('/images/fleche_up.png')}" alt="up" title="Page précédente"/> |
165 |
</td>
|
166 |
<td colspan="9" style="width:100%;background-color:#4682B4;color:white;text-align:center">Showing rows 0 to 0 of 0<br /> |
167 |
Page 0 |
168 |
</td>
|
169 |
<td style="width:26px"> |
170 |
<img src="${tg.url('/images/fleche_down.png')}" alt="down" title="Page suivante" /> |
171 |
</td>
|
172 |
</tr>
|
173 |
|
174 |
<tr style="background-color:#F8F8F8;font-weight: bold"> |
175 |
<py:for each="(pname,pstyle) in events[0]"> |
176 |
<td py:attrs="pstyle">${HTML(pname)}</td> |
177 |
</py:for>
|
178 |
<td style="text-align: center;"><img src="${tg.url('/images/icon_page_edit.png')}" alt="edit_all" title="Editer tous les évènements sélectionnés"/></td> |
179 |
<td style="text-align: center;"><input id="vigiboard_checkall_checkbox" type="checkbox" /></td> |
180 |
</tr>
|
181 |
</thead>
|
182 |
|
183 |
<tbody>
|
184 |
<tr><td colspan="9"><br />Aucun évènement disponible.</td></tr> |
185 |
</tbody>
|
186 |
</table>
|
187 |
${tmpl_context.searchdialog} |
188 |
<div style="display:none" id="SearchDialog"> |
189 |
${tmpl_context.search_form()} |
190 |
</div>
|
191 |
<script type="text/javascript"> |
192 |
function vigiboard_searchdialog() {
|
193 |
$('#search_form_host').attr('value','');
|
194 |
$('#search_form_service').attr('value','');
|
195 |
$('#search_form_output').attr('value','');
|
196 |
$('#search_form_trouble_ticket').attr('value', '');
|
197 |
$('#SearchDialog').dialog('open');
|
198 |
}
|
199 |
$('#SearchLien').click(function(e){
|
200 |
$('#SearchDialog').dialog('option','position','center');
|
201 |
});
|
202 |
</script>
|
203 |
|
204 |
</py:if>
|
205 |
|
206 |
</py:def>
|
207 |
|
208 |
</html>
|