mirror of
https://github.com/harvester/harvester-ui-extension.git
synced 2025-12-13 21:21:44 +00:00
disable cluster link if harvester version lower than v1.3.0
Signed-off-by: andy.lee <andy.lee@suse.com>
This commit is contained in:
parent
244a3f8e06
commit
b566caf2e1
@ -113,6 +113,12 @@ export default {
|
|||||||
@finish="saveOverride"
|
@finish="saveOverride"
|
||||||
@error="e=>errors = e"
|
@error="e=>errors = e"
|
||||||
>
|
>
|
||||||
|
<Banner
|
||||||
|
v-if="isCreate"
|
||||||
|
color="info"
|
||||||
|
>
|
||||||
|
{{ t('harvesterManager.cluster.supportMessage') }}
|
||||||
|
</Banner>>
|
||||||
<div class="mt-20">
|
<div class="mt-20">
|
||||||
<NameNsDescription
|
<NameNsDescription
|
||||||
v-if="!isView"
|
v-if="!isView"
|
||||||
|
|||||||
@ -5,6 +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
|
||||||
plugins:
|
plugins:
|
||||||
loadError: Error loading harvester plugin
|
loadError: Error loading harvester plugin
|
||||||
rke:
|
rke:
|
||||||
|
|||||||
@ -87,6 +87,16 @@ 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
|
||||||
@ -148,7 +158,7 @@ export default {
|
|||||||
<a
|
<a
|
||||||
v-if="row.isReady"
|
v-if="row.isReady"
|
||||||
class="link"
|
class="link"
|
||||||
:disabled="navigating ? true : null"
|
:disabled="disableClusterLink(row)"
|
||||||
@click="goToCluster(row)"
|
@click="goToCluster(row)"
|
||||||
>{{ row.nameDisplay }}</a>
|
>{{ row.nameDisplay }}</a>
|
||||||
<span v-else>
|
<span v-else>
|
||||||
|
|||||||
@ -2,7 +2,8 @@ import ProvCluster from '@shell/models/provisioning.cattle.io.cluster';
|
|||||||
import { DEFAULT_WORKSPACE, HCI, MANAGEMENT } from '@shell/config/types';
|
import { DEFAULT_WORKSPACE, HCI, MANAGEMENT } from '@shell/config/types';
|
||||||
import { HARVESTER_NAME, HARVESTER_NAME as VIRTUAL } from '@shell/config/features';
|
import { HARVESTER_NAME, HARVESTER_NAME as VIRTUAL } from '@shell/config/features';
|
||||||
import { SETTING } from '@shell/config/settings';
|
import { SETTING } from '@shell/config/settings';
|
||||||
|
import semver from 'semver';
|
||||||
|
import { serverVersion } from '../utils/feature-flags';
|
||||||
export default class HciCluster extends ProvCluster {
|
export default class HciCluster extends ProvCluster {
|
||||||
get stateObj() {
|
get stateObj() {
|
||||||
return this._stateObj;
|
return this._stateObj;
|
||||||
@ -29,6 +30,26 @@ export default class HciCluster extends ProvCluster {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get stateDescription() {
|
||||||
|
if (!this.isSupportedHarvesterVersion) {
|
||||||
|
return this.t('harvesterManager.cluster.supportMessage');
|
||||||
|
}
|
||||||
|
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* harvester ui extension only supports harvester cluster version >= 1.3.0
|
||||||
|
*/
|
||||||
|
get isSupportedHarvesterVersion() {
|
||||||
|
const version = serverVersion(this.$rootGetters);
|
||||||
|
|
||||||
|
// eslint-disable-next-line no-console
|
||||||
|
console.log('🚀 ~ HciCluster ~ getisSupportedHarvesterVersion ~ version:', version);
|
||||||
|
|
||||||
|
return semver.gte(version, '1.3.0');
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fetch and cache the response for /ui-info
|
* Fetch and cache the response for /ui-info
|
||||||
*
|
*
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user