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
|
<Banner
|
||||||
v-if="isCreate"
|
v-if="isCreate"
|
||||||
color="info"
|
color="warning"
|
||||||
>
|
>
|
||||||
{{ t('harvesterManager.cluster.supportMessage') }}
|
{{ t('harvesterManager.cluster.supportMessage') }}
|
||||||
</Banner>>
|
</Banner>
|
||||||
<div class="mt-20">
|
<div class="mt-20">
|
||||||
<NameNsDescription
|
<NameNsDescription
|
||||||
v-if="!isView"
|
v-if="!isView"
|
||||||
|
|||||||
@ -5,7 +5,7 @@ harvesterManager:
|
|||||||
none: There are no Harvester Clusters
|
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>
|
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.
|
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:
|
plugins:
|
||||||
loadError: Error loading harvester plugin
|
loadError: Error loading harvester plugin
|
||||||
rke:
|
rke:
|
||||||
|
|||||||
@ -87,16 +87,6 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
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) {
|
async goToCluster(row) {
|
||||||
const timeout = setTimeout(() => {
|
const timeout = setTimeout(() => {
|
||||||
// Don't show loading indicator for quickly fetched plugins
|
// Don't show loading indicator for quickly fetched plugins
|
||||||
@ -156,9 +146,9 @@ export default {
|
|||||||
<td>
|
<td>
|
||||||
<span class="cluster-link">
|
<span class="cluster-link">
|
||||||
<a
|
<a
|
||||||
v-if="row.isReady"
|
v-if="row.isReady && row.isSupportedHarvesterVersion"
|
||||||
class="link"
|
class="link"
|
||||||
:disabled="disableClusterLink(row)"
|
:disabled="navigating ? true : null"
|
||||||
@click="goToCluster(row)"
|
@click="goToCluster(row)"
|
||||||
>{{ row.nameDisplay }}</a>
|
>{{ row.nameDisplay }}</a>
|
||||||
<span v-else>
|
<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 { SETTING } from '@shell/config/settings';
|
||||||
import semver from 'semver';
|
import semver from 'semver';
|
||||||
import { serverVersion } from '../utils/feature-flags';
|
import { serverVersion } from '../utils/feature-flags';
|
||||||
|
import { colorForState, stateDisplay, STATES_ENUM } from '@shell/plugins/dashboard-store/resource-class';
|
||||||
|
|
||||||
export default class HciCluster extends ProvCluster {
|
export default class HciCluster extends ProvCluster {
|
||||||
get stateObj() {
|
get stateObj() {
|
||||||
|
if (!this.isSupportedHarvesterVersion) {
|
||||||
|
return { error: true, message: this.t('harvesterManager.cluster.supportMessage') };
|
||||||
|
}
|
||||||
|
|
||||||
return this._stateObj;
|
return this._stateObj;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -30,12 +36,20 @@ export default class HciCluster extends ProvCluster {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
get stateDescription() {
|
get stateColor() {
|
||||||
if (!this.isSupportedHarvesterVersion) {
|
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