mirror of https://github.com/rancher/dashboard.git
23 lines
579 B
JavaScript
23 lines
579 B
JavaScript
import { CAPI } from '@/config/types';
|
|
import { escapeHtml } from '@/utils/string';
|
|
|
|
export default {
|
|
cluster() {
|
|
if ( !this.spec.clusterName ) {
|
|
return null;
|
|
}
|
|
|
|
const clusterId = `${ this.metadata.namespace }/${ this.spec.clusterName }`;
|
|
|
|
const cluster = this.$rootGetters['management/byId'](CAPI.RANCHER_CLUSTER, clusterId);
|
|
|
|
return cluster;
|
|
},
|
|
|
|
groupByLabel() {
|
|
const name = this.cluster?.nameDisplay || this.spec.clusterName;
|
|
|
|
return this.$rootGetters['i18n/t']('resourceTable.groupLabel.cluster', { name: escapeHtml(name) });
|
|
},
|
|
};
|