diff --git a/pkg/harvester/config/harvester.js b/pkg/harvester/config/harvester.js index 64bdfa2e58d..4ba8a63aa18 100644 --- a/pkg/harvester/config/harvester.js +++ b/pkg/harvester/config/harvester.js @@ -24,6 +24,7 @@ import { CONFIGURED_PROVIDERS, SUB_TYPE, ADDRESS, + NS_SNAPSHOT_QUOTA } from '@shell/config/table-headers'; import { @@ -32,7 +33,6 @@ import { FINGERPRINT, IMAGE_PROGRESS, SNAPSHOT_TARGET_VOLUME, - NS_SNAPSHOT_QUOTA, } from './table-headers'; import { IF_HAVE } from '@shell/store/type-map'; diff --git a/pkg/harvester/config/table-headers.js b/pkg/harvester/config/table-headers.js index d2eda831008..fa0c42bfcb4 100644 --- a/pkg/harvester/config/table-headers.js +++ b/pkg/harvester/config/table-headers.js @@ -42,19 +42,3 @@ export const SNAPSHOT_TARGET_VOLUME = { sort: 'spec.source.persistentVolumeClaimName', formatter: 'SnapshotTargetVolume', }; - -// The column of total snapshot quota column on namespace list page -export const NS_SNAPSHOT_QUOTA = { - name: 'NamespaceSnapshotQuota', - labelKey: 'harvester.tableHeaders.totalSnapshotQuota', - value: 'snapshotSizeQuota', - sort: 'snapshotSizeQuota', - align: 'center', - formatter: 'Si', - formatterOpts: { - opts: { - increment: 1024, addSuffix: true, suffix: 'i', - }, - needParseSi: false - }, -}; diff --git a/shell/components/ExplorerProjectsNamespaces.vue b/shell/components/ExplorerProjectsNamespaces.vue index 3c25fc80fb7..49178a4851d 100644 --- a/shell/components/ExplorerProjectsNamespaces.vue +++ b/shell/components/ExplorerProjectsNamespaces.vue @@ -12,6 +12,7 @@ import { defaultTableSortGenerationFn } from '@shell/components/ResourceTable.vu import { NAMESPACE_FILTER_ALL_ORPHANS } from '@shell/utils/namespace-filter'; import ResourceFetch from '@shell/mixins/resource-fetch'; import DOMPurify from 'dompurify'; +import { HARVESTER_NAME as HARVESTER } from '@shell/config/features'; export default { name: 'ListProjectNamespace', @@ -84,21 +85,33 @@ export default { isNamespaceCreatable() { return (this.schema?.collectionMethods || []).includes('POST'); }, + isHarvester() { + return this.$store.getters['currentProduct'].inStore === HARVESTER; + }, headers() { - const project = { - name: 'project', - label: this.t('tableHeaders.project'), - value: 'project.nameDisplay', - sort: ['projectNameSort', 'nameSort'], - }; - - return [ + const headers = [ STATE, NAME, - this.groupPreference === 'none' ? project : null, - NS_SNAPSHOT_QUOTA, - AGE - ].filter(h => h); + ]; + + if (this.groupPreference === 'none') { + const projectHeader = { + name: 'project', + label: this.t('tableHeaders.project'), + value: 'project.nameDisplay', + sort: ['projectNameSort', 'nameSort'], + }; + + headers.push(projectHeader); + } + + if (this.isHarvester) { + headers.push(NS_SNAPSHOT_QUOTA); + } + + headers.push(AGE); + + return headers; }, projectIdsWithNamespaces() { const ids = this.rows