mirror of
https://github.com/harvester/harvester-ui-extension.git
synced 2026-10-04 05:06:05 +08:00
Fix isSupportedHarvester
Signed-off-by: Francesco Torchia <francesco.torchia@suse.com>
This commit is contained in:
@@ -38,25 +38,6 @@ export default {
|
||||
|
||||
this.hciClusters = hash.hciClusters;
|
||||
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() {
|
||||
@@ -92,11 +73,18 @@ export default {
|
||||
},
|
||||
|
||||
rows() {
|
||||
return this.hciClusters.filter((c) => {
|
||||
const cluster = this.mgmtClusters.find((cluster) => cluster?.metadata?.name === c?.status?.clusterName);
|
||||
return this.hciClusters
|
||||
.filter((c) => {
|
||||
const cluster = this.mgmtClusters.find((cluster) => cluster?.metadata?.name === c?.status?.clusterName);
|
||||
|
||||
return isHarvesterCluster(cluster);
|
||||
});
|
||||
return isHarvesterCluster(cluster);
|
||||
})
|
||||
.map((row) => {
|
||||
if (row.isReady) {
|
||||
row.setSupportedHarvesterVersion();
|
||||
}
|
||||
return row;
|
||||
});
|
||||
},
|
||||
|
||||
typeDisplay() {
|
||||
@@ -164,7 +152,7 @@ export default {
|
||||
<td>
|
||||
<span class="cluster-link">
|
||||
<a
|
||||
v-if="row.isReady && row.isSupportedHarvesterVersion"
|
||||
v-if="row.isReady && row.isSupportedHarvester"
|
||||
class="link"
|
||||
:disabled="navigating ? true : null"
|
||||
@click="goToCluster(row)"
|
||||
|
||||
Reference in New Issue
Block a user