mirror of
https://github.com/harvester/harvester-ui-extension.git
synced 2025-12-13 13:11:43 +00:00
Add unsupported server version check
Signed-off-by: Francesco Torchia <francesco.torchia@suse.com>
This commit is contained in:
parent
b8a1403655
commit
9a89f45a2a
@ -39,6 +39,11 @@ generic:
|
|||||||
basic: Basic
|
basic: Basic
|
||||||
loading: Loading...
|
loading: Loading...
|
||||||
|
|
||||||
|
unsupported:
|
||||||
|
serverVersion: 'Current version: <code>{serverVersion}</code>'
|
||||||
|
description: Harvester ui only supports Harvester cluster versions greater or equal to 1.3.0
|
||||||
|
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 <a target="_blank" href="https://docs.harvesterhci.io/" rel="noopener noreferrer nofollow">Harvester Docs</a>
|
||||||
|
|
||||||
nav:
|
nav:
|
||||||
group:
|
group:
|
||||||
networks: Networks
|
networks: Networks
|
||||||
|
|||||||
85
pkg/harvester/pages/c/_cluster/unsupported/index.vue
Normal file
85
pkg/harvester/pages/c/_cluster/unsupported/index.vue
Normal file
@ -0,0 +1,85 @@
|
|||||||
|
<script>
|
||||||
|
import BrandImage from '@shell/components/BrandImage';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
components: { BrandImage },
|
||||||
|
|
||||||
|
computed: {
|
||||||
|
serverVersion() {
|
||||||
|
const version = this.$store.getters['harvester-common/getServerVersion']() || '';
|
||||||
|
|
||||||
|
return version.replace('v', '');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div class="dashboard-root">
|
||||||
|
<div class="dashboard-content">
|
||||||
|
<main class="main-layout">
|
||||||
|
<div class="logo">
|
||||||
|
<BrandImage
|
||||||
|
file-name="harvester.png"
|
||||||
|
height="64"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div class="tagline">
|
||||||
|
<div class="description">
|
||||||
|
{{ t('unsupported.description') }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="tagline">
|
||||||
|
<div v-clean-html="t('unsupported.serverVersion', { serverVersion }, true)" />
|
||||||
|
</div>
|
||||||
|
<div class="tagline">
|
||||||
|
<div v-clean-html="t('unsupported.learnMore', {}, true)" />
|
||||||
|
</div>
|
||||||
|
</main>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.dashboard-root {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
height: 100vh;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dashboard-content {
|
||||||
|
display: grid;
|
||||||
|
flex-grow:1;
|
||||||
|
|
||||||
|
grid-template-areas:
|
||||||
|
"main";
|
||||||
|
|
||||||
|
grid-template-columns: auto;
|
||||||
|
grid-template-rows: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.logo {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
margin: 200px 0 40px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tagline {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
margin-top: 30px;
|
||||||
|
|
||||||
|
> div {
|
||||||
|
font-size: 16px;
|
||||||
|
line-height: 22px;
|
||||||
|
max-width: 80%;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.description {
|
||||||
|
font-size: 24px !important;
|
||||||
|
font-weight: 400;
|
||||||
|
}
|
||||||
|
|
||||||
|
</style>
|
||||||
@ -15,8 +15,25 @@ import HarvesterAirgapUpdgrade from '../pages/c/_cluster/airgapupgrade/index.vue
|
|||||||
import HarvesterMembers from '../pages/c/_cluster/members/index.vue';
|
import HarvesterMembers from '../pages/c/_cluster/members/index.vue';
|
||||||
import ProjectNamespaces from '../pages/c/_cluster/projectsnamespaces.vue';
|
import ProjectNamespaces from '../pages/c/_cluster/projectsnamespaces.vue';
|
||||||
import HarvesterAlertmanagerReceiver from '../pages/c/_cluster/alertmanagerconfig/_alertmanagerconfigid/receiver.vue';
|
import HarvesterAlertmanagerReceiver from '../pages/c/_cluster/alertmanagerconfig/_alertmanagerconfigid/receiver.vue';
|
||||||
|
import HarvesterUnsupported from '../pages/c/_cluster/unsupported/index.vue';
|
||||||
|
|
||||||
const routes = [
|
const routes = [
|
||||||
|
{
|
||||||
|
route: {
|
||||||
|
name: `${ PRODUCT_NAME }-c-cluster-unsupported-standalone`,
|
||||||
|
path: `/:product`,
|
||||||
|
component: HarvesterUnsupported
|
||||||
|
},
|
||||||
|
parent: 'blank'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
route: {
|
||||||
|
name: `${ PRODUCT_NAME }-c-cluster-unsupported`,
|
||||||
|
path: `/:product`,
|
||||||
|
component: HarvesterUnsupported
|
||||||
|
},
|
||||||
|
parent: 'plain'
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: `${ PRODUCT_NAME }-c-cluster-support`,
|
name: `${ PRODUCT_NAME }-c-cluster-support`,
|
||||||
path: `/:product/c/:cluster/support`,
|
path: `/:product/c/:cluster/support`,
|
||||||
|
|||||||
@ -101,6 +101,19 @@ export default {
|
|||||||
|
|
||||||
const res: any = await allHash(hash);
|
const res: any = await allHash(hash);
|
||||||
|
|
||||||
|
const isHarvesterVersionSupported = rootGetters['harvester-common/getFeatureEnabled']('supportHarvesterClusterVersion');
|
||||||
|
|
||||||
|
if (!isHarvesterVersionSupported) {
|
||||||
|
const product = rootGetters['productId'];
|
||||||
|
|
||||||
|
this.$router?.push({
|
||||||
|
name: `${ product }-c-cluster-unsupported${ id === 'local' ? '-standalone' : '' }`,
|
||||||
|
params: { product }
|
||||||
|
});
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
await dispatch('cleanNamespaces', null, { root: true });
|
await dispatch('cleanNamespaces', null, { root: true });
|
||||||
|
|
||||||
commit('updateNamespaces', {
|
commit('updateNamespaces', {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user