Display hosted k8s cluster region in cluster dashboard

This commit is contained in:
loganhz 2020-02-28 20:25:39 +08:00
parent 9278f01d96
commit d7376e21cb
2 changed files with 11 additions and 0 deletions

View File

@ -144,6 +144,14 @@ export default Resource.extend(Grafana, ResourceUsage, {
return get(this, 'configName') === 'rancherKubernetesEngineConfig';
}),
displayLocation: computed('configName', function() {
const configName = this.configName;
if ( configName ) {
return get(this, `${ configName }.region`) || get(this, `${ configName }.location`) || get(this, `${ configName }.zone`);
}
}),
provider: computed('configName', 'nodePools.@each.{driver,nodeTemplateId}', 'driver', function() {
const pools = get(this, 'nodePools') || [];
const firstPool = pools.objectAt(0);

View File

@ -2,6 +2,9 @@
<div class="vertical-middle">
<label class="acc-label vertical-middle p-0">{{t 'clustersPage.provider.label'}}:</label>
<span>{{cluster.displayProvider}}</span>
{{#if cluster.displayLocation}}
<span class="text-muted">({{cluster.displayLocation}})</span>
{{/if}}
</div>
<div class="vertical-middle">