Project

General

Profile

« Previous | Next » 

Revision 55548030

Added by Ohad Levy almost 12 years ago

  • ID 555480301cc8d9d5a1ed991c27e63dc66c4ea489

adds missing EC2 propetries view

View differences:

app/helpers/compute_resources_vms_helper.rb
module ComputeResourcesVmsHelper
# little helper to help show VM properties
def prop method, title = nil
content_tag :tr do
result = content_tag :td do
title || method.to_s.humanize
end
result += content_tag :td do
value = @vm.send(method) rescue nil
case value
when Array
value.to_sentence
when Fog::Time
time_ago_in_words(value) + " ago"
else
value.to_s
end
end
result
end
end
end
app/views/compute_resources/show.html.erb
<th>Details</th>
<th></th>
<tr>
<td>Provider</td>
<td><%= @compute_resource.provider %></td>
</tr>
<tr>
<td>Description</td>
<td><%= @compute_resource.description %></td>
</tr>
<tr>
<td>URL</td>
<td><%= @compute_resource.url %></td>
</tr>
<tr>
<td>Provider</td>
<td><%= @compute_resource.provider %></td>
</tr>
<tr>
<td>Description</td>
<td><%= @compute_resource.description %></td>
</tr>
<tr>
<td>URL</td>
<td><%= @compute_resource.url %></td>
</tr>
</table>
</div>
<div id="vms" class="tab-pane" data-url=<%= compute_resource_vms_path(@compute_resource) %>>
......
</div>
<% if @compute_resource.capabilities.include?(:image) -%>
<div id="images" class="tab-pane">
<div id='title_action'>
<%= display_link_if_authorized("New Image", hash_for_new_compute_resource_image_path(:compute_resource_id => @compute_resource.id), :class => "btn btn-success") %>
</div>
<%= title_actions(display_link_if_authorized("New Image", hash_for_new_compute_resource_image_path(:compute_resource_id => @compute_resource.id), :class => "btn btn-success")) %>
<div id="images_list" data-url=<%= compute_resource_images_path(@compute_resource) %>>
<p id="spinner">
<%= image_tag 'spinner.gif' %>
app/views/compute_resources_vms/index/_ec2.html.erb
</tr>
<% @compute_resource.vms.each do |vm| -%>
<tr>
<td><%= vm.tags["Name"] %></td>
<td><%= link_to_if_authorized vm.tags["Name"], hash_for_compute_resource_vm_path(:compute_resource_id => @compute_resource, :id => vm.identity) %></td>
<td><%= vm.dns_name %></td>
<td><%= vm.flavor_id %></td>
<td <%= vm_power_class(vm.ready?)%>> <%= vm_state(!vm.ready?) %> </td>
app/views/compute_resources_vms/show/_ec2.html.erb
<% title @vm.tags["Name"] %>
<div class='span12'>
<table class="table table-bordered table-striped">
<tr><th colspan="2">Properties</th></tr>
<%= prop :availability_zone %>
<%= prop :public_ip_address %>
<%= prop :dns_name %>
<%= prop :private_ip_address %>
<%= prop :private_dns_name %>
<%= prop :kernel_id %>
<%= prop :state %>
<%= prop :created_at %>
<%= prop :root_device_type %>
<%= prop :image_id %>
<%= prop :flavor_id %>
<%= prop :groups, "Security Groups" %>
</table>
</div>

Also available in: Unified diff