mirror of https://github.com/rancher/ui.git
wip - stack details
This commit is contained in:
parent
f8e56659f4
commit
c1a0bb75c7
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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) => {
|
||||
|
|
|
|||
|
|
@ -6,3 +6,48 @@
|
|||
{{/banner-message}}
|
||||
|
||||
{{stack-header model=model.stack all=model.all.stacks}}
|
||||
|
||||
<section>
|
||||
{{#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")}}
|
||||
<tr><td class="text-center text-muted pt-20 pb-20">{{t 'containersPage.table.noMatch'}}</td></tr>
|
||||
{{/if}}
|
||||
{{/sortable-table}}
|
||||
{{/accordion-row}}
|
||||
</section>
|
||||
|
|
|
|||
|
|
@ -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')
|
||||
});
|
||||
});
|
||||
},
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue