mirror of
https://github.com/harvester/harvester-ui-extension.git
synced 2025-12-14 05:31:44 +00:00
fetch harvester setting
Signed-off-by: andy.lee <andy.lee@suse.com>
This commit is contained in:
parent
4d2eef3b6c
commit
8ba4dbd9e8
@ -31,7 +31,6 @@ export default {
|
|||||||
|
|
||||||
async fetch() {
|
async fetch() {
|
||||||
const inStore = this.$store.getters['currentProduct'].inStore;
|
const inStore = this.$store.getters['currentProduct'].inStore;
|
||||||
|
|
||||||
const hash = await allHash({
|
const hash = await allHash({
|
||||||
hciClusters: this.$store.dispatch(`${ inStore }/findAll`, { type: HCI.CLUSTER }),
|
hciClusters: this.$store.dispatch(`${ inStore }/findAll`, { type: HCI.CLUSTER }),
|
||||||
mgmtClusters: this.$store.dispatch(`${ inStore }/findAll`, { type: MANAGEMENT.CLUSTER })
|
mgmtClusters: this.$store.dispatch(`${ inStore }/findAll`, { type: MANAGEMENT.CLUSTER })
|
||||||
@ -39,6 +38,25 @@ export default {
|
|||||||
|
|
||||||
this.hciClusters = hash.hciClusters;
|
this.hciClusters = hash.hciClusters;
|
||||||
this.mgmtClusters = hash.mgmtClusters;
|
this.mgmtClusters = hash.mgmtClusters;
|
||||||
|
|
||||||
|
for (const cluster of this.mgmtClusters) {
|
||||||
|
const clusterId = cluster.id;
|
||||||
|
|
||||||
|
if (clusterId === 'local') {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (clusterId) {
|
||||||
|
try {
|
||||||
|
const settingUrl = `/k8s/clusters/${ clusterId }/v1/harvester/${ HCI.SETTING }s?exclude=metadata.managedFields`;
|
||||||
|
|
||||||
|
const r = await this.$store.dispatch('request', { url: settingUrl, method: 'get' });
|
||||||
|
|
||||||
|
console.log('🚀 ~ fetch ~r = ', r);
|
||||||
|
} catch (e) {
|
||||||
|
console.info(`Failed to fetch harvester setting from ${ clusterId }, error=${ e }`); // eslint-disable-line no-console
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
data() {
|
data() {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user