Merge pull request #2572 from n313893254/17246

Add current scale in Workload view
This commit is contained in:
Westly Wright 2019-01-23 08:12:24 -07:00 committed by GitHub
commit 38c876e763
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 57 additions and 23 deletions

View File

@ -195,6 +195,12 @@ var Workload = Resource.extend(Grafana, DisplayImage, StateCounts, EndpointPorts
return !!workloadAnnotations[C.LABEL.CREATOR_ID];
}),
currentScale: computed('pods.@each.state', 'scale', function() {
const { pods = [] } = this
return pods.filter((p) => p.state === 'running').length
}),
actions: {
activate() {
return this.doAction('activate');

View File

@ -136,6 +136,12 @@
display:flex;
}
.center {
display:flex !important;
justify-content:center;
align-items: center;
}
.inline{
display: inline;
}

View File

@ -186,6 +186,10 @@ $banner-color : $secondary !default;
&:last-child {
border: 0;
}
.hr {
border-bottom: 1px dashed #78C9CF;
}
}
&.basics-stack-detail {
span[class*='tag-'] {
@ -194,5 +198,8 @@ $banner-color : $secondary !default;
}
}
.block .text-small {
font-size: 0.7em;
}
}
}

View File

@ -34,29 +34,42 @@
</div>
<div class="row banner bg-info basics">
<div class="vertical-middle">
<label class="acc-label vertical-middle p-0">{{t 'servicePage.endpoints'}}:</label>
{{#if service.displayEndpoints}}
<label class="clip text-small vertical-middle">
{{service.displayEndpoints}}
</label>
{{else}}
{{t 'generic.na'}}
{{/if}}
</div>
<div class="vertical-middle">
<label class="acc-label vertical-middle p-0">{{t 'servicePage.multistat.scale'}}:</label>
<span class="pr-5">
{{service.displayScale}}
</span>
<div class="btn-group btn-group-xs p-0">
<button class="btn btn-xs bg-primary" {{action "scaleDown" target=service}} disabled={{not service.canScaleDown}}><i class="icon icon-minus icon-fw"/></button>
<button style="margin-left: -1px;" class="btn btn-xs bg-primary" {{action "scaleUp" target=service}} disabled={{not service.canScaleUp}}><i class="icon icon-plus icon-fw"/></button>
<div class="vertical-middle center">
<div>
<label class="acc-label vertical-middle p-0">{{t 'servicePage.endpoints'}}:</label>
{{#if service.displayEndpoints}}
<label class="clip text-small vertical-middle">
{{service.displayEndpoints}}
</label>
{{else}}
{{t 'generic.na'}}
{{/if}}
</div>
</div>
<div class="vertical-middle">
<label class="acc-label vertical-middle p-0">{{t 'servicePage.multistat.created'}}:</label>
{{date-calendar service.created}}
<div class="vertical-middle center">
<span class="text-left">
<div class="hr">
<label class="acc-label vertical-middle p-0">{{t 'servicePage.multistat.scale'}}:</label>
<span class="pr-5">
{{service.displayScale}}
</span>
</div>
<div>
<span class="help-block">{{t 'servicePage.multistat.currentScale' count=service.currentScale}}</span>
</div>
</span>
<span>
<div class="btn-group btn-group-xs p-0 ml-10">
<button class="btn btn-xs bg-primary" {{action "scaleDown" target=service}} disabled={{not service.canScaleDown}}><i class="icon icon-minus icon-fw"/></button>
<button style="margin-left: -1px;" class="btn btn-xs bg-primary" {{action "scaleUp" target=service}} disabled={{not service.canScaleUp}}><i class="icon icon-plus icon-fw"/></button>
</div>
</span>
</div>
<div class="vertical-middle center">
<div class="">
<label class="acc-label vertical-middle p-0">{{t 'servicePage.multistat.created'}}:</label>
{{date-calendar service.created}}
</div>
</div>
</div>

View File

@ -1410,11 +1410,12 @@ servicePage:
multistat:
type: 'Workload Type'
fqdn: 'FQDN'
scale: 'Scale'
scale: 'Config Scale'
image: 'Image'
namespace: 'Namespace'
created: 'Created'
daemonSetScale: '1 per node'
currentScale: 'Ready Scale: {count}'
serviceType:
deployment: Deployment
replicaSet: Replica Set

View File

@ -1266,11 +1266,12 @@ servicePage:
multistat:
type: '类型'
fqdn: 'FQDN'
scale: 'Pod副本数'
scale: 'Pod配置副本数'
image: '镜像名'
namespace: '命名空间'
created: '创建时间'
daemonSetScale: '每主机1个Pod'
currentScale: 'Pod可用副本数: {count}'
serviceType:
deployment: Deployment
replicaSet: 副本集