mirror of
https://github.com/harvester/harvester-ui-extension.git
synced 2025-12-13 21:21:44 +00:00
show denied status if harvester version is not supported
Signed-off-by: andy.lee <andy.lee@suse.com>
This commit is contained in:
parent
b566caf2e1
commit
4d2eef3b6c
@ -115,10 +115,10 @@ export default {
|
||||
>
|
||||
<Banner
|
||||
v-if="isCreate"
|
||||
color="info"
|
||||
color="warning"
|
||||
>
|
||||
{{ t('harvesterManager.cluster.supportMessage') }}
|
||||
</Banner>>
|
||||
</Banner>
|
||||
<div class="mt-20">
|
||||
<NameNsDescription
|
||||
v-if="!isView"
|
||||
|
||||
@ -5,7 +5,7 @@ harvesterManager:
|
||||
none: There are no Harvester Clusters
|
||||
learnMore: Learn more about Harvester from the <a target="_blank" href="https://harvesterhci.io/" rel="noopener noreferrer nofollow">Harvester Web Site</a> or read the the <a target="_blank" href="https://docs.harvesterhci.io/" rel="noopener noreferrer nofollow">Harvester Docs</a>
|
||||
description: Harvester is a modern Hyperconverged infrastructure (HCI) solution built for bare metal servers using enterprise-grade open source technologies including Kubernetes, Kubevirt and Longhorn.
|
||||
supportMessage: Harvester UI Extension only supports Harvester cluster version >= 1.3.0
|
||||
supportMessage: Harvester ui extension only supports Harvester cluster version greater or equal to 1.3.0
|
||||
plugins:
|
||||
loadError: Error loading harvester plugin
|
||||
rke:
|
||||
|
||||
@ -87,16 +87,6 @@ export default {
|
||||
},
|
||||
|
||||
methods: {
|
||||
disableClusterLink(row) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.log('🚀 ~ disableClusterLink ~ row:', row);
|
||||
if (!row.isSupportedHarvesterVersion) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return this.navigating ? true : null;
|
||||
},
|
||||
|
||||
async goToCluster(row) {
|
||||
const timeout = setTimeout(() => {
|
||||
// Don't show loading indicator for quickly fetched plugins
|
||||
@ -156,9 +146,9 @@ export default {
|
||||
<td>
|
||||
<span class="cluster-link">
|
||||
<a
|
||||
v-if="row.isReady"
|
||||
v-if="row.isReady && row.isSupportedHarvesterVersion"
|
||||
class="link"
|
||||
:disabled="disableClusterLink(row)"
|
||||
:disabled="navigating ? true : null"
|
||||
@click="goToCluster(row)"
|
||||
>{{ row.nameDisplay }}</a>
|
||||
<span v-else>
|
||||
|
||||
@ -4,8 +4,14 @@ import { HARVESTER_NAME, HARVESTER_NAME as VIRTUAL } from '@shell/config/feature
|
||||
import { SETTING } from '@shell/config/settings';
|
||||
import semver from 'semver';
|
||||
import { serverVersion } from '../utils/feature-flags';
|
||||
import { colorForState, stateDisplay, STATES_ENUM } from '@shell/plugins/dashboard-store/resource-class';
|
||||
|
||||
export default class HciCluster extends ProvCluster {
|
||||
get stateObj() {
|
||||
if (!this.isSupportedHarvesterVersion) {
|
||||
return { error: true, message: this.t('harvesterManager.cluster.supportMessage') };
|
||||
}
|
||||
|
||||
return this._stateObj;
|
||||
}
|
||||
|
||||
@ -30,12 +36,20 @@ export default class HciCluster extends ProvCluster {
|
||||
return false;
|
||||
}
|
||||
|
||||
get stateDescription() {
|
||||
get stateColor() {
|
||||
if (!this.isSupportedHarvesterVersion) {
|
||||
return this.t('harvesterManager.cluster.supportMessage');
|
||||
return colorForState(STATES_ENUM.DENIED);
|
||||
}
|
||||
|
||||
return '';
|
||||
return colorForState(this.state);
|
||||
}
|
||||
|
||||
get stateDisplay() {
|
||||
if (!this.isSupportedHarvesterVersion) {
|
||||
return stateDisplay(STATES_ENUM.DENIED);
|
||||
}
|
||||
|
||||
return stateDisplay(this.state);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user