diff --git a/app/authenticated/route.js b/app/authenticated/route.js index 85f2f7319..732dc43ee 100644 --- a/app/authenticated/route.js +++ b/app/authenticated/route.js @@ -323,7 +323,7 @@ export default Ember.Route.extend(AuthenticatedRouteMixin, { if ( volume ) { var mounts = volume.get('mounts'); - if ( !Ember.isArray('mounts') ) + if ( !Ember.isArray(mounts) ) { mounts = []; volume.set('mounts',mounts); diff --git a/app/components/page-header/template.hbs b/app/components/page-header/template.hbs index 79518dbc0..94e13ba01 100644 --- a/app/components/page-header/template.hbs +++ b/app/components/page-header/template.hbs @@ -136,7 +136,6 @@ {{#if isInfrastructure}} {{#link-to "hosts"}} Hosts{{/link-to}} {{#link-to "containers"}} Containers{{/link-to}} - {{#link-to "volumes"}} Volumes{{/link-to}} {{#link-to "loadbalancers"}} Load Balancers{{/link-to}} {{#link-to "loadbalancerconfigs"}} Balancer Configs{{/link-to}} {{/if}} diff --git a/app/components/resource-actions-menu/component.js b/app/components/resource-actions-menu/component.js index b9ffd0cb3..380e24ade 100644 --- a/app/components/resource-actions-menu/component.js +++ b/app/components/resource-actions-menu/component.js @@ -5,6 +5,7 @@ export default Ember.Component.extend({ choices: null, classNames: ['resource-actions'], + classNameBindings: ['activeActions.length::hide'], open: false, didInsertElement: function() { diff --git a/app/host/storage/controller.js b/app/host/storage/controller.js new file mode 100644 index 000000000..a66d93bbc --- /dev/null +++ b/app/host/storage/controller.js @@ -0,0 +1,9 @@ +import Cattle from 'ui/utils/cattle'; + +export default Cattle.CollectionController.extend({ + nonRootVolumes: function() { + return this.get('arrangedContent').filter(function(volume) { + return !volume.get('instanceId') && volume.get('state') !== 'purged'; + }); + }.property('arrangedContent.@each.{instanceId,state}') +}); diff --git a/app/host/storage/route.js b/app/host/storage/route.js new file mode 100644 index 000000000..aac111979 --- /dev/null +++ b/app/host/storage/route.js @@ -0,0 +1,19 @@ +import Ember from 'ember'; + +export default Ember.Route.extend({ + model: function() { + var host = this.modelFor('host'); + var out = []; + return host.followLink('storagePools').then((pools) => { + var promises = pools.map((pool) => { + return pool.followLink('volumes',{include: 'mounts'}).then((volumes) => { + out.pushObjects((volumes||[]).toArray()); + }); + }); + + return Ember.RSVP.all(promises).then(() => { + return out; + }); + }); + } +}); diff --git a/app/host/storage/template.hbs b/app/host/storage/template.hbs index b1696c80c..8d3cbbc84 100644 --- a/app/host/storage/template.hbs +++ b/app/host/storage/template.hbs @@ -1 +1,54 @@ -
| State | +Host Path | +Mounts | ++ |
|---|---|---|---|
| + + {{volume.displayState}} + + | + +
+
+ {{volume.displayUri}}
+
+ {{zero-clipboard text=volume.displayUri class="with-clip"}}
+ |
+
+
+ {{#if volume.activeMounts.length}}
+ {{#each mount in volume.activeMounts itemController="mount"}}
+
+ {{#link-to "container" mount.instanceId}}{{mount.instance.name}}{{/link-to}}:{{mount.path}}
+ {{#if (eq mount.permissions "ro")}}
+ (read-only)
+ {{/if}}
+
+ {{/each}}
+ {{else}}
+ None
+ {{/if}}
+ |
+
+ + {{#if volume.availableActions.length}} + {{resource-actions-menu model=volume choices=volume.availableActions}} + {{/if}} + | +
| This host does not have any containers yet. | |||