aboutsummaryrefslogtreecommitdiff
path: root/views/alert.haml
blob: b16047a0203e45a78bb63d833faddb34aa86adf4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
%h1 Alert detail
%table
  %tr
    %th.summary{:title => "Text for humans describing the nature of the alert, first 100 characters are only ones guaranteed to make it to pagers, twitter, SMS etc."} Summary
    %td= @alert.summary
  %tr
    %th.summary{:title => "The server/entity that this alert concerns"} Subject
    %td= @alert.subject
  %tr
    %th{:title => "The server/entitiy that originated the alert"} Source
    %td= @alert.source
  %tr
    %th{:title => "HTML fragment describing the alert in more detail, no limit on length."} Detail
    %td
      :textile
        #{@alert.detail}
  %tr
    %th{:title => "ID set by the source of the alert."} Alert ID
    %td= @alert.alert_id
  %tr
    %th{:title => "The group in the Mauve server configuration that match this alert"} Alert groups
    %td= @alert.alert_group
  %tr
    %th{:title => "The level of the first group in the Mauve server configuration that matched this alert"} Alert level
    %td= @alert.level.to_s.upcase
  -if @alert.raised?
    %tr
      %th{:title => "The time at which the alert was raised"} Raised at
      %td= @alert.raised_at.to_s_human
    -if @alert.acknowledged?
      %tr
        %th{:title => "The time at which the alert was acknowledged"} Acknowledged at
        %td= @alert.acknowledged_at.to_s_human + " by " + @alert.acknowledged_by + " until " + @alert.will_unacknowledge_at.to_s_human
  -if @alert.will_raise_at
    %tr
      %th{:title => "The time at which the alert will be automatically raised"} Will raise at
      %td= @alert.will_raise_at.to_s_human
  -if @alert.cleared_at
    %tr
      %th{:title => "The time at which the alert was last cleared"} Last cleared at
      %td= @alert.cleared_at.to_s_human
  -if @alert.will_clear_at
    %tr
      %th{:title => "The time at which the alert will be automatically cleared"} Will clear
      %td= @alert.will_raise_at.to_s_human
  %tr
    %th History
    %td
      %ul#histories
        - @alert.histories.all(:created_at.gte => Time.now - 3.days).each do |history|
          %li
            = history.event
            at
            = (history.created_at.nil? ? "unkown" : history.created_at.to_s_human)
        %p
          %a{:href => "/events/alert/#{@alert.id}"}
            View full event history
%h2 Actions
- if !@alert.acknowledged?
  %form{:method => :post, :action => "/alert/#{@alert.id}/acknowledge"}
    =partial("acknowledge_input")
- else
  %form.hidden{:method => :post, :action => "/alert/#{@alert.id}/unacknowledge"}
    %input{:type => :submit, :value => "Unacknowledge this alert"}                
%a#hide{:onclick => "$('form.hidden').toggle(); return false", :href=>"#"} Show other actions
- if @alert.cleared?
  %form.hidden{:method => :post, :action => "/alert/#{@alert.id}/raise"}
    %input{:type => :submit, :value => "Raise this alert"}
- if @alert.raised?
  %form.hidden{:method => :post, :action => "/alert/#{@alert.id}/clear"}
    %input{:type => :submit, :value => "Clear this alert"}                
%form.hidden{:method => :post, :action => "/alert/#{@alert.id}/destroy"}
  %input{:type => :submit, :value => "Destroy this alert"}