diff --git a/app/scaling-groups/index/template.hbs b/app/scaling-groups/index/template.hbs index 8e1bf4c00..6eb7fafb7 100644 --- a/app/scaling-groups/index/template.hbs +++ b/app/scaling-groups/index/template.hbs @@ -20,6 +20,7 @@ subSearchField="instances" headers=headers as |sortable kind inst dt|}} {{#if (eq kind "row")}} + {{ log inst }} {{service-row model=inst toggle=(action "toggleExpand" inst.id) diff --git a/app/stack/index/controller.js b/app/stack/index/controller.js index fc645aec8..6bac937c6 100644 --- a/app/stack/index/controller.js +++ b/app/stack/index/controller.js @@ -16,6 +16,58 @@ export default Ember.Controller.extend({ } }, + sgHeaders: [ + { + name: 'expand', + sort: false, + searchField: null, + width: 30 + }, + { + name: 'state', + sort: ['stateSort','displayName'], + searchField: 'displayState', + translationKey: 'generic.state', + width: 120 + }, + { + name: 'name', + sort: ['displayName','id'], + searchField: 'displayName', + translationKey: 'generic.name', + }, + { + name: 'endpoints', + sort: null, + searchField: 'endpointPorts', + translationKey: 'stacksPage.table.endpoints', + }, + { + name: 'image', + sort: ['displayImage','displayName'], + searchField: 'displayImage', + translationKey: 'generic.image', + }, + { + name: 'instanceState', + sort: ['instanceCountSort:desc','displayName'], + searchField: null, + width: 140, + icon: 'icon icon-lg icon-container', + dtTranslationKey: 'stacksPage.table.instanceState', + translationKey: 'stacksPage.table.instanceStateWithIcon', + }, + ], + + + stackContainers: Ember.computed('model.stack.services.@each.healthState', function() { + var neu = []; + this.get('model.stack.services').forEach((service) => { + neu = neu.concat(service.get('instances')); + }); + return neu; + }), + instanceCount: function() { var count = 0; (this.get('model.stack.services')||[]).forEach((service) => { diff --git a/app/stack/index/template.hbs b/app/stack/index/template.hbs index 5fe7eca74..87a41fd62 100644 --- a/app/stack/index/template.hbs +++ b/app/stack/index/template.hbs @@ -6,3 +6,48 @@ {{/banner-message}} {{stack-header model=model.stack all=model.all.stacks}} + +
+ {{#accordion-row + title=(t 'stackPage.containers.header') + detail=(t 'stackPage.containers.detail') + status=(t 'stackPage.containers.status' count=model.instances.length) + statusClass=(if model.instances.length 'bg-success' 'text-muted') + as |parent| + }} + {{container-table + body=model.instances + sortBy=sortBy + bulkActions=true + showHost=false + }} + {{/accordion-row}} + + {{#accordion-row + title=(t 'stackPage.scalingGroups.header') + detail=(t 'stackPage.scalingGroups.detail') + status=(t 'stackPage.scalingGroups.status' count=model.services.length) + statusClass=(if model.services.length 'bg-success' 'text-muted') + as |parent| + }} + {{#sortable-table + classNames="grid sortable-table" + body=model.services + sortBy=sortBy + bulkActions=true + fullRows=true + pagingLabel="pagination.container" + headers=sgHeaders as |sortable kind serv dt|}} + {{#if (eq kind "row")}} + {{service-row + model=serv + canExpand=false + showInstanceCount=false + dt=dt + }} + {{else if (eq kind "nomatch")}} + {{t 'containersPage.table.noMatch'}} + {{/if}} + {{/sortable-table}} + {{/accordion-row}} +
diff --git a/app/stack/route.js b/app/stack/route.js index 205a017f6..bd5923bcd 100644 --- a/app/stack/route.js +++ b/app/stack/route.js @@ -5,9 +5,16 @@ export default Ember.Route.extend({ var store = this.get('store'); var all = this.modelFor('stacks'); return store.find('stack', params.stack_id).then((stack) => { + var neu = []; + stack.get('services').forEach((service) => { + neu = neu.concat(service.get('instances')); + }); + // debugger; return Ember.Object.create({ stack: stack, all: all, + instances: neu, + services: stack.get('services') }); }); }, diff --git a/translations/en-us.yaml b/translations/en-us.yaml index 62650f93a..5ad90131e 100644 --- a/translations/en-us.yaml +++ b/translations/en-us.yaml @@ -1152,6 +1152,24 @@ stackPage: header: singleBanner: Viewing a single Stack backLink: Back to all stacks + containers: + header: Containers + detail: A list of containers in this stack + status: | + {count, plural, + =0 {No containers} + =1 {# container} + other {# containers} + } + scalingGroups: + header: Scaling Groups + detail: '@@TODO' + status: | + {count, plural, + =0 {No groups} + =1 {# group} + other {# groups} + } newStack: header: Import Compose.yml