mirror of https://github.com/rancher/ui.git
Merge pull request #2572 from n313893254/17246
Add current scale in Workload view
This commit is contained in:
commit
38c876e763
|
|
@ -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');
|
||||
|
|
|
|||
|
|
@ -136,6 +136,12 @@
|
|||
display:flex;
|
||||
}
|
||||
|
||||
.center {
|
||||
display:flex !important;
|
||||
justify-content:center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.inline{
|
||||
display: inline;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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: 副本集
|
||||
|
|
|
|||
Loading…
Reference in New Issue