def attribute_editable?(attr)
attr && (attr.to_sym == :name ||
- (attr.to_sym == :components and self.state == 'New'))
+ (attr.to_sym == :components and (self.state == 'New' || self.state == 'Ready')))
end
def attributes_for_display
<% end %>
<% end %>
- <% if @object.state == 'New' %>
+ <% if @object.state.in? ['New', 'Ready'] %>
<%= render partial: 'show_components_editable', locals: {editable: true} %>
<% else %>
<%= render partial: 'show_components_editable', locals: {editable: false} %>
end
end
@instance[:components] = @components
-# @instance[:active] = moretodo
report_status
if @options[:no_wait]
debuglog "interrupt", 0
interrupted = true
break
- #abort
end
end
end
if interrupted
if success
-# @instance[:active] = false
-# @instance[:success] = success
@instance[:state] = 'Complete'
else
-# @instance[:active] = nil
-# @instance[:success] = nil
@instance[:state] = 'Paused'
end
else
if ended == @components.length or failed > 0
-# @instance[:active] = false
-# @instance[:success] = success
@instance[:state] = success ? 'Complete' : 'Failed'
end
end
end
def cleanup
- if @instance
-# @instance[:active] = false
- @instance[:state] = 'New' # should it be Failed?
+ if @instance and @instance[:state] == 'RunningOnClient'
+ @instance[:state] = 'Paused'
@instance.save
end
end