lib/flapjack/web/views/check.haml in flapjack-0.6.35 vs lib/flapjack/web/views/check.haml in flapjack-0.6.36
- old
+ new
@@ -47,28 +47,27 @@
%a(title='Dashboard' href='/failing') Failing Checks
%h1 #{@check} on #{@entity}
%form{:action => "/acknowledgements/#{@entity}/#{@check}", :method => "post"}
%h2
State: #{@check_state ? @check_state.upcase : ''}
- - if (['warning', 'critical'].include?(@check_state) and !(@in_unscheduled_maintenance || @in_scheduled_maintenance))
+ - if (['warning', 'critical'].include?(@check_state) and !(@current_unscheduled_maintenance || @current_scheduled_maintenance))
%input{:type => 'hidden', :name => 'acknowledgement_id', :value => "#{@acknowledgement_id}"}
%input{:type => 'submit', :value => 'Acknowledge', :class => 'button'}
with
%label{:for => 'summary'}
summary:
%input{:type => 'text', :name => 'summary', :value => ''}
%label{:for => 'duration'}
duration:
%input{:type => 'text', :name => 'duration', :value => ''}
- - if @in_unscheduled_maintenance
- %h3 (Acknowledged)
- - if @in_scheduled_maintenance
- %h3 (Scheduled Maintenance)
- - if @in_unscheduled_maintenance
+ - if @current_unscheduled_maintenance
+ %h3 (Acknowledged - #{@current_unscheduled_maintenance[:summary]})
%form{:action => "/end_unscheduled_maintenance/#{@entity}/#{@check}", :method => "post"}
%p
%input{:type => 'submit', :value => 'End Unscheduled Maintenance (Unacknowledge)', :class => 'button'}
+ - if @current_scheduled_maintenance
+ %h3 (Scheduled Maintenance - #{@current_scheduled_maintenance[:summary]})
%h3 Output: #{@check_summary}
%table
%tr
%td Last state change:
%td #{relative_time_ago(Time.at(@check_last_change.to_i))} ago
@@ -126,15 +125,22 @@
%td= Time.at(end_time).to_s
%td= ChronicDuration.output(duration)
%td= summary
%td
- if end_time > Time.now.to_i
- %form{ :action => "/scheduled_maintenances/#{@entity}/#{@check}", :method => "post"}
- %input{:type => 'hidden', :name => '_method', :value => 'delete'}
- %input{:type => 'hidden', :name => 'start_time', :value => start_time}
- %input{:type => 'submit', :value => 'Delete', :class => 'button'}
+ - if start_time > Time.now.to_i
+ %form{ :action => "/scheduled_maintenances/#{@entity}/#{@check}", :method => "post"}
+ %input{:type => 'hidden', :name => '_method', :value => 'delete'}
+ %input{:type => 'hidden', :name => 'start_time', :value => start_time}
+ %input{:type => 'submit', :value => 'Delete', :class => 'button'}
+ - else
+ %form{ :action => "/scheduled_maintenances/#{@entity}/#{@check}", :method => "post"}
+ %input{:type => 'hidden', :name => '_method', :value => 'patch'}
+ %input{:type => 'hidden', :name => 'start_time', :value => start_time}
+ %input{:type => 'hidden', :name => 'end_time', :value => 'now'}
+ %input{:type => 'submit', :value => 'End Now', :class => 'button'}
- else
- %p No scheduled maintenance
+ %p No maintenance is scheduled
%h4 Add Scheduled Maintenace
%form{:action => "/scheduled_maintenances/#{@entity}/#{@check}", :method => "post"}
%fieldset
%table
%tr