mirror of https://github.com/rancher/dashboard.git
Merge pull request #11589 from richard-cox/fix-home-scaling-issue
Fix home page cluster description scaling issue
This commit is contained in:
commit
4fe4aa16be
|
|
@ -10,7 +10,7 @@ import { addParams } from '@shell/utils/url';
|
|||
import { isEmpty } from '@shell/utils/object';
|
||||
import { HARVESTER_NAME as HARVESTER } from '@shell/config/features';
|
||||
import { isHarvesterCluster } from '@shell/utils/cluster';
|
||||
import HybridModel from '@shell/plugins/steve/hybrid-class';
|
||||
import SteveModel from '@shell/plugins/steve/steve-class';
|
||||
import { LINUX, WINDOWS } from '@shell/store/catalog';
|
||||
import { KONTAINER_TO_DRIVER } from './management.cattle.io.kontainerdriver';
|
||||
import { PINNED_CLUSTERS } from '@shell/store/prefs';
|
||||
|
|
@ -27,7 +27,7 @@ function findRelationship(verb, type, relationships = []) {
|
|||
return relationships.find((r) => r[from] === type)?.[id];
|
||||
}
|
||||
|
||||
export default class MgmtCluster extends HybridModel {
|
||||
export default class MgmtCluster extends SteveModel {
|
||||
get details() {
|
||||
const out = [
|
||||
{
|
||||
|
|
|
|||
|
|
@ -986,4 +986,8 @@ export default class ProvCluster extends SteveModel {
|
|||
'spec.rkeConfig.machinePools.dynamicSchemaSpec',
|
||||
];
|
||||
}
|
||||
|
||||
get description() {
|
||||
return super.description || this.mgmt?.description;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -91,10 +91,6 @@ export default {
|
|||
...mapGetters(['currentCluster', 'defaultClusterId', 'releaseNotesUrl']),
|
||||
mcm: mapFeature(MULTI_CLUSTER),
|
||||
|
||||
mgmtClusters() {
|
||||
return this.$store.getters['management/all'](MANAGEMENT.CLUSTER);
|
||||
},
|
||||
|
||||
provClusters() {
|
||||
return this.$store.getters['management/all'](CAPI.RANCHER_CLUSTER);
|
||||
},
|
||||
|
|
@ -211,15 +207,7 @@ export default {
|
|||
},
|
||||
|
||||
kubeClusters() {
|
||||
const filteredClusters = filterHiddenLocalCluster(filterOnlyKubernetesClusters(this.provClusters || [], this.$store), this.$store);
|
||||
|
||||
return filteredClusters.map((provCluster) => {
|
||||
const mgmtCluster = this.mgmtClusters?.find((c) => provCluster.mgmt?.id === c.id);
|
||||
|
||||
provCluster.description = provCluster.description || mgmtCluster?.description;
|
||||
|
||||
return provCluster;
|
||||
});
|
||||
return filterHiddenLocalCluster(filterOnlyKubernetesClusters(this.provClusters || [], this.$store), this.$store);
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { ANNOTATIONS_TO_IGNORE_REGEX, LABELS_TO_IGNORE_REGEX, DESCRIPTION } from '@shell/config/labels-annotations';
|
||||
import { ANNOTATIONS_TO_IGNORE_REGEX, LABELS_TO_IGNORE_REGEX } from '@shell/config/labels-annotations';
|
||||
import omitBy from 'lodash/omitBy';
|
||||
import pickBy from 'lodash/pickBy';
|
||||
import Vue from 'vue';
|
||||
|
|
@ -100,8 +100,4 @@ export default class HybridModel extends Resource {
|
|||
get state() {
|
||||
return this.stateObj?.name || 'unknown';
|
||||
}
|
||||
|
||||
get description() {
|
||||
return this.metadata?.annotations?.[DESCRIPTION] || this.spec?.description || this._description;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue