Add Single product home; add labels

Signed-off-by: Francesco Torchia <francesco.torchia@suse.com>
This commit is contained in:
Francesco Torchia 2024-04-29 20:50:58 +02:00
parent 675c45f77b
commit 4c14e5250f
No known key found for this signature in database
GPG Key ID: E6D011B7415D4393
4 changed files with 2881 additions and 1 deletions

View File

@ -1,2 +1,3 @@
export const PRODUCT_NAME = 'harvester';
export const BLANK_CLUSTER = '_';
export const LOGO = require(`@shell/assets/images/providers/harvester.svg`);

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,11 +1,28 @@
import { IPlugin } from '@shell/core/types';
import { PRODUCT_NAME, BLANK_CLUSTER } from './config/harvester';
import { PRODUCT_NAME, BLANK_CLUSTER, LOGO as logo } from './config/harvester';
import { HCI } from './config/types';
export function init($plugin: IPlugin, store: any) {
const { product } = $plugin.DSL(store, PRODUCT_NAME);
const isSingleProduct = process.env.rancherEnv === PRODUCT_NAME;
if (isSingleProduct) {
const home = {
name: `${ PRODUCT_NAME }-c-cluster`,
path: `/${ PRODUCT_NAME }/c/:cluster`
};
store.dispatch('setIsSingleProduct', {
productNameKey: 'harvester.productLabel',
getVersionInfo: (store: any) => store.getters[`${ PRODUCT_NAME }/byId`]?.(HCI.SETTING, 'server-version')?.value || 'unknown',
afterLoginRoute: home,
logoRoute: home,
supportCustomLogo: true,
logo,
});
}
product({
inStore: 'management',
showNamespaceFilter: true,