From 62a19ee3fb90438f9aa4afa494605e635bf14903 Mon Sep 17 00:00:00 2001 From: Andy Lee Date: Tue, 23 Jun 2026 21:44:39 +0800 Subject: [PATCH] feat: add namespace filtering when updating namespaces (#940) Signed-off-by: Andy Lee --- pkg/harvester/store/harvester-store/actions.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pkg/harvester/store/harvester-store/actions.ts b/pkg/harvester/store/harvester-store/actions.ts index 74776173..0379607a 100644 --- a/pkg/harvester/store/harvester-store/actions.ts +++ b/pkg/harvester/store/harvester-store/actions.ts @@ -3,7 +3,8 @@ import { ClusterNotFoundError } from '@shell/utils/error'; import { SETTING } from '@shell/config/settings'; import { COUNT, NAMESPACE, MANAGEMENT } from '@shell/config/types'; import { allHash } from '@shell/utils/promise'; -import { DEV } from '@shell/store/prefs'; +import { DEV, NAMESPACE_FILTERS } from '@shell/store/prefs'; +import { createNamespaceFilterKeyWithId } from '@shell/utils/namespace-filter'; import { HCI } from '../../types'; export default { @@ -121,8 +122,11 @@ export default { await dispatch('cleanNamespaces', null, { root: true }); + const namespaceFilterKey = createNamespaceFilterKeyWithId(id, 'harvester'); + const savedFilters = rootGetters['prefs/get'](NAMESPACE_FILTERS)?.[namespaceFilterKey]; + commit('updateNamespaces', { - filters: [], + filters: savedFilters || [], all: getters.filterNamespace(), getters }, { root: true });