Skip to content

Commit 6c8a534

Browse files
ly5156rak-phillip
authored andcommitted
fix(edit/service): fix the error in the number of matched pods
1 parent 25e9295 commit 6c8a534

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

shell/edit/service.vue

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -272,10 +272,14 @@ export default {
272272
273273
async loadPods() {
274274
try {
275-
const hash = {
276-
provClusters: this.$store.dispatch('management/findAll', { type: CAPI.RANCHER_CLUSTER }),
277-
harvesterConfigs: this.$store.dispatch(`management/findAll`, { type: HCI.HARVESTER_CONFIG }),
278-
};
275+
const hash = {};
276+
277+
if (this.$store.getters[`management/canList`](CAPI.RANCHER_CLUSTER)) {
278+
hash.provClusters = this.$store.dispatch('management/findAll', { type: CAPI.RANCHER_CLUSTER });
279+
}
280+
if (this.$store.getters[`management/canList`](HCI.HARVESTER_CONFIG)) {
281+
hash.harvesterConfigs = this.$store.dispatch(`management/findAll`, { type: HCI.HARVESTER_CONFIG });
282+
}
279283
280284
await allHash(hash);
281285
this.updateMatchingPods();

0 commit comments

Comments
 (0)