Revision 40c55c5a
Added by Amos Benari about 12 years ago
- ID 40c55c5a24bbf1a7c0eab9b3c62d11601ffee7cf
app/controllers/images_controller.rb | ||
---|---|---|
def create
|
||
@image = Image.new(params[:image])
|
||
if @image.save
|
||
process_success :success_redirect => compute_resource_images_path(@compute_resource)
|
||
process_success :success_redirect => compute_resource_path(@compute_resource)
|
||
else
|
||
process_error
|
||
end
|
||
... | ... | |
|
||
def update
|
||
if @image.update_attributes(params[:image])
|
||
process_success :success_redirect => compute_resource_images_path(@compute_resource)
|
||
process_success :success_redirect => compute_resource_path(@compute_resource)
|
||
else
|
||
process_error
|
||
end
|
||
... | ... | |
|
||
def destroy
|
||
if @image.destroy
|
||
process_success :success_redirect => compute_resource_images_path(@compute_resource)
|
||
process_success :success_redirect => compute_resource_path(@compute_resource)
|
||
else
|
||
process_error
|
||
end
|
app/views/compute_resources/show.html.erb | ||
---|---|---|
<%= javascript "compute_resource" %>
|
||
<% title @compute_resource.name %>
|
||
|
||
<ul class="nav nav-tabs" data-tabs="tabs">
|
||
<li class="active"><a href="#primary" data-toggle="tab">Primary</a></li>
|
||
<li><a href="#vms" data-toggle="tab">Virtual Machines</a></li>
|
||
... | ... | |
<table class="table table-bordered table-striped">
|
||
<th>Details</th>
|
||
<th></th>
|
||
<tr>
|
||
<td>Name</td>
|
||
<td><%= @compute_resource.name %></td>
|
||
</tr>
|
||
|
||
<tr>
|
||
<td>Provider</td>
|
||
... | ... | |
</div>
|
||
<% if @compute_resource.capabilities.include?(:image) -%>
|
||
<div id="images" class="tab-pane">
|
||
<div class="row">
|
||
<%= display_link_if_authorized("New Image", hash_for_new_compute_resource_image_path(:compute_resource_id => @compute_resource.id), :class => "fr btn btn-success") %>
|
||
<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>
|
||
<div id="images_list" data-url=<%= compute_resource_images_path(@compute_resource) %>>
|
||
<p id="spinner">
|
app/views/images/index.html.erb | ||
---|---|---|
<% title "Images" %>
|
||
|
||
<% title_actions display_link_if_authorized("New Image", hash_for_new_compute_resource_image_path), help_path %>
|
||
<% title_actions display_link_if_authorized("New Image", hash_for_new_compute_resource_image_path) %>
|
||
|
||
<table class="table table-bordered table-striped">
|
||
<tr>
|
||
<th><%= sort :name %></th>
|
||
<th>OperatingSystem</th>
|
||
<th>Operating System</th>
|
||
<th>Username</th>
|
||
<th>UUID</th>
|
||
<th></th>
|
Also available in: Unified diff
minor visual fixes to the compute resource view.