Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

Commit

Permalink
JIRA DTACLOUD_210
Browse files Browse the repository at this point in the history
various small GUI improvements: use hyperlinks for FWs and volumes in
instances, allow name to be specified for new volumes, display name
when available, don't use hyperlink for 'unknown' instances,
don't use <--> if no device specified

Patches from Dies Koper diesk@fast.au.fujitsu.com

https://issues.apache.org/jira/browse/DTACLOUD-210
  • Loading branch information
marios committed May 21, 2012
1 parent 56bb7ff commit 862c7cb
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 8 deletions.
4 changes: 3 additions & 1 deletion server/lib/deltacloud/drivers/mock/mock_driver.rb
Original file line number Diff line number Diff line change
Expand Up @@ -273,8 +273,10 @@ def create_storage_volume(credentials, opts=nil)
check_credentials(credentials)
opts ||= {}
opts[:capacity] ||= "1"
id = "Volume#{Time.now.to_i}"
volume = {
:id => "Volume#{Time.now.to_i}",
:id => id,
:name => opts[:name] ? opts[:name] : id,
:created => Time.now.to_s,
:state => "AVAILABLE",
:capacity => opts[:capacity],
Expand Down
6 changes: 4 additions & 2 deletions server/views/instances/show.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,14 @@
%a{ :href => key_url(@instance.keyname), :'data-ajax' => 'false'}=@instance.keyname
- if @instance.firewalls
%li{ :'data-role' => 'list-divider'} Firewalls
%li=@instance.firewalls.join(", ")
- @instance.firewalls.each do |firewall|
%li
%a{ :href => firewall_url(firewall), :'data-ajax' => 'false'}=firewall
- if @instance.storage_volumes
%li{ :'data-role' => 'list-divider'} Attached Storage Volumes
-@instance.storage_volumes.each do |vol|
%li
%p{ :'data-role' => 'fieldcontain'}="#{vol.keys.first} <---> #{vol.values.first}"
%a{ :href => storage_volume_url("#{vol.keys.first}"), :'data-ajax' => 'false'}=["#{vol.keys.first}", "#{vol.values.first}"].compact.reject{ |e| e.empty? }.join(' <---> ')
%li{ :'data-role' => 'list-divider'} Actions
%li
%div{ :'data-role' => 'controlgroup', :'data-type' => "horizontal" }
Expand Down
2 changes: 1 addition & 1 deletion server/views/storage_volumes/attach.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@
Device name:
%input{ :name => "device", :size => 10, :value => "/dev/sdc"}
%p
%input{ :type => :submit, :name => "commit", :value => "create" }/
%input{ :type => :submit, :name => "commit", :value => "attach" }/
2 changes: 1 addition & 1 deletion server/views/storage_volumes/index.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
%li
%a{ :href => storage_volume_url(volume.id), :'data-ajax' => 'false'}
%img{ :class => 'ui-link-thumb', :src => '/images/volume.png'}
%h3= volume.id
%h3= volume.name ? volume.name : volume.id
%p=[volume.realm_id, volume.capacity].join(', ')
%span{ :class => 'ui-li-count'}=volume.state
4 changes: 4 additions & 0 deletions server/views/storage_volumes/new.html.haml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
%h1 Create new storage volume

%form{ :action => storage_volumes_url, :method => :post }
%p
%label
Name:
%input{ :name => 'name', :size => 30 } (optional)
%p
%label
Snapshot ID:
Expand Down
11 changes: 8 additions & 3 deletions server/views/storage_volumes/show.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
%ul{ :'data-role' => :listview , :'data-inset' => :true, :'data-divider-theme' => 'd'}
%li{ :'data-role' => 'list-divider'} Name
%li
%p{ :'data-role' => 'fieldcontain'}=@storage_volume.id
%p{ :'data-role' => 'fieldcontain'}=(@storage_volume.name ? @storage_volume.name : @storage_volume.id)
%li{ :'data-role' => 'list-divider'} Created
%li
%p{ :'data-role' => 'fieldcontain'}=@storage_volume.created
Expand All @@ -20,8 +20,13 @@
%p{ :'data-role' => 'fieldcontain'}=@storage_volume.state
%li{ :'data-role' => 'list-divider'} Attached to
%li
%a{ :href => instance_url( @storage_volume.instance_id)}
= @storage_volume.instance_id || 'unknown'
- if @storage_volume.instance_id
%a{ :href => instance_url( @storage_volume.instance_id)}
= @storage_volume.instance_id
- elsif @storage_volume.state == "AVAILABLE"
%p{ :'data-role' => 'fieldcontain'}= 'none (detached)'
-else
%p{ :'data-role' => 'fieldcontain'}= 'unknown'
%li{ :'data-role' => 'list-divider'} Device
%li
%p{ :'data-role' => 'fieldcontain'}= @storage_volume.device
Expand Down

0 comments on commit 862c7cb

Please sign in to comment.