lib/flapjack/gateways/web/views/entity.haml in flapjack-0.7.2 vs lib/flapjack/gateways/web/views/entity.haml in flapjack-0.7.3
- old
+ new
@@ -19,14 +19,20 @@
%th State
%th Last State Change
%th Last Update
%th Last Notification
- @states.each do |entity, check, status, changed, updated, in_unscheduled_outage, in_scheduled_outage, notified_kind, notified|
- %tr
+ - colour_class = status
+ - case status
+ - when 'critical', 'unknown'
+ - colour_class = 'error'
+ - when 'ok', 'up'
+ - colour_class = 'success'
+ %tr{:class => colour_class}
%td
- link = "/check?entity=" + CGI.escape(entity) + "&check=" + CGI.escape(check)
%a(title='check detail' href=link) #{check}
- %td{:class => status}
+ %td
= status.upcase
= " (Acknowledged)" if in_unscheduled_outage
= " (Scheduled Maintenance)" if in_scheduled_outage
%td= relative_time_ago(Time.at(changed.to_i)) + ' ago'
%td= (Time.now.to_i - updated.to_i).to_s + ' seconds ago'