add getServerVersion in harvester-common store

This commit is contained in:
andy.lee
2024-11-12 11:50:46 +01:00
committed by Francesco Torchia
parent 5cc8a69052
commit 86461e1dbd
7 changed files with 9 additions and 9 deletions
+2 -2
View File
@@ -7,7 +7,7 @@ export const docLink = (suffix, version) => {
return `https://docs.harvesterhci.io/${ docVersion }${ suffix }`;
};
export function featureVersion(v) {
export function getVersion(v) {
// e.g v1.4.0
if (process.env.VUE_APP_SERVER_VERSION) {
return process.env.VUE_APP_SERVER_VERSION;
@@ -22,7 +22,7 @@ export function featureVersion(v) {
}
export const featureEnabled = (featureKey, serverVersion) => {
const version = featureVersion(serverVersion);
const version = getVersion(serverVersion);
const releasedFeatures = RELEASE_FEATURES[version] || [];
return releasedFeatures.includes(featureKey);