Project

General

Profile

Statistics
| Branch: | Tag: | Revision:

vigiboard / dashboard / templates / dashboard_event_table.html @ 805cc54a

History | View | Annotate | Download (6 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

    
7
<div style="text-align: right">
8
        <a id="SearchLien" href="javascript:dashboard_searchdialog()">
9
        <img src="${tg.url('/images_vigilo/filter.png')}" />
10
        </a>
11
</div>
12

    
13
<table style="width: 100%">
14

    
15
        <thead>
16

    
17
                <tr>
18

    
19
                        <td>
20
                                <a py:if="page > pages[0]" href="${tg.url('/dashboard/%d' % (page-1))}"><img src="${tg.url('/images_vigilo/fleche_up.png')}" alt="" /></a>
21
                                <img py:if="page == pages[0]" src="${tg.url('/images_vigilo/fleche_up.png')}" alt="" />
22
                        </td>
23

    
24
                        <td colspan="8" style="background-color:#4682B4;color:white;text-align:center">Showing rows ${id_first_row} to ${id_last_row} of ${total_row}<br />
25
                                Pages <py:for each="p in pages">
26
                                <a py:if="p != page" href="${tg.url('/dashboard/%d' % p)}" py:content="p" />
27
                                <span py:if="p == page" py:replace="p" />
28
                                </py:for>
29
                        </td>
30

    
31
                        <td>
32
                                <a py:if="pages[-1] > page" href="${tg.url('/dashboard/%d' % (page+1))}"><img src="${tg.url('/images_vigilo/fleche_down.png')}" alt="" /></a>
33
                                <img py:if="page == pages[-1]" src="${tg.url('/images_vigilo/fleche_down.png')}" alt="" />
34
                        </td>
35
                
36
                </tr>
37

    
38
                <tr style="background-color:#F8F8F8">
39
                        <td>&nbsp;</td>
40
                        <td>Date<br />[Duration]</td>
41
                        <td>#</td>
42
                        <td>Host</td>
43
                        <td>Service Type<br />Service Name</td>
44
                        <td>Output</td>
45
                        <td>[T T]</td>
46
                        <td>&nbsp;</td>
47
                        <td><a class="Edit_EventsLien" href="javascript:dashboard_edit_eventdialog('all')"><img src="${tg.url('/images_vigilo/icon_page_edit.png')}" /></a></td>
48
                        <td><input id="dashboard_checkall_checkbox" type="checkbox" onclick="javascript:dashboard_checkall()" /></td>
49
                </tr>
50
        
51
        </thead>
52
        
53
        <tbody>
54
        
55
                <py:for each="(event,class_tr,class_td_severity,class_td_date,img_fleche,img_statu) in events">
56
                <tr py:attrs="class_tr">
57
                        <td py:attrs="class_td_severity"><a href="javascript:dashboard_historydialog('${event.idevent}')" class="HistoryLien"><img py:attrs="img_fleche" style="width:20px"/></a></td>
58
                        <td py:attrs="class_td_date">${event.GetDate('timestamp_active')}<br />[${event.GetSinceDate('timestamp_active')}]</td>
59
                        <td py:attrs="class_td_date">${event.occurence}</td>
60
                        <td>${event.hostname}</td>
61
                        <td>${event.servicename}</td>
62
                        <td>${event.output}</td>
63
                        <td>${event.trouble_ticket}</td>
64
                        <td><img py:attrs="img_statu" py:if="img_statu != None" /></td>
65
                        <td py:attrs="class_td_date"><a class="Edit_EventsLien" href="javascript:dashboard_edit_eventdialog('${event.idevent}')"><img src="${tg.url('/images_vigilo/icon_page_edit.png')}" /></a></td>
66
                        <td py:attrs="class_td_date"><input type="checkbox" class="Edit_EventsCheckBox" value="${event.idevent}"/></td>
67

    
68
                </tr>
69
                </py:for>
70
        
71
        </tbody>
72

    
73
</table>
74

    
75
${tmpl_context.historydialog()}
76
${tmpl_context.edit_eventdialog()}
77
${tmpl_context.searchdialog()}
78

    
79
<script type="text/javascript">
80
        function dashboard_historydialog(idd) {
81
                $.getJSON("${tg.url('/dashboard_HistoryDialog')}",{id:idd},function(json){
82
                        $('#HistoryDialog_initial_state').html(json.initial_state);
83
                        $('#HistoryDialog_current_state').html(json.current_state);
84
                        $('#HistoryDialog_detailed_event').attr('href' , '${tg.url('/dashboard_event/')}' + json.idevent);
85
                        $('#HistoryDialog_detailed_host').attr('href', '${tg.url('/dashboard_host_service/')}' + json.host + "/" + json.service);
86
                        $('#HistoryDialog_nagios').attr('href', json.nagios_link);
87
                        $('#HistoryDialog_metrology').attr('href', json.metrology_link);
88
                        $('#HistoryDialog_security').attr('href', json.security_link);
89
                        $('#HistoryDialog_servicetype').attr('href', json.servicetype_link);
90
                        $('#HistoryDialog').dialog('open');
91
                })
92
        }
93
        function dashboard_edit_eventdialog(idd) {
94
                $('#edit_event_form_comment').attr('value','');
95
                $('#edit_event_form_tt').attr('value','');
96
                $('#edit_event_form_tt_create').attr('checked',false);
97
                $('#edit_event_form_status').find('option:first').attr('selected', 'selected').parent('select');;
98
                if ( idd == 'all' ) {
99
                        var a = '';
100
                        $('.Edit_EventsCheckBox').each(function() {
101
                                if ( $(this).attr('checked'))
102
                                        a += $(this).attr('value') + ',';
103
                        });
104
                        idd = a;
105
                }
106
                $('#edit_event_form_id').attr('value',idd);        
107
                $('#Edit_EventsDialog').dialog('open');
108
        }
109
        function dashboard_searchdialog() {
110
                $('#search_form_host').attr('value','');
111
                $('#search_form_service').attr('value','');
112
                $('#search_form_output').attr('value','');
113
                $('#search_form_trouble_ticket').attr('value', '');
114
                $('#SearchDialog').dialog('open');        
115
        }
116
        function dashboard_checkall() {
117
                var val = $('#dashboard_checkall_checkbox').attr('checked');        
118
                $('input[type=checkbox]').each(function(){$(this).attr('checked',val);});
119
        }
120
        $('.HistoryLien').each(function() {
121
                $(this).click(function(e){
122
                $('#HistoryDialog').dialog('option','position',[e.clientX+10,e.clientY]);
123
                })});
124
        $('.Edit_EventsLien').each(function() {
125
                $(this).click(function(e){
126
                $('#Edit_EventsDialog').dialog('option','position',[e.clientX-400-20,e.clientY]);
127
                })});
128
        $('#SearchLien').click(function(e){
129
                $('#SearchDialog').dialog('option','position','center');
130
        });
131
        
132

    
133
</script>
134

    
135
<div id="HistoryDialog">
136
Initial State: <span id="HistoryDialog_initial_state" /><br />
137
Current State: <span id="HistoryDialog_current_state" /><br />
138
<ul>
139
        <li><a id="HistoryDialog_detailed_event" href="" >Detailed history for this event</a></li>
140
        <li><a id="HistoryDialog_detailed_host" href="" >Detailed history for this host/service</a></li>
141
        <li><a id="HistoryDialog_nagios" href="" >Nagios host details</a></li>
142
        <li><a id="HistoryDialog_metrology" href="" >Metrology details</a></li>
143
        <li><a id="HistoryDialog_security" href="" >Security details</a></li>
144
        <li><a id="HistoryDialog_servicetype" href="" >Service Type</a></li>
145
</ul>
146
</div>
147

    
148
<div id="Edit_EventsDialog">
149
        ${tmpl_context.edit_event_form()} <!--child_args=dict(status=dict(options=edit_event_status_options)))}-->
150
</div>
151
<div id="SearchDialog">
152
        ${tmpl_context.search_form()}
153
</div>
154

    
155
</py:def>
156

    
157
</html>