Files
harvester-ui-extension/pkg/harvester/config/harvester-cluster.js
T
mergify[bot]andMarcelo Fukumoto d8d33ff14f feat: page the VM list on the server when the API supports it (#1261) (#1273)
* feat: page the VM list on the server when the API supports it

On clusters whose API serves lists from the Steve SQL cache, the VM list
uses PaginatedResourceTable: it loads one page of VMs, and the VMIs, pods,
PVCs, PVs, migrations, restores and backups of those VMs only. Sorting,
search and the namespace filter run on the server, so CPU, memory, IP and
node can't be sorted or searched there.

The feature is gated by the vmListPagination feature flag and enabled for
the VM list only, through a pagination context. Older clusters keep the
current list.



* feat: enable the VM list pagination from v1.10.0

The backend change that serves API lists from the SQL cache has to be on
the v1.10 branch before this is merged.



* fix: keep the paged VM list when adding a volume

The Add Volume dialog loaded every VM to find the volumes in use, which
replaced the page the VM list keeps in the store and emptied the list.
When the list is paged, the dialog now reads only the VMs of the
namespace and doesn't store them.

The requests for the resources of a page use one IN filter instead of
one filter per value, which keeps the URLs about a third as long.



* fix: keep the paged VM list intact in its dialogs and on older APIs

The Add Volume, Storage Migration and Restore dialogs read the VMs, PVCs
and backups of the VM's namespace through the VM. While the list keeps a
page of a type in the store they read the namespace without storing it,
so the list keeps its page and the dialogs' own lists don't shrink when
the page reloads. Storage Migration no longer offers volumes of VMs on
other pages as targets.

The list is paged only when the API lists the VM's printer columns as
metadata.fields, which the SQL cache does, so a missing or non-semver
server version can't turn it on against an API that can't filter.

One failed request for a page's resources no longer stops the others.



* fix: show the restart notice only when its VMs change

The list rebuilds the names of the VMs that need a restart on every
refresh, and when it pages also on every page, sort and search, so the
notice popped up again each time even when nothing new needed a
restart. Show it only when the set of VMs changes.

While paging it still covers only the VMs on the current page: the API
can't filter VMs by their RestartRequired condition.



* fix: find the launcher pods of every VM on the page

The paged list loaded the page's launcher pods by the harvesterhci.io/vmName
label, which only the Harvester VM form writes into a VM's template. VMs
created any other way, like an imported VM or one applied with kubectl,
got no pod, so their rows lost View Logs and the starting and pod error
states.

Load the pods after the page's VMIs instead, by the kubevirt.io/created-by
label KubeVirt puts on every launcher pod (the VMI's UID).

Also cover the paged mode in the tests: it must not load every VMI,
migration or pod, and a forced refresh must reach every request.



* fix: notify about restarts again when coming back to the VM list

The restart notice compared the VMs that need a restart with the
previous value of the list. Coming back from a page that loads every VM,
like Volumes or a VM's detail page, that previous value already held the
same VMs, so the notice didn't show. Remember what was notified on the
list itself instead, so each visit starts fresh, and compare by namespace
and name, so a VM of the same name in another namespace counts as a
change.

Also say which VMs lack Harvester's vmName label: the ones from Forklift
or plain manifests, not every VM created outside the UI.



* refactor: keep the VM list's paging helpers in the component

Only canPaginate stays outside, because ResourceList calls
$loadingResources(route, store) on the component options, where there is
no `this`. The pagination headers become a computed property and the
printer column lookup a method.



* refactor: always list VMs with PaginatedResourceTable

PaginatedResourceTable handles both modes. fetchSecondaryResources loads
every pod, volume, restore, backup, VMI and migration when the list isn't
paged, and only what every row shares when it is. VMIs without a VM are
added back through localFilter, which only runs without pagination.

The list passes the pagination context only when the cluster's API can
page, so older clusters keep the full list.



* refactor: register the VM list's columns with the product

Both column sets go through the product's headers(), with the paged set
next to the unpaged one in config/table-headers.js. The list only adds the
node and restore progress columns, which the API can't sort or search when
paging. State sorts by the VM's Status printer column, metadata.fields.2.



* fix: show the restart notice when coming back to the VM list

Since the list always uses PaginatedResourceTable it reads the VMs from
the store. Coming back to the list the store already holds them, so the
restart watcher never saw a change and the notice didn't show. Run it
when the list is created too.

While paging, the store can still hold the VMs another view loaded, like
every VM after Volumes or a VM's detail, so wait for the list's own page
before notifying.



* fix: let the namespace filter know the VM list is paged

The VMs were registered for pagination with a context that only the VM
list passed. The header's namespace filter asks without one, so it didn't
know the list was paged and kept offering "Not in a Project", which the
paged API can't filter by: picking it hid every VM.

Register the VMs in every context and answer per cluster in the store's
paginationEnabled getter instead: only when the feature is on and the
API lists the VM's printer columns as metadata.fields, as the SQL cache
does. The filter, the list and the store now agree, and clusters whose
API can't page keep the full list.

The filter is shared by every list, so Not in a Project can still be
picked on a list that doesn't page. The paged VM list then asks for
another option, like the shell's generic lists do, instead of showing
no rows.



* fix: keep the paged VM list when showing a VM's configuration

The Config tab of the Show Configuration drawer renders the VM form,
which loads every VM, PVC, PV, VMI and migration, and its device tabs
every VM again. On a paged list that replaced the list's page in the
store and emptied the list.

Hide the Config tab while the store keeps a page of VMs, so the drawer
shows the YAML. The VM's own page still shows its configuration, and a
drawer opened where every VM is loaded keeps its Config tab.



* refactor: define the VM list's node and restore columns with the others

The node and restore progress columns are now in VM_HEADERS, so the paged
set turns their sort and search off through VM_PAGINATION_FIELDS, like the
other columns the API can't index. The list only leaves them out when they
don't apply: the node column when the cluster's nodes can't be seen, the
restore progress while no backup is being restored.



---------


(cherry picked from commit 0c6eee1744)

Signed-off-by: Marcelo Fukumoto <marcelo.fukumoto@suse.com>
Co-authored-by: Marcelo Fukumoto <marcelo.fukumoto@suse.com>
2026-11-21 01:47:34 +08:00

1618 lines
42 KiB
JavaScript

import {
NODE,
CONFIG_MAP,
NAMESPACE,
VIRTUAL_TYPES,
MANAGEMENT,
PVC,
NETWORK_ATTACHMENT,
MONITORING,
LOGGING,
STORAGE_CLASS,
SECRET,
NETWORK_POLICY
} from '@shell/config/types';
import { HCI, VOLUME_SNAPSHOT } from '../types';
import {
STATE,
NAME_UNLINKED,
NAME as NAME_COL,
AGE,
NAMESPACE as NAMESPACE_COL,
LOGGING_OUTPUT_PROVIDERS,
OUTPUT,
CLUSTER_OUTPUT,
CONFIGURED_PROVIDERS,
SUB_TYPE,
ADDRESS,
DESCRIPTION,
} from '@shell/config/table-headers';
import { IF_HAVE } from '@shell/store/type-map';
import {
IMAGE_DOWNLOAD_SIZE,
FINGERPRINT,
IMAGE_PROGRESS,
SNAPSHOT_TARGET_VOLUME,
IMAGE_VIRTUAL_SIZE,
IMAGE_STORAGE_CLASS,
HARVESTER_DESCRIPTION,
VM_IMPORT_SOURCE_VM,
VM_IMPORT_SOURCE_CLUSTER,
VM_IMPORT_STATUS,
VM_IMPORT_SOURCE_V_DC,
VM_IMPORT_SOURCE_V_ENDPOINT,
VM_IMPORT_SOURCE_V_STATUS,
VM_IMPORT_SOURCE_O_REGION,
VM_IMPORT_SOURCE_O_ENDPOINT,
VM_IMPORT_SOURCE_O_STATUS,
VM_IMPORT_SOURCE_OVA_URL,
VM_IMPORT_SOURCE_OVA_STATUS,
FORKLIFT_PROVIDER_TYPE,
FORKLIFT_PROVIDER_URL,
FORKLIFT_MAP_SOURCE_PROVIDER,
FORKLIFT_MAP_DEST_PROVIDER,
FORKLIFT_PLAN_TARGET_NS,
FORKLIFT_PLAN_VM_COUNT,
FORKLIFT_MIGRATION_PLAN,
VM_HEADERS,
VM_PAGINATION_HEADERS,
} from './table-headers';
import { ADD_ONS } from './harvester-map';
import { registerAddonSideNav } from '../utils/dynamic-nav';
import { setStandalonePrime } from '../utils/l10n-globals';
import { setVendor } from '@shell/config/private-label';
import { CONFIGURABLE_TABLES } from '@shell/store/features';
import { tableViewsOffFeature } from '../utils/table-views';
import { SETTING } from '@shell/config/settings';
import { primeBrandUpdater } from '../utils/prime-brand';
const TEMPLATE = HCI.VM_VERSION;
const MONITORING_GROUP = 'Monitoring & Logging::Monitoring';
const LOGGING_GROUP = 'Monitoring & Logging::Logging';
const OVERLAY_NETWORKS_GROUP = 'Overlay Networks';
const UNDERLAY_NETWORKS_GROUP = 'Underlay Networks';
const NAT_INTERNET_GROUP = `${ OVERLAY_NETWORKS_GROUP }::NAT & Internet`;
const GATEWAYS_GROUP = `${ NAT_INTERNET_GROUP }::Gateways`;
const EXTERNAL_IPS_GROUP = `${ NAT_INTERNET_GROUP }::External IPs`;
const RULES_GROUP = `${ NAT_INTERNET_GROUP }::Rules`;
const SOURCE_RULES_GROUP = `${ RULES_GROUP }::Source Rules`;
const DESTINATION_RULES_GROUP = `${ RULES_GROUP }::Destination Rules`;
export const PRODUCT_NAME = 'harvester';
export const IP_POOL_HEADERS = [
STATE,
NAME_COL,
{
name: 'subnet',
labelKey: 'harvester.ipPool.subnet.label',
value: 'subnetDisplay',
},
{
name: 'availableIP',
labelKey: 'harvester.ipPool.availableIP.label',
value: 'status.available',
},
AGE
];
export function init($plugin, store) {
const {
product,
basicType,
headers,
configureType,
virtualType,
weightGroup,
} = $plugin.DSL(store, PRODUCT_NAME);
const isSingleVirtualCluster = process.env.rancherEnv === PRODUCT_NAME;
if (isSingleVirtualCluster) {
const home = {
name: `${ PRODUCT_NAME }-c-cluster-resource`,
params: {
product: PRODUCT_NAME,
resource: HCI.DASHBOARD
}
};
store.watch(
(_state, getters) => JSON.stringify([
!!getters['harvester-common/isHarvesterPrime'],
getters['prefs/theme'] === 'dark',
getters['harvester-common/privateLabel']
]),
(value) => {
const [isHarvesterPrime, isDark, privateLabel] = JSON.parse(value);
const primeLogo = isDark ? require('../assets/images/dark/suse-virtualization.svg') : require('../assets/images/suse-virtualization.svg');
setStandalonePrime(isHarvesterPrime);
setVendor(privateLabel || '');
const primeLabelKey = privateLabel ? 'harvester.branding.primeLabel' : 'harvester.branding.primeEmptyLabel';
store.dispatch('setIsSingleProduct', {
productName: PRODUCT_NAME,
logo: isHarvesterPrime ? primeLogo : require(`@shell/assets/images/providers/harvester.svg`),
productNameKey: isHarvesterPrime ? primeLabelKey : 'harvester.productLabel',
getVersionInfo: (store) => store.getters[`${ PRODUCT_NAME }/byId`]?.(HCI.SETTING, 'server-version')?.value || 'unknown',
afterLoginRoute: home,
logoRoute: home,
supportCustomLogo: !isHarvesterPrime
});
},
{ immediate: true }
);
// Keep the shell's table views off: they drop the filters the lists put in the table header
store.watch(
(_state, getters) => getters['management/byId'](MANAGEMENT.FEATURE, CONFIGURABLE_TABLES),
(feature) => {
if (!feature) {
store.dispatch('management/load', { data: tableViewsOffFeature() });
}
},
{ immediate: true }
);
const updateBrand = primeBrandUpdater();
// The value is read too: a change event from the server is loaded into the same setting object
store.watch(
(_state, getters) => {
const brandSetting = getters['management/byId'](MANAGEMENT.SETTING, SETTING.BRAND);
return [!!getters['harvester-common/isHarvesterPrime'], brandSetting, brandSetting?.value];
},
([isHarvesterPrime, brandSetting]) => updateBrand(brandSetting, isHarvesterPrime),
{ immediate: true }
);
}
product({
inStore: 'harvester',
removable: false,
showNamespaceFilter: true,
hideKubeShell: true,
hideKubeConfig: true,
showClusterSwitcher: true,
hideCopyConfig: true,
hideSystemResources: true,
customNamespaceFilter: true,
typeStoreMap: {
[MANAGEMENT.PROJECT]: 'management',
[MANAGEMENT.CLUSTER_ROLE_TEMPLATE_BINDING]: 'management',
[MANAGEMENT.PROJECT_ROLE_TEMPLATE_BINDING]: 'management'
},
supportRoute: { name: `${ PRODUCT_NAME }-c-cluster-support` },
to: {
name: `${ PRODUCT_NAME }-c-cluster-resource`,
params: {
product: PRODUCT_NAME,
resource: HCI.DASHBOARD
}
},
hideNamespaceLocation: true,
});
basicType([HCI.DASHBOARD]);
virtualType({
labelKey: 'harvester.dashboard.label',
group: 'Root',
name: HCI.DASHBOARD,
weight: 500,
route: {
name: `${ PRODUCT_NAME }-c-cluster-resource`,
params: {
product: PRODUCT_NAME,
resource: HCI.DASHBOARD
}
}
});
configureType(HCI.DASHBOARD, { showListMasthead: false });
configureType(HCI.HOST, {
location: {
name: `${ PRODUCT_NAME }-c-cluster-resource`,
params: { resource: HCI.HOST }
},
resource: NODE,
resourceDetail: HCI.HOST,
resourceEdit: HCI.HOST,
canYaml: false,
});
configureType(HCI.HOST, { isCreatable: false, isEditable: true });
basicType([HCI.HOST]);
virtualType({
ifHaveType: NODE,
labelKey: 'harvester.host.label',
group: 'Root',
name: HCI.HOST,
namespaced: true,
weight: 499,
route: {
name: `${ PRODUCT_NAME }-c-cluster-resource`,
params: { resource: HCI.HOST }
},
exact: false
});
// multiVirtualCluster
basicType(['cluster-members'], 'rbac');
virtualType({
ifHave: IF_HAVE.MULTI_CLUSTER,
labelKey: 'members.clusterMembers',
group: 'root',
namespaced: false,
name: VIRTUAL_TYPES.CLUSTER_MEMBERS,
weight: 100,
route: { name: `${ PRODUCT_NAME }-c-cluster-members` },
exact: true,
ifHaveType: {
type: MANAGEMENT.CLUSTER_ROLE_TEMPLATE_BINDING,
store: 'management'
}
});
basicType([HCI.VM]);
configureType(HCI.VM, { canYaml: false });
headers(HCI.VM, VM_HEADERS, VM_PAGINATION_HEADERS);
virtualType({
labelKey: 'harvester.virtualMachine.label',
group: 'root',
name: HCI.VM,
namespaced: true,
weight: 498,
route: {
name: `${ PRODUCT_NAME }-c-cluster-resource`,
params: { resource: HCI.VM }
},
exact: false
});
// ===========================================================================
// VM Import Controller UI Flow
// ===========================================================================
// Define group (Hidden by default)
weightGroup('vmimport', 0, false);
// VirtualMachineImport
headers(HCI.VMIMPORT, [
STATE,
NAME_COL,
NAMESPACE_COL,
VM_IMPORT_SOURCE_VM,
VM_IMPORT_SOURCE_CLUSTER,
VM_IMPORT_STATUS,
AGE
]);
configureType(HCI.VMIMPORT, {
resource: HCI.VMIMPORT,
resourceDetail: HCI.VMIMPORT,
resourceEdit: HCI.VMIMPORT,
location: {
name: `${ PRODUCT_NAME }-c-cluster-resource`,
params: { resource: HCI.VMIMPORT }
}
});
virtualType({ // needed to avoid 404 on refresh when combined with registerAddonSideNav()
name: HCI.VMIMPORT,
labelKey: 'harvester.addons.vmImport.labels.vmimport',
group: 'vmimport',
namespaced: true,
ifHaveType: HCI.VMIMPORT,
route: {
name: `${ PRODUCT_NAME }-c-cluster-resource`,
params: { resource: HCI.VMIMPORT }
}
});
// Source: VMware
headers(HCI.VMIMPORT_SOURCE_V, [
STATE,
NAME_COL,
VM_IMPORT_SOURCE_V_ENDPOINT,
VM_IMPORT_SOURCE_V_DC,
VM_IMPORT_SOURCE_V_STATUS,
AGE
]);
configureType(HCI.VMIMPORT_SOURCE_V, {
resource: HCI.VMIMPORT_SOURCE_V,
resourceDetail: HCI.VMIMPORT_SOURCE_V,
resourceEdit: HCI.VMIMPORT_SOURCE_V,
location: {
name: `${ PRODUCT_NAME }-c-cluster-resource`,
params: { resource: HCI.VMIMPORT_SOURCE_V }
}
});
virtualType({ // needed to avoid 404 on refresh when combined with registerAddonSideNav()
name: HCI.VMIMPORT_SOURCE_V,
labelKey: 'harvester.addons.vmImport.labels.vmimportSourceVMWare',
group: 'vmimport',
namespaced: true,
ifHaveType: HCI.VMIMPORT_SOURCE_V,
route: {
name: `${ PRODUCT_NAME }-c-cluster-resource`,
params: { resource: HCI.VMIMPORT_SOURCE_V }
}
});
// Source: OpenStack
headers(HCI.VMIMPORT_SOURCE_O, [
STATE,
NAME_COL,
VM_IMPORT_SOURCE_O_ENDPOINT,
VM_IMPORT_SOURCE_O_REGION,
VM_IMPORT_SOURCE_O_STATUS,
AGE
]);
configureType(HCI.VMIMPORT_SOURCE_O, {
resource: HCI.VMIMPORT_SOURCE_O,
resourceDetail: HCI.VMIMPORT_SOURCE_O,
resourceEdit: HCI.VMIMPORT_SOURCE_O,
location: {
name: `${ PRODUCT_NAME }-c-cluster-resource`,
params: { resource: HCI.VMIMPORT_SOURCE_O }
}
});
virtualType({ // needed to avoid 404 on refresh when combined with registerAddonSideNav()
name: HCI.VMIMPORT_SOURCE_O,
labelKey: 'harvester.addons.vmImport.labels.vmimportSourceOpenStack',
group: 'vmimport',
namespaced: true,
ifHaveType: HCI.VMIMPORT_SOURCE_O,
route: {
name: `${ PRODUCT_NAME }-c-cluster-resource`,
params: { resource: HCI.VMIMPORT_SOURCE_O }
}
});
// Source: OVA
headers(HCI.VMIMPORT_SOURCE_OVA, [
STATE,
NAME_COL,
VM_IMPORT_SOURCE_OVA_URL,
VM_IMPORT_SOURCE_OVA_STATUS,
AGE
]);
configureType(HCI.VMIMPORT_SOURCE_OVA, {
resource: HCI.VMIMPORT_SOURCE_OVA,
resourceDetail: HCI.VMIMPORT_SOURCE_OVA,
resourceEdit: HCI.VMIMPORT_SOURCE_OVA,
location: {
name: `${ PRODUCT_NAME }-c-cluster-resource`,
params: { resource: HCI.VMIMPORT_SOURCE_OVA }
}
});
virtualType({ // needed to avoid 404 on refresh when combined with registerAddonSideNav()
name: HCI.VMIMPORT_SOURCE_OVA,
labelKey: 'harvester.addons.vmImport.labels.vmimportSourceOVA',
group: 'vmimport',
namespaced: true,
ifHaveType: HCI.VMIMPORT_SOURCE_OVA,
route: {
name: `${ PRODUCT_NAME }-c-cluster-resource`,
params: { resource: HCI.VMIMPORT_SOURCE_OVA }
}
});
// Enable SideNav based on Addon Status
registerAddonSideNav(store, PRODUCT_NAME, {
addonName: ADD_ONS.VM_IMPORT_CONTROLLER,
resourceType: HCI.ADD_ONS,
navGroup: 'vmimport',
types: [
HCI.VMIMPORT_SOURCE_V,
HCI.VMIMPORT_SOURCE_O,
HCI.VMIMPORT_SOURCE_OVA,
HCI.VMIMPORT
]
});
// ===========================================================================
basicType([HCI.VOLUME]);
configureType(HCI.VOLUME, {
location: {
name: `${ PRODUCT_NAME }-c-cluster-resource`,
params: { resource: HCI.VOLUME }
},
resource: PVC,
resourceDetail: HCI.VOLUME,
resourceEdit: HCI.VOLUME,
canYaml: false,
});
virtualType({
labelKey: 'harvester.volume.label',
group: 'root',
ifHaveType: PVC,
name: HCI.VOLUME,
namespaced: true,
weight: 497,
route: {
name: `${ PRODUCT_NAME }-c-cluster-resource`,
params: { resource: HCI.VOLUME }
},
exact: false
});
basicType([HCI.IMAGE]);
headers(HCI.IMAGE, [
STATE,
NAME_COL,
NAMESPACE_COL,
HARVESTER_DESCRIPTION,
IMAGE_STORAGE_CLASS,
IMAGE_PROGRESS,
IMAGE_DOWNLOAD_SIZE,
IMAGE_VIRTUAL_SIZE,
AGE
]);
configureType(HCI.IMAGE, { canYaml: false });
virtualType({
labelKey: 'harvester.image.label',
group: 'root',
name: HCI.IMAGE,
namespaced: true,
weight: 496,
route: {
name: `${ PRODUCT_NAME }-c-cluster-resource`,
params: { resource: HCI.IMAGE }
},
exact: false
});
basicType(['projects-namespaces']);
virtualType({
ifHave: IF_HAVE.MULTI_CLUSTER,
labelKey: 'harvester.projectNamespace.label',
group: 'root',
namespaced: true,
name: 'projects-namespaces',
weight: 495,
route: { name: `${ PRODUCT_NAME }-c-cluster-projectsnamespaces` },
exact: true,
});
if (isSingleVirtualCluster) {
headers(NAMESPACE, [STATE, NAME_UNLINKED, DESCRIPTION, AGE]);
basicType([NAMESPACE]);
virtualType({
labelKey: 'harvester.namespace.label',
name: NAMESPACE,
namespaced: true,
weight: 495,
route: {
name: `${ PRODUCT_NAME }-c-cluster-resource`,
params: { resource: NAMESPACE }
},
exact: false,
});
}
basicType([
HCI.ALERTMANAGERCONFIG
], MONITORING_GROUP);
basicType([
HCI.CLUSTER_FLOW,
HCI.CLUSTER_OUTPUT,
HCI.FLOW,
HCI.OUTPUT,
], LOGGING_GROUP);
weightGroup('Monitoring', 2, true);
weightGroup('Logging', 1, true);
headers(HCI.ALERTMANAGERCONFIG, [
STATE,
NAME_COL,
NAMESPACE_COL,
{
name: 'receivers',
labelKey: 'tableHeaders.receivers',
formatter: 'ReceiverIcons',
value: 'name'
},
]);
configureType(HCI.ALERTMANAGERCONFIG, {
location: {
name: `${ PRODUCT_NAME }-c-cluster-resource`,
params: { resource: HCI.ALERTMANAGERCONFIG },
},
resource: MONITORING.ALERTMANAGERCONFIG,
resourceDetail: HCI.ALERTMANAGERCONFIG,
resourceEdit: HCI.ALERTMANAGERCONFIG,
canYaml: false
});
virtualType({
ifHaveType: MONITORING.ALERTMANAGERCONFIG,
labelKey: 'harvester.monitoring.alertmanagerConfig.label',
name: HCI.ALERTMANAGERCONFIG,
namespaced: true,
weight: 87,
route: {
name: `${ PRODUCT_NAME }-c-cluster-resource`,
params: { resource: HCI.ALERTMANAGERCONFIG }
},
exact: false,
});
configureType(HCI.CLUSTER_FLOW, {
location: {
name: `${ PRODUCT_NAME }-c-cluster-resource`,
params: { resource: HCI.CLUSTER_FLOW },
},
resource: LOGGING.CLUSTER_FLOW,
resourceDetail: HCI.CLUSTER_FLOW,
resourceEdit: HCI.CLUSTER_FLOW,
canYaml: false,
});
virtualType({
ifHaveType: LOGGING.CLUSTER_FLOW,
labelKey: 'harvester.logging.clusterFlow.label',
name: HCI.CLUSTER_FLOW,
namespaced: true,
weight: 79,
route: {
name: `${ PRODUCT_NAME }-c-cluster-resource`,
params: { resource: HCI.CLUSTER_FLOW }
},
exact: false,
});
configureType(HCI.CLUSTER_OUTPUT, {
location: {
name: `${ PRODUCT_NAME }-c-cluster-resource`,
params: { resource: HCI.CLUSTER_OUTPUT },
},
resource: LOGGING.CLUSTER_OUTPUT,
resourceDetail: HCI.CLUSTER_OUTPUT,
resourceEdit: HCI.CLUSTER_OUTPUT,
canYaml: false,
});
virtualType({
ifHaveType: LOGGING.CLUSTER_OUTPUT,
labelKey: 'harvester.logging.clusterOutput.label',
name: HCI.CLUSTER_OUTPUT,
namespaced: true,
weight: 78,
route: {
name: `${ PRODUCT_NAME }-c-cluster-resource`,
params: { resource: HCI.CLUSTER_OUTPUT }
},
exact: false,
});
configureType(HCI.FLOW, {
location: {
name: `${ PRODUCT_NAME }-c-cluster-resource`,
params: { resource: HCI.FLOW },
},
resource: LOGGING.FLOW,
resourceDetail: HCI.FLOW,
resourceEdit: HCI.FLOW,
canYaml: false,
});
virtualType({
ifHaveType: LOGGING.FLOW,
labelKey: 'harvester.logging.flow.label',
name: HCI.FLOW,
namespaced: true,
weight: 77,
route: {
name: `${ PRODUCT_NAME }-c-cluster-resource`,
params: { resource: HCI.FLOW }
},
exact: false,
});
configureType(HCI.OUTPUT, {
location: {
name: `${ PRODUCT_NAME }-c-cluster-resource`,
params: { resource: HCI.OUTPUT },
},
resource: LOGGING.OUTPUT,
resourceDetail: HCI.OUTPUT,
resourceEdit: HCI.OUTPUT,
canYaml: false,
});
virtualType({
ifHaveType: LOGGING.OUTPUT,
labelKey: 'harvester.logging.output.label',
name: HCI.OUTPUT,
namespaced: true,
weight: 76,
route: {
name: `${ PRODUCT_NAME }-c-cluster-resource`,
params: { resource: HCI.OUTPUT }
},
exact: false,
});
headers(HCI.FLOW, [STATE, NAME_COL, NAMESPACE_COL, OUTPUT, CLUSTER_OUTPUT, CONFIGURED_PROVIDERS, AGE]);
headers(HCI.OUTPUT, [STATE, NAME_COL, NAMESPACE_COL, LOGGING_OUTPUT_PROVIDERS, AGE]);
headers(HCI.CLUSTER_FLOW, [STATE, NAME_COL, NAMESPACE_COL, CLUSTER_OUTPUT, CONFIGURED_PROVIDERS, AGE]);
headers(HCI.CLUSTER_OUTPUT, [STATE, NAME_COL, NAMESPACE_COL, LOGGING_OUTPUT_PROVIDERS, AGE]);
basicType(
[
HCI.CLUSTER_NETWORK,
HCI.NETWORK_ATTACHMENT,
HCI.HOST_NETWORK_CONFIG,
HCI.LB,
HCI.IP_POOL,
],
'networks'
);
basicType(
[HCI.VPC],
OVERLAY_NETWORKS_GROUP
);
basicType(
[NETWORK_POLICY],
OVERLAY_NETWORKS_GROUP
);
basicType(
[HCI.VPC_NAT_GATEWAY, HCI.VPC_EGRESS_GATEWAY],
GATEWAYS_GROUP
);
basicType(
[HCI.IPTABLES_EIP],
EXTERNAL_IPS_GROUP
);
basicType(
[HCI.IPTABLES_SNAT_RULE],
SOURCE_RULES_GROUP
);
basicType(
[HCI.IPTABLES_DNAT_RULE],
DESTINATION_RULES_GROUP
);
basicType(
[HCI.PROVIDER_NETWORK],
UNDERLAY_NETWORKS_GROUP
);
basicType(
[HCI.VLAN],
UNDERLAY_NETWORKS_GROUP
);
basicType(
[
HCI.SCHEDULE_VM_BACKUP,
HCI.BACKUP,
HCI.SNAPSHOT,
HCI.VM_SNAPSHOT,
],
'backupAndSnapshot'
);
weightGroup('networks', 494, true);
weightGroup('Overlay Networks', 493, true);
weightGroup('NAT & Internet', 492, true);
weightGroup('Rules', 491, true);
weightGroup('Underlay Networks', 490, true);
weightGroup('backupAndSnapshot', 489, true);
basicType(
[
HCI.SR_IOV,
HCI.PCI_DEVICE,
HCI.SR_IOVGPU_DEVICE,
HCI.VGPU_DEVICE,
HCI.MIG_CONFIGURATION,
HCI.USB_DEVICE,
],
'hardwareDevices'
);
weightGroup('hardwareDevices', 488, true);
basicType(
[
TEMPLATE,
HCI.SSH,
HCI.CLOUD_TEMPLATE,
HCI.STORAGE,
HCI.ADD_ONS,
HCI.SECRET,
HCI.SETTING
],
'advanced'
);
configureType(HCI.CLUSTER_NETWORK, {
realResource: HCI.SETTING,
showState: false,
});
virtualType({
labelKey: 'harvester.vmTemplate.label',
group: 'root',
name: TEMPLATE,
namespaced: true,
weight: 289,
route: {
name: `${ PRODUCT_NAME }-c-cluster-resource`,
params: { resource: TEMPLATE }
},
exact: false
});
configureType(TEMPLATE, { canYaml: false });
configureType(HCI.SCHEDULE_VM_BACKUP, {
showListMasthead: false, showConfigView: false, canYaml: false
});
virtualType({
labelKey: 'harvester.schedule.label',
name: HCI.SCHEDULE_VM_BACKUP,
namespaced: true,
weight: 201,
route: {
name: `${ PRODUCT_NAME }-c-cluster-resource`,
params: { resource: HCI.SCHEDULE_VM_BACKUP }
},
exact: false,
ifHaveType: HCI.SCHEDULE_VM_BACKUP,
});
configureType(HCI.BACKUP, {
showListMasthead: false, showConfigView: false, canYaml: false
});
virtualType({
labelKey: 'harvester.backup.label',
name: HCI.BACKUP,
namespaced: true,
weight: 200,
route: {
name: `${ PRODUCT_NAME }-c-cluster-resource`,
params: { resource: HCI.BACKUP }
},
exact: false
});
configureType(HCI.VLAN_CONFIG, { hiddenNamespaceGroupButton: true, canYaml: false });
configureType(HCI.CLUSTER_NETWORK, { showListMasthead: false, canYaml: false });
virtualType({
labelKey: 'harvester.clusterNetwork.title',
name: HCI.CLUSTER_NETWORK,
ifHaveType: HCI.CLUSTER_NETWORK,
namespaced: false,
weight: 484,
route: {
name: `${ PRODUCT_NAME }-c-cluster-resource`,
params: { resource: HCI.CLUSTER_NETWORK }
},
exact: false,
});
configureType(HCI.NETWORK_ATTACHMENT, {
location: {
name: `${ PRODUCT_NAME }-c-cluster-resource`,
params: { resource: HCI.NETWORK_ATTACHMENT }
},
resource: NETWORK_ATTACHMENT,
resourceDetail: HCI.NETWORK_ATTACHMENT,
resourceEdit: HCI.NETWORK_ATTACHMENT,
});
virtualType({
labelKey: 'harvester.network.label',
name: HCI.NETWORK_ATTACHMENT,
namespaced: true,
weight: 485,
route: {
name: `${ PRODUCT_NAME }-c-cluster-resource`,
params: { resource: HCI.NETWORK_ATTACHMENT }
},
exact: false
});
configureType(HCI.VPC, { hiddenNamespaceGroupButton: true, canYaml: false });
virtualType({
labelKey: 'harvester.vpc.label',
name: HCI.VPC,
namespaced: true,
weight: 195,
route: {
name: `${ PRODUCT_NAME }-c-cluster-resource`,
params: { resource: HCI.VPC }
},
exact: false,
ifHaveType: HCI.VPC,
});
configureType(HCI.VPC_NAT_GATEWAY, { hiddenNamespaceGroupButton: true, canYaml: false });
virtualType({
labelKey: 'harvester.natGateway.label',
name: HCI.VPC_NAT_GATEWAY,
namespaced: false,
weight: 193,
route: {
name: `${ PRODUCT_NAME }-c-cluster-resource`,
params: { resource: HCI.VPC_NAT_GATEWAY }
},
exact: false,
ifHaveType: HCI.VPC_NAT_GATEWAY,
});
configureType(HCI.VPC_EGRESS_GATEWAY, { hiddenNamespaceGroupButton: true, canYaml: false });
headers(HCI.VPC_EGRESS_GATEWAY, [
STATE,
NAME_COL,
NAMESPACE_COL,
{
name: 'vpc',
labelKey: 'harvester.egressGateway.vpc.label',
value: 'spec.vpc',
sort: ['spec.vpc'],
},
{
name: 'replicas',
labelKey: 'harvester.egressGateway.replicas.label',
value: 'spec.replicas',
sort: ['spec.replicas'],
},
{
name: 'externalSubnet',
labelKey: 'harvester.egressGateway.externalSubnet.label',
value: 'spec.externalSubnet',
sort: ['spec.externalSubnet'],
},
{
name: 'externalIPs',
labelKey: 'harvester.egressGateway.ips.external.label',
value: 'status.externalIPs',
formatter: 'List',
},
AGE
]);
virtualType({
labelKey: 'harvester.egressGateway.label',
name: HCI.VPC_EGRESS_GATEWAY,
namespaced: true,
weight: 193,
route: {
name: `${ PRODUCT_NAME }-c-cluster-resource`,
params: { resource: HCI.VPC_EGRESS_GATEWAY }
},
exact: false,
ifHaveType: HCI.VPC_EGRESS_GATEWAY,
});
configureType(HCI.IPTABLES_EIP, { hiddenNamespaceGroupButton: true, canYaml: false });
virtualType({
labelKey: 'harvester.externalIP.label',
name: HCI.IPTABLES_EIP,
namespaced: false,
weight: 192,
route: {
name: `${ PRODUCT_NAME }-c-cluster-resource`,
params: { resource: HCI.IPTABLES_EIP }
},
exact: false,
ifHaveType: HCI.IPTABLES_EIP,
});
configureType(HCI.IPTABLES_SNAT_RULE, { hiddenNamespaceGroupButton: true, canYaml: false });
virtualType({
labelKey: 'harvester.snat.label',
name: HCI.IPTABLES_SNAT_RULE,
namespaced: false,
weight: 191,
route: {
name: `${ PRODUCT_NAME }-c-cluster-resource`,
params: { resource: HCI.IPTABLES_SNAT_RULE }
},
exact: false,
ifHaveType: HCI.IPTABLES_SNAT_RULE,
});
configureType(HCI.IPTABLES_DNAT_RULE, { hiddenNamespaceGroupButton: true, canYaml: false });
virtualType({
labelKey: 'harvester.dnat.label',
name: HCI.IPTABLES_DNAT_RULE,
namespaced: false,
weight: 190,
route: {
name: `${ PRODUCT_NAME }-c-cluster-resource`,
params: { resource: HCI.IPTABLES_DNAT_RULE }
},
exact: false,
ifHaveType: HCI.IPTABLES_DNAT_RULE,
});
configureType(NETWORK_POLICY, { hiddenNamespaceGroupButton: true, canYaml: false });
virtualType({
labelKey: 'harvester.networkPolicy.label',
name: NETWORK_POLICY,
namespaced: true,
weight: 194,
route: {
name: `${ PRODUCT_NAME }-c-cluster-resource`,
params: { resource: NETWORK_POLICY }
},
exact: false,
ifHaveType: NETWORK_POLICY,
});
configureType(HCI.PROVIDER_NETWORK, { hiddenNamespaceGroupButton: true, canYaml: false });
virtualType({
labelKey: 'harvester.providerNetwork.label',
name: HCI.PROVIDER_NETWORK,
namespaced: false,
weight: 189,
route: {
name: `${ PRODUCT_NAME }-c-cluster-resource`,
params: { resource: HCI.PROVIDER_NETWORK }
},
exact: false,
ifHaveType: HCI.PROVIDER_NETWORK,
});
configureType(HCI.VLAN, { hiddenNamespaceGroupButton: true, canYaml: false });
headers(HCI.VLAN, [
STATE,
NAME_COL,
{
name: 'id',
label: 'ID',
value: 'spec.id',
sort: 'spec.id'
},
{
name: 'provider',
labelKey: 'harvester.subnet.provider.label',
value: 'spec.provider',
sort: 'spec.provider'
}
]);
virtualType({
labelKey: 'harvester.vlanNetwork.label',
name: HCI.VLAN,
namespaced: false,
weight: 188,
route: {
name: `${ PRODUCT_NAME }-c-cluster-resource`,
params: { resource: HCI.VLAN }
},
exact: false,
ifHaveType: HCI.VLAN,
});
configureType(HCI.SNAPSHOT, {
isCreatable: false,
location: {
name: `${ PRODUCT_NAME }-c-cluster-resource`,
params: { resource: HCI.SNAPSHOT },
},
resource: VOLUME_SNAPSHOT,
resourceDetail: HCI.SNAPSHOT,
resourceEdit: HCI.SNAPSHOT,
canYaml: false
});
headers(HCI.SNAPSHOT, [STATE, NAME_COL, NAMESPACE_COL, SNAPSHOT_TARGET_VOLUME, AGE]);
virtualType({
labelKey: 'harvester.snapshot.label',
name: HCI.SNAPSHOT,
namespaced: true,
weight: 190,
route: {
name: `${ PRODUCT_NAME }-c-cluster-resource`,
params: { resource: HCI.SNAPSHOT }
},
exact: false,
});
configureType(HCI.VM_SNAPSHOT, {
showListMasthead: false,
location: {
name: `${ PRODUCT_NAME }-c-cluster-resource`,
params: { resource: HCI.VM_SNAPSHOT }
},
resource: HCI.BACKUP,
resourceDetail: HCI.VM_SNAPSHOT,
resourceEdit: HCI.VM_SNAPSHOT,
canYaml: false
});
virtualType({
labelKey: 'harvester.vmSnapshot.label',
name: HCI.VM_SNAPSHOT,
namespaced: true,
weight: 191,
route: {
name: `${ PRODUCT_NAME }-c-cluster-resource`,
params: { resource: HCI.VM_SNAPSHOT }
},
exact: false
});
headers(HCI.SSH, [STATE, NAME_COL, NAMESPACE_COL, FINGERPRINT, AGE]);
virtualType({
labelKey: 'harvester.sshKey.label',
name: HCI.SSH,
namespaced: true,
weight: 170,
route: {
name: `${ PRODUCT_NAME }-c-cluster-resource`,
params: { resource: HCI.SSH }
},
exact: false
});
configureType(HCI.CLOUD_TEMPLATE, {
location: {
name: `${ PRODUCT_NAME }-c-cluster-resource`,
params: { resource: HCI.CLOUD_TEMPLATE }
},
resource: CONFIG_MAP,
resourceDetail: HCI.CLOUD_TEMPLATE,
resourceEdit: HCI.CLOUD_TEMPLATE,
canYaml: false
});
virtualType({
labelKey: 'harvester.cloudTemplate.label',
name: HCI.CLOUD_TEMPLATE,
namespaced: true,
weight: 87,
route: {
name: `${ PRODUCT_NAME }-c-cluster-resource`,
params: { resource: HCI.CLOUD_TEMPLATE }
},
exact: false
});
headers(HCI.SECRET, [
STATE,
NAME_COL,
NAMESPACE_COL,
SUB_TYPE,
{
name: 'data',
labelKey: 'tableHeaders.data',
value: 'dataPreview',
formatter: 'SecretData'
},
AGE
]);
configureType(HCI.SECRET, {
location: {
name: `${ PRODUCT_NAME }-c-cluster-resource`,
params: { resource: HCI.SECRET }
},
resource: SECRET,
resourceDetail: HCI.SECRET,
resourceEdit: HCI.SECRET,
canYaml: false,
notFilterNamespace: ['cattle-monitoring-system', 'cattle-logging-system']
});
virtualType({
labelKey: 'harvester.secret.label',
name: HCI.SECRET,
namespaced: true,
weight: -999,
route: {
name: `${ PRODUCT_NAME }-c-cluster-resource`,
params: { resource: HCI.SECRET }
},
exact: false
});
// settings
configureType(HCI.SETTING, { isCreatable: false });
virtualType({
ifHaveType: HCI.SETTING,
ifHaveVerb: 'POST',
labelKey: 'harvester.setting.label',
name: HCI.SETTING,
namespaced: true,
weight: -1000,
route: {
name: `${ PRODUCT_NAME }-c-cluster-resource`,
params: { resource: HCI.SETTING }
},
exact: false
});
configureType(HCI.STORAGE, {
location: {
name: `${ PRODUCT_NAME }-c-cluster-resource`,
params: { resource: HCI.STORAGE }
},
resource: STORAGE_CLASS,
resourceDetail: HCI.STORAGE,
resourceEdit: HCI.STORAGE,
isCreatable: true,
canYaml: false,
});
virtualType({
labelKey: 'harvester.storage.title',
group: 'root',
ifHaveType: STORAGE_CLASS,
name: HCI.STORAGE,
namespaced: false,
weight: 79,
route: {
name: `${ PRODUCT_NAME }-c-cluster-resource`,
params: { resource: HCI.STORAGE }
},
exact: false,
});
virtualType({
label: 'PCI Devices',
group: 'hardwareDevices',
weight: 14,
name: HCI.PCI_DEVICE,
namespaced: false,
route: {
name: `${ PRODUCT_NAME }-c-cluster-resource`,
params: { resource: HCI.PCI_DEVICE }
},
exact: false,
});
configureType(HCI.PCI_DEVICE, {
isCreatable: false,
hiddenNamespaceGroupButton: true,
canYaml: true,
listGroups: [
{
icon: 'icon-list-grouped',
value: 'description',
field: 'groupByDevice',
hideColumn: 'description',
tooltipKey: 'resourceTable.groupBy.device'
},
{
icon: 'icon-cluster',
value: 'node',
field: 'groupByNode',
hideColumn: 'node',
tooltipKey: 'resourceTable.groupBy.node'
}
]
});
virtualType({
ifHaveType: HCI.SR_IOV,
labelKey: 'harvester.sriov.label',
group: 'hardwareDevices',
weight: 15,
name: HCI.SR_IOV,
namespaced: false,
route: {
name: `${ PRODUCT_NAME }-c-cluster-resource`,
params: { resource: HCI.SR_IOV }
},
exact: false
});
configureType(HCI.SR_IOV, {
isCreatable: false,
hiddenNamespaceGroupButton: true,
canYaml: false,
});
virtualType({
ifHaveType: HCI.SR_IOVGPU_DEVICE,
labelKey: 'harvester.sriovgpu.label',
group: 'hardwareDevices',
weight: 13,
name: HCI.SR_IOVGPU_DEVICE,
namespaced: false,
route: {
name: `${ PRODUCT_NAME }-c-cluster-resource`,
params: { resource: HCI.SR_IOVGPU_DEVICE }
},
exact: false,
});
configureType(HCI.SR_IOVGPU_DEVICE, {
isCreatable: false,
hiddenNamespaceGroupButton: true,
canYaml: false,
});
virtualType({
labelKey: 'harvester.vgpu.label',
group: 'hardwareDevices',
weight: 12,
name: HCI.VGPU_DEVICE,
namespaced: false,
route: {
name: `${ PRODUCT_NAME }-c-cluster-resource`,
params: { resource: HCI.VGPU_DEVICE }
},
exact: false,
});
configureType(HCI.VGPU_DEVICE, {
isCreatable: false,
hiddenNamespaceGroupButton: true,
canYaml: false,
listGroups: [
{
icon: 'icon-cluster',
value: 'node',
field: 'groupByNode',
hideColumn: 'node',
tooltipKey: 'resourceTable.groupBy.node'
}
]
});
virtualType({
labelKey: 'harvester.migconfiguration.label',
group: 'hardwareDevices',
weight: 12,
name: HCI.MIG_CONFIGURATION,
namespaced: false,
route: {
name: `${ PRODUCT_NAME }-c-cluster-resource`,
params: { resource: HCI.MIG_CONFIGURATION }
},
exact: false,
ifHaveType: HCI.MIG_CONFIGURATION,
});
configureType(HCI.MIG_CONFIGURATION, {
isCreatable: false,
hiddenNamespaceGroupButton: true,
canYaml: false,
});
virtualType({
labelKey: 'harvester.usb.label',
group: 'hardwareDevices',
weight: 11,
name: HCI.USB_DEVICE,
namespaced: false,
route: {
name: `${ PRODUCT_NAME }-c-cluster-resource`,
params: { resource: HCI.USB_DEVICE }
},
exact: false,
ifHaveType: HCI.USB_DEVICE,
});
configureType(HCI.USB_DEVICE, {
isCreatable: false,
hiddenNamespaceGroupButton: true,
canYaml: false,
listGroups: [
{
icon: 'icon-list-grouped',
value: 'description',
field: 'groupByDevice',
hideColumn: 'description',
tooltipKey: 'resourceTable.groupBy.device'
},
{
icon: 'icon-cluster',
value: 'node',
field: 'groupByNode',
hideColumn: 'node',
tooltipKey: 'resourceTable.groupBy.node'
}
]
});
configureType(HCI.ADD_ONS, {
isCreatable: false,
isRemovable: false,
showState: false,
canYaml: false,
});
virtualType({
label: 'Add-ons',
group: 'advanced',
name: HCI.ADD_ONS,
ifHaveType: HCI.ADD_ONS,
weight: -900,
namespaced: false,
route: {
name: `${ PRODUCT_NAME }-c-cluster-resource`,
params: { resource: HCI.ADD_ONS }
},
exact: false,
});
configureType(HCI.LB, {
location: {
name: `${ PRODUCT_NAME }-c-cluster-resource`,
params: { resource: HCI.LB }
},
canYaml: false,
});
virtualType({
labelKey: 'harvester.loadBalancer.label',
name: HCI.LB,
namespaced: true,
weight: 483,
route: {
name: `${ PRODUCT_NAME }-c-cluster-resource`,
params: { resource: HCI.LB }
},
exact: false,
ifHaveType: HCI.LB,
});
headers(HCI.LB, [
STATE,
NAME_COL,
{
...ADDRESS,
formatter: 'HarvesterListener',
},
{
name: 'workloadType',
labelKey: 'harvester.loadBalancer.workloadType.label',
value: 'workloadTypeDisplay',
},
{
name: 'ipam',
labelKey: 'harvester.loadBalancer.ipam.label',
value: 'ipamDisplay',
},
AGE
]);
configureType(HCI.IP_POOL, {
location: {
name: `${ PRODUCT_NAME }-c-cluster-resource`,
params: { resource: HCI.IP_POOL }
},
canYaml: false,
});
virtualType({
labelKey: 'harvester.ipPool.label',
name: HCI.IP_POOL,
namespaced: false,
weight: 482,
route: {
name: `${ PRODUCT_NAME }-c-cluster-resource`,
params: { resource: HCI.IP_POOL }
},
exact: false,
ifHaveType: HCI.IP_POOL,
});
headers(HCI.IP_POOL, IP_POOL_HEADERS);
configureType(HCI.HOST_NETWORK_CONFIG, {
location: {
name: `${ PRODUCT_NAME }-c-cluster-resource`,
params: { resource: HCI.HOST_NETWORK_CONFIG }
},
canYaml: false,
});
virtualType({
labelKey: 'harvester.hostNetworkConfig.label',
name: HCI.HOST_NETWORK_CONFIG,
namespaced: false,
weight: 481,
route: {
name: `${ PRODUCT_NAME }-c-cluster-resource`,
params: { resource: HCI.HOST_NETWORK_CONFIG }
},
exact: false,
ifHaveType: HCI.HOST_NETWORK_CONFIG,
});
// ===========================================================================
// Forklift Addon UI Flow
// ===========================================================================
weightGroup('vmMigration', 0, false);
// Provider
headers(HCI.FORKLIFT_PROVIDER, [
STATE,
NAME_COL,
NAMESPACE_COL,
FORKLIFT_PROVIDER_TYPE,
FORKLIFT_PROVIDER_URL,
AGE
]);
configureType(HCI.FORKLIFT_PROVIDER, {
resource: HCI.FORKLIFT_PROVIDER,
location: {
name: `${ PRODUCT_NAME }-c-cluster-resource`,
params: { resource: HCI.FORKLIFT_PROVIDER }
}
});
virtualType({
name: HCI.FORKLIFT_PROVIDER,
labelKey: 'harvester.addons.vmMigration.labels.provider',
group: 'vmMigration',
namespaced: true,
weight: 100,
route: {
name: `${ PRODUCT_NAME }-c-cluster-resource`,
params: { resource: HCI.FORKLIFT_PROVIDER }
}
});
// NetworkMap
headers(HCI.FORKLIFT_NETWORK_MAP, [
STATE,
NAME_COL,
NAMESPACE_COL,
FORKLIFT_MAP_SOURCE_PROVIDER,
FORKLIFT_MAP_DEST_PROVIDER,
AGE
]);
configureType(HCI.FORKLIFT_NETWORK_MAP, {
resource: HCI.FORKLIFT_NETWORK_MAP,
location: {
name: `${ PRODUCT_NAME }-c-cluster-resource`,
params: { resource: HCI.FORKLIFT_NETWORK_MAP }
}
});
virtualType({
name: HCI.FORKLIFT_NETWORK_MAP,
labelKey: 'harvester.addons.vmMigration.labels.networkMap',
group: 'vmMigration::Configurations',
namespaced: true,
route: {
name: `${ PRODUCT_NAME }-c-cluster-resource`,
params: { resource: HCI.FORKLIFT_NETWORK_MAP }
}
});
// StorageMap
headers(HCI.FORKLIFT_STORAGE_MAP, [
STATE,
NAME_COL,
NAMESPACE_COL,
FORKLIFT_MAP_SOURCE_PROVIDER,
FORKLIFT_MAP_DEST_PROVIDER,
AGE
]);
configureType(HCI.FORKLIFT_STORAGE_MAP, {
resource: HCI.FORKLIFT_STORAGE_MAP,
location: {
name: `${ PRODUCT_NAME }-c-cluster-resource`,
params: { resource: HCI.FORKLIFT_STORAGE_MAP }
}
});
virtualType({
name: HCI.FORKLIFT_STORAGE_MAP,
labelKey: 'harvester.addons.vmMigration.labels.storageMap',
group: 'vmMigration::Configurations',
namespaced: true,
route: {
name: `${ PRODUCT_NAME }-c-cluster-resource`,
params: { resource: HCI.FORKLIFT_STORAGE_MAP }
}
});
// Plan
headers(HCI.FORKLIFT_PLAN, [
STATE,
NAME_COL,
NAMESPACE_COL,
FORKLIFT_MAP_SOURCE_PROVIDER,
FORKLIFT_PLAN_TARGET_NS,
FORKLIFT_PLAN_VM_COUNT,
AGE
]);
configureType(HCI.FORKLIFT_PLAN, {
resource: HCI.FORKLIFT_PLAN,
location: {
name: `${ PRODUCT_NAME }-c-cluster-resource`,
params: { resource: HCI.FORKLIFT_PLAN }
}
});
virtualType({
name: HCI.FORKLIFT_PLAN,
labelKey: 'harvester.addons.vmMigration.labels.plan',
group: 'vmMigration::Configurations',
namespaced: true,
route: {
name: `${ PRODUCT_NAME }-c-cluster-resource`,
params: { resource: HCI.FORKLIFT_PLAN }
}
});
// Migration
headers(HCI.FORKLIFT_MIGRATION, [
STATE,
NAME_COL,
NAMESPACE_COL,
FORKLIFT_MIGRATION_PLAN,
AGE
]);
configureType(HCI.FORKLIFT_MIGRATION, {
resource: HCI.FORKLIFT_MIGRATION,
location: {
name: `${ PRODUCT_NAME }-c-cluster-resource`,
params: { resource: HCI.FORKLIFT_MIGRATION }
}
});
virtualType({
name: HCI.FORKLIFT_MIGRATION,
labelKey: 'harvester.addons.vmMigration.labels.migration',
group: 'vmMigration::Configurations',
namespaced: true,
route: {
name: `${ PRODUCT_NAME }-c-cluster-resource`,
params: { resource: HCI.FORKLIFT_MIGRATION }
}
});
configureType('forklift-create', { subTypes: [HCI.FORKLIFT_PLAN] });
virtualType({
name: 'forklift-create',
labelKey: 'harvester.addons.vmMigration.labels.dashboard',
group: 'vmMigration',
namespaced: true,
weight: 200,
route: {
name: `${ PRODUCT_NAME }-c-cluster-vm-migration`,
params: {}
}
});
// Enable SideNav based on Forklift Addon Status
// The dashboard entry ('forklift-create') is a schema-less virtual type, so it
// is registered with requireSchema:false to still be gated by the addon status.
registerAddonSideNav(store, PRODUCT_NAME, {
addonName: ADD_ONS.FORKLIFT_OPERATOR,
resourceType: HCI.ADD_ONS,
navGroup: 'vmMigration',
requireSchema: false,
types: ['forklift-create']
});
registerAddonSideNav(store, PRODUCT_NAME, {
addonName: ADD_ONS.FORKLIFT_OPERATOR,
resourceType: HCI.ADD_ONS,
navGroup: 'vmMigration',
types: [
HCI.FORKLIFT_PROVIDER,
]
});
registerAddonSideNav(store, PRODUCT_NAME, {
addonName: ADD_ONS.FORKLIFT_OPERATOR,
resourceType: HCI.ADD_ONS,
navGroup: 'vmMigration::Configurations',
types: [
HCI.FORKLIFT_NETWORK_MAP,
HCI.FORKLIFT_STORAGE_MAP,
HCI.FORKLIFT_PLAN,
HCI.FORKLIFT_MIGRATION,
]
});
// ===========================================================================
}