aboutsummaryrefslogtreecommitdiff
path: root/views/alert.haml
diff options
context:
space:
mode:
Diffstat (limited to 'views/alert.haml')
-rw-r--r--views/alert.haml56
1 files changed, 56 insertions, 0 deletions
diff --git a/views/alert.haml b/views/alert.haml
new file mode 100644
index 0000000..4310ddc
--- /dev/null
+++ b/views/alert.haml
@@ -0,0 +1,56 @@
+!!!
+%html
+ %head
+ %title #{@title}: Alert #{@alert.id}: #{@alert.get_safe_html_summary}
+ %link{:rel => "stylesheet", :href => "/alerts2.css"}
+ %link{:rel => "stylesheet", :href => "/alerts-mobil.css", :media => "handheld"}
+ %script{:type => "text/javascript", :src => "/prototype.js"}
+ %script{:type => "text/javascript", :src => "/mauve_utils.js"}
+ %script{:type => "text/javascript", :src => "/datadumper.js"}
+ %body{:onLoad => "addAutoHover(); addRefresh();"}
+ .head= partial("head3")
+ #about_alert
+ %h1.summary #{@alert.get_safe_html_subject}: #{@alert.get_safe_html_summary}
+ %h2.details Alert Details
+ - if @alert.detail
+ .detail= @alert.get_details
+ - if @alert.source != @alert.subject
+ %h2.source Source
+ .source= @alert.get_safe_html_source
+ %h2.external Alert ID external
+ = @alert.get_safe_html_alert_id
+ %h2.internal Alert ID internal
+ = @alert.id
+ %h2.raised_at Last raised
+ = @alert.raised? ? @alert.raised_at : "Not yet raised"
+ %h2.acknowledged_at Acknowledged
+ = @alert.acknowledged? ? @alert.acknowledged_at : "Not acknowledged"
+ %h2.cleared_at Cleared
+ = @alert.cleared? ? @alert.cleared_at : "Not cleared"
+ %h2.alert_group Alert group
+ The first matching one is used:
+ = AlertGroup.matches(@alert).map{|g| g.name}.join("; ")
+ %h2.changes Notifications sent out
+ .changes
+ %ul
+ - @alert.changes.each do |change|
+ - if change.was_relevant?
+ %li
+ %strong= change.level
+ = change.update_type
+ notification to
+ = change.person
+ at
+ = change.at
+ %h2.actions Actions (ugly)
+ - if !@alert.acknowledged?
+ %form{:method => :post, :action => "/alert/#{@alert.id}/acknowledge"}
+ %input{:type => :submit, :value => "Acknowledge this alert"}
+ %h2.actions_dangerous Dangerous actions (also ugly)
+ - if @alert.raised?
+ %form{:method => :post, :action => "/alert/#{@alert.id}/clear"}
+ %input.dangerous{:type => :submit, :value => "Clear this alert"}
+ - if @alert.cleared?
+ %form{:method => :post, :action => "/alert/#{@alert.id}/raise"}
+ %input.dangerous{:type => :submit, :value => "Raise this alert"}
+