mirror of https://github.com/rancher/ui.git
Polish code
This commit is contained in:
parent
b6069d80bd
commit
64ed64f0d3
|
|
@ -98,13 +98,7 @@ var Pod = Resource.extend(DisplayImage, {
|
|||
return resource;
|
||||
}
|
||||
}),
|
||||
image: function () {
|
||||
let containers = this.get('containers');
|
||||
if(!containers.length){
|
||||
return
|
||||
}
|
||||
return containers[0].image;
|
||||
}.property('containers'),
|
||||
|
||||
isOn: function() {
|
||||
return ['running','migrating','restarting'].indexOf(get(this,'state')) >= 0;
|
||||
}.property('state'),
|
||||
|
|
|
|||
|
|
@ -255,12 +255,16 @@ var Workload = Resource.extend(DisplayImage, StateCounts, EndpointPorts, {
|
|||
}.property('canScale','scaleMin','scaleIncrement','scale'),
|
||||
|
||||
displayScale: function() {
|
||||
let lcType = get(this, 'lcType');
|
||||
if (lcType){
|
||||
return get(this, 'intl').t('servicePage.multistat.daemonSetScale');
|
||||
}
|
||||
if ( get(this, 'isGlobalScale') ) {
|
||||
return get(this, 'intl').t('servicePage.globalScale', {scale: get(this, 'scale')});
|
||||
} else {
|
||||
return get(this, 'scale');
|
||||
}
|
||||
}.property('scale','isGlobalScale'),
|
||||
}.property('scale','isGlobalScale', 'lcType'),
|
||||
|
||||
canHaveSidekicks: true,
|
||||
|
||||
|
|
@ -271,7 +275,8 @@ var Workload = Resource.extend(DisplayImage, StateCounts, EndpointPorts, {
|
|||
canUpgrade: true,
|
||||
canHaveLabels: true,
|
||||
canScale: computed('lcType', function() {
|
||||
return get(this,'lcType') !== 'cronjob';
|
||||
let lcType = get(this, 'lcType');
|
||||
return lcType !== 'cronjob' && lcType !== 'daemonset';
|
||||
}),
|
||||
realButNotLb: true,
|
||||
canHaveLinks: true,
|
||||
|
|
|
|||
|
|
@ -47,22 +47,16 @@
|
|||
</div>
|
||||
|
||||
<div class="row banner bg-info basics mt-0" style="border-top: none;">
|
||||
{{#if service.canScale}}
|
||||
<div class="vertical-middle">
|
||||
<label class="acc-label vertical-middle p-0">{{t 'servicePage.multistat.scale'}}</label>
|
||||
{{#if (eq service.type 'daemonSet')}}
|
||||
{{t "servicePage.multistat.daemonSetScale"}}
|
||||
{{else}}
|
||||
<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>
|
||||
{{/if}}
|
||||
<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>
|
||||
{{/if}}
|
||||
</div>
|
||||
<div class="vertical-middle">
|
||||
<label class="acc-label vertical-middle p-0">{{t 'servicePage.multistat.created'}}</label>
|
||||
{{date-calendar service.created}}
|
||||
|
|
|
|||
|
|
@ -20,12 +20,12 @@ export default Component.extend(ManageLabels, {
|
|||
},
|
||||
{
|
||||
name: 'name',
|
||||
sort: ['key'],
|
||||
sort: ['name'],
|
||||
translationKey: 'generic.name',
|
||||
},
|
||||
{
|
||||
name: 'image',
|
||||
sort: ['value','key'],
|
||||
name: 'displayImage',
|
||||
sort: ['displayImage'],
|
||||
translationKey: 'generic.image',
|
||||
},
|
||||
{
|
||||
|
|
|
|||
|
|
@ -26,8 +26,8 @@
|
|||
<td data-title="{{dt.name}}">
|
||||
{{inst.name}}
|
||||
</td>
|
||||
<td data-title="{{dt.image}}">
|
||||
{{inst.image}}
|
||||
<td data-title="{{dt.displayImage}}">
|
||||
{{inst.displayImage}}
|
||||
</td>
|
||||
<td data-title="{{dt.displayIp}}">
|
||||
{{inst.displayIp}}
|
||||
|
|
|
|||
|
|
@ -56,11 +56,6 @@
|
|||
{{/each}}
|
||||
</tbody>
|
||||
</table>
|
||||
{{#if ary.length}}
|
||||
<div class="protip mb-5">
|
||||
{{t 'formKeyValue.protip'}}
|
||||
</div>
|
||||
{{/if}}
|
||||
{{else}}
|
||||
{{#unless editing}}
|
||||
<div>{{t 'generic.none'}}</div>
|
||||
|
|
@ -68,6 +63,11 @@
|
|||
{{/if}}
|
||||
|
||||
{{#if (and editing allowAdd)}}
|
||||
{{#if ary.length}}
|
||||
<div class="protip mb-5">
|
||||
{{t 'formKeyValue.protip'}}
|
||||
</div>
|
||||
{{/if}}
|
||||
<div>
|
||||
<button class="btn bg-link icon-btn p-0" {{action "add"}}>
|
||||
<span class="darken"><i class="icon icon-plus text-small"/></span>
|
||||
|
|
|
|||
Loading…
Reference in New Issue