blob: 7d36da0f63c195ec0b876c13a94fad72035cfb54 [file] [log] [blame]
- @title="#{@machine.name}"
- content_for :breadcrumb do
%ul.breadcrumb
%li
%a{ :href => "/cimi/cloudEntryPoint"} CloudEntryPoint
%span.divider="/"
%li
%a{ :href => "/cimi/machines"} MachineCollection
%span.divider="/"
%li.active
= @machine.name
- content_for :actions do
%div{:class => 'btn-group btn-group-vertical'}
%form{ :action => "/cimi/machines/#{href_to_id @machine.id}/stop", :method => :post, :style => 'display:inline', :id => 'frm_stop'}
%form{ :action => "/cimi/machines/#{href_to_id @machine.id}/start", :method => :post, :style => 'display:inline', :id => 'frm_start'}
%form{ :action => "/cimi/machines/#{href_to_id @machine.id}/restart", :method => :post, :style => 'display:inline', :id => 'frm_restart'}
%form{ :action => "/cimi/machines/#{href_to_id @machine.id}/delete", :method => :post, :style => 'display:inline', :id => 'frm_delete'}
%input{ :type => :hidden, :name => '_method', :value => 'delete'}
- if @machine.operations.find {|o| o.rel == 'http://schemas.dmtf.org/cimi/1/action/stop'}
%button{ :class => 'btn btn-warning', :type => :button, :onclick => '$("#frm_stop").submit()'} Stop
- if @machine.operations.find {|o| o.rel == 'http://schemas.dmtf.org/cimi/1/action/start'}
%button{ :class => 'btn btn-success', :type => :button, :onclick => '$("#frm_start").submit()'} Start
- if @machine.operations.find {|o| o.rel == 'http://schemas.dmtf.org/cimi/1/action/restart'}
%button{ :class => 'btn btn-info', :type => :button, :onclick => '$("#frm_restart").submit()'} Reboot
- if @machine.operations.find {|o| o.rel == 'delete'}
%button{ :class => 'btn btn-danger', :type => :button, :onclick => '$("#frm_delete").submit()'} Destroy
%p{:style => 'margin-top:1em;'}
%a{ :href => "#{@machine.id}?format=xml", :class => 'label warning' } XML
%a{ :href => "#{@machine.id}?format=json", :class => 'label warning' } JSON
- details do
-row 'ID', @machine.id
-row 'Name',@machine.name
-row 'Description',@machine.description
-row 'State',state_span_for(@machine.state)
-row 'CPU', boolean_span_for(@machine.cpu)
-row 'RAM', @machine.memory
-row 'Meters', (@machine.meters.empty? ? "No meters" : ( @machine.meters.each{|meter| meters.id}))
-row 'Created', @machine.created
-row 'Disks', url("/cimi/machines/#{href_to_id @machine.id}/disks")
-row 'Volumes', url("/cimi/machines/#{href_to_id @machine.id}/volumes")
%h5 Properties
%table{ :class => 'table table-bordered table-striped' }
%thead
%tr
%th Name
%th Value
%tbody
- @machine.property.each do |name, value|
%tr
%td
%code=name
%td=convert_urls value