mirror of
https://github.com/harvester/harvester-ui-extension.git
synced 2026-11-26 02:20:49 +08:00
Compare commits
39
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
28aa1061d5 | ||
|
|
a4299a9597 | ||
|
|
107e44bd4b | ||
|
|
a11369ad6d | ||
|
|
f270a7b1f8 | ||
|
|
0d9b976dd2 | ||
|
|
77d80051c9 | ||
|
|
fbcc235fa7 | ||
|
|
9ddfaefc39 | ||
|
|
a180372564 | ||
|
|
b4210037e9 | ||
|
|
97e4b7271c | ||
|
|
2deb0aa254 | ||
|
|
5c7dd1953d | ||
|
|
3ecb6bfc4a | ||
|
|
d67813eb39 | ||
|
|
1d26c48117 | ||
|
|
de7598b7af | ||
|
|
e703f34879 | ||
|
|
7c8f172012 | ||
|
|
6e17a84581 | ||
|
|
d075871afc | ||
|
|
4d230ebd42 | ||
|
|
c887186e1a | ||
|
|
dc6ae60b9d | ||
|
|
5d8d7ec986 | ||
|
|
bf01a9dc43 | ||
|
|
4480b2cd8f | ||
|
|
b84167a4da | ||
|
|
f7a1dec58f | ||
|
|
a0d145ee60 | ||
|
|
740ca94841 | ||
|
|
d4f59a04be | ||
|
|
d195c5dd18 | ||
|
|
341f7734a9 | ||
|
|
63d726aa91 | ||
|
|
2259910be1 | ||
|
|
7d8d74ce17 | ||
|
|
9a20ad5edd |
No files matched your search
@@ -6,11 +6,13 @@ on:
|
|||||||
- main
|
- main
|
||||||
- 'release-harvester-v*'
|
- 'release-harvester-v*'
|
||||||
- '*-dev'
|
- '*-dev'
|
||||||
|
- forklift-poc
|
||||||
pull_request:
|
pull_request:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
- 'release-harvester-v*'
|
- 'release-harvester-v*'
|
||||||
- '*-dev'
|
- '*-dev'
|
||||||
|
- forklift-poc
|
||||||
types:
|
types:
|
||||||
- merged
|
- merged
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "harvester-ui-extension",
|
"name": "harvester-ui-extension",
|
||||||
"version": "1.9.0-rc2",
|
"version": "1.9.0-dev",
|
||||||
"private": false,
|
"private": false,
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=24.0.0"
|
"node": ">=24.0.0"
|
||||||
|
|||||||
@@ -9,7 +9,6 @@ import { randomStr } from '@shell/utils/string';
|
|||||||
import { HCI } from '../../types';
|
import { HCI } from '../../types';
|
||||||
import { FORKLIFT_NAMESPACE } from '../../config/harvester-map';
|
import { FORKLIFT_NAMESPACE } from '../../config/harvester-map';
|
||||||
import { buildNetworkMapEntries, buildStorageMapEntries } from '../../utils/forklift';
|
import { buildNetworkMapEntries, buildStorageMapEntries } from '../../utils/forklift';
|
||||||
import { isInternalStorageClass } from '../../utils/storage-class';
|
|
||||||
import MappingColumn from './MappingColumn.vue';
|
import MappingColumn from './MappingColumn.vue';
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
@@ -57,22 +56,10 @@ const harvesterNetworkOptions = computed(() => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const storageClassOptions = computed(() => {
|
const storageClassOptions = computed(() => {
|
||||||
const options = storageClasses.value.filter((s) => !s.parameters?.backingImage).map((sc) => {
|
const options = storageClasses.value.map((sc) => ({
|
||||||
const value = sc.name;
|
label: sc.metadata?.name || sc.id,
|
||||||
let label = sc.isDefault ? `${ value } (${ t('generic.default') })` : value;
|
value: sc.metadata?.name || sc.id,
|
||||||
let disabled = false;
|
}));
|
||||||
|
|
||||||
if (isInternalStorageClass(value)) {
|
|
||||||
label += ` (${ t('harvester.storage.internal.label') })`;
|
|
||||||
disabled = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
|
||||||
label,
|
|
||||||
value,
|
|
||||||
disabled,
|
|
||||||
};
|
|
||||||
});
|
|
||||||
|
|
||||||
if (!options.find((o) => o.value === 'harvester-longhorn')) {
|
if (!options.find((o) => o.value === 'harvester-longhorn')) {
|
||||||
options.unshift({ label: 'harvester-longhorn', value: 'harvester-longhorn' });
|
options.unshift({ label: 'harvester-longhorn', value: 'harvester-longhorn' });
|
||||||
|
|||||||
@@ -402,7 +402,6 @@ defineExpose({ testConnection, clickTestButton });
|
|||||||
<div v-if="!createOnly && !editMode">
|
<div v-if="!createOnly && !editMode">
|
||||||
<LabeledSelect
|
<LabeledSelect
|
||||||
v-model:value="selectedProvider"
|
v-model:value="selectedProvider"
|
||||||
required
|
|
||||||
:label="t('harvester.addons.vmMigration.configureProvider.providerSelect')"
|
:label="t('harvester.addons.vmMigration.configureProvider.providerSelect')"
|
||||||
:options="providerOptions"
|
:options="providerOptions"
|
||||||
:reduce="(opt) => opt.value"
|
:reduce="(opt) => opt.value"
|
||||||
|
|||||||
@@ -107,21 +107,18 @@ const headers = [
|
|||||||
labelKey: 'harvester.addons.vmMigration.selectVms.columns.os',
|
labelKey: 'harvester.addons.vmMigration.selectVms.columns.os',
|
||||||
value: 'os',
|
value: 'os',
|
||||||
sort: ['os'],
|
sort: ['os'],
|
||||||
width: 180,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'resources',
|
name: 'resources',
|
||||||
labelKey: 'harvester.addons.vmMigration.selectVms.columns.resources',
|
labelKey: 'harvester.addons.vmMigration.selectVms.columns.resources',
|
||||||
value: 'resources',
|
value: 'resources',
|
||||||
sort: false,
|
sort: false,
|
||||||
width: 140,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'powerState',
|
name: 'powerState',
|
||||||
labelKey: 'harvester.addons.vmMigration.selectVms.columns.powerState',
|
labelKey: 'harvester.addons.vmMigration.selectVms.columns.powerState',
|
||||||
value: 'powerState',
|
value: 'powerState',
|
||||||
sort: ['powerState'],
|
sort: ['powerState'],
|
||||||
width: 130,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'network',
|
name: 'network',
|
||||||
@@ -129,7 +126,6 @@ const headers = [
|
|||||||
value: 'network',
|
value: 'network',
|
||||||
sort: ['network'],
|
sort: ['network'],
|
||||||
subLabel: t('harvester.addons.vmMigration.generic.identifier'),
|
subLabel: t('harvester.addons.vmMigration.generic.identifier'),
|
||||||
width: 200,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'datastore',
|
name: 'datastore',
|
||||||
@@ -137,7 +133,6 @@ const headers = [
|
|||||||
value: 'datastore',
|
value: 'datastore',
|
||||||
sort: ['datastore'],
|
sort: ['datastore'],
|
||||||
subLabel: t('harvester.addons.vmMigration.generic.identifier'),
|
subLabel: t('harvester.addons.vmMigration.generic.identifier'),
|
||||||
width: 200,
|
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|||||||
@@ -73,9 +73,7 @@ const FEATURE_FLAGS = {
|
|||||||
'supportFilesystem',
|
'supportFilesystem',
|
||||||
'disableResourcePooling',
|
'disableResourcePooling',
|
||||||
'expandOnlineEncryptedVolume',
|
'expandOnlineEncryptedVolume',
|
||||||
'longhornV2HugepageSettings',
|
'longhornV2HugepageSettings'
|
||||||
'staticIPForVM',
|
|
||||||
'fsFreezeDeadline',
|
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -1378,7 +1378,7 @@ export function init($plugin, store) {
|
|||||||
virtualType({
|
virtualType({
|
||||||
name: HCI.FORKLIFT_NETWORK_MAP,
|
name: HCI.FORKLIFT_NETWORK_MAP,
|
||||||
labelKey: 'harvester.addons.vmMigration.labels.networkMap',
|
labelKey: 'harvester.addons.vmMigration.labels.networkMap',
|
||||||
group: 'vmMigration::Configurations',
|
group: 'vmMigration::Advanced',
|
||||||
namespaced: true,
|
namespaced: true,
|
||||||
route: {
|
route: {
|
||||||
name: `${ PRODUCT_NAME }-c-cluster-resource`,
|
name: `${ PRODUCT_NAME }-c-cluster-resource`,
|
||||||
@@ -1405,7 +1405,7 @@ export function init($plugin, store) {
|
|||||||
virtualType({
|
virtualType({
|
||||||
name: HCI.FORKLIFT_STORAGE_MAP,
|
name: HCI.FORKLIFT_STORAGE_MAP,
|
||||||
labelKey: 'harvester.addons.vmMigration.labels.storageMap',
|
labelKey: 'harvester.addons.vmMigration.labels.storageMap',
|
||||||
group: 'vmMigration::Configurations',
|
group: 'vmMigration::Advanced',
|
||||||
namespaced: true,
|
namespaced: true,
|
||||||
route: {
|
route: {
|
||||||
name: `${ PRODUCT_NAME }-c-cluster-resource`,
|
name: `${ PRODUCT_NAME }-c-cluster-resource`,
|
||||||
@@ -1433,7 +1433,7 @@ export function init($plugin, store) {
|
|||||||
virtualType({
|
virtualType({
|
||||||
name: HCI.FORKLIFT_PLAN,
|
name: HCI.FORKLIFT_PLAN,
|
||||||
labelKey: 'harvester.addons.vmMigration.labels.plan',
|
labelKey: 'harvester.addons.vmMigration.labels.plan',
|
||||||
group: 'vmMigration::Configurations',
|
group: 'vmMigration::Advanced',
|
||||||
namespaced: true,
|
namespaced: true,
|
||||||
route: {
|
route: {
|
||||||
name: `${ PRODUCT_NAME }-c-cluster-resource`,
|
name: `${ PRODUCT_NAME }-c-cluster-resource`,
|
||||||
@@ -1459,7 +1459,7 @@ export function init($plugin, store) {
|
|||||||
virtualType({
|
virtualType({
|
||||||
name: HCI.FORKLIFT_MIGRATION,
|
name: HCI.FORKLIFT_MIGRATION,
|
||||||
labelKey: 'harvester.addons.vmMigration.labels.migration',
|
labelKey: 'harvester.addons.vmMigration.labels.migration',
|
||||||
group: 'vmMigration::Configurations',
|
group: 'vmMigration::Advanced',
|
||||||
namespaced: true,
|
namespaced: true,
|
||||||
route: {
|
route: {
|
||||||
name: `${ PRODUCT_NAME }-c-cluster-resource`,
|
name: `${ PRODUCT_NAME }-c-cluster-resource`,
|
||||||
@@ -1479,16 +1479,11 @@ export function init($plugin, store) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Register the dashboard entry directly — it's a virtual type with no schema,
|
||||||
|
// so it cannot go through registerAddonSideNav (which filters by schema).
|
||||||
|
basicType(['forklift-create'], 'vmMigration');
|
||||||
|
|
||||||
// Enable SideNav based on Forklift Addon Status
|
// 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, {
|
registerAddonSideNav(store, PRODUCT_NAME, {
|
||||||
addonName: ADD_ONS.FORKLIFT_OPERATOR,
|
addonName: ADD_ONS.FORKLIFT_OPERATOR,
|
||||||
resourceType: HCI.ADD_ONS,
|
resourceType: HCI.ADD_ONS,
|
||||||
@@ -1500,7 +1495,7 @@ export function init($plugin, store) {
|
|||||||
registerAddonSideNav(store, PRODUCT_NAME, {
|
registerAddonSideNav(store, PRODUCT_NAME, {
|
||||||
addonName: ADD_ONS.FORKLIFT_OPERATOR,
|
addonName: ADD_ONS.FORKLIFT_OPERATOR,
|
||||||
resourceType: HCI.ADD_ONS,
|
resourceType: HCI.ADD_ONS,
|
||||||
navGroup: 'vmMigration::Configurations',
|
navGroup: 'vmMigration::Advanced',
|
||||||
types: [
|
types: [
|
||||||
HCI.FORKLIFT_NETWORK_MAP,
|
HCI.FORKLIFT_NETWORK_MAP,
|
||||||
HCI.FORKLIFT_STORAGE_MAP,
|
HCI.FORKLIFT_STORAGE_MAP,
|
||||||
|
|||||||
@@ -16,7 +16,6 @@ export const HCI = {
|
|||||||
CREATOR: 'harvesterhci.io/creator',
|
CREATOR: 'harvesterhci.io/creator',
|
||||||
OS: 'harvesterhci.io/os',
|
OS: 'harvesterhci.io/os',
|
||||||
GOLDEN_IMAGE: 'harvesterhci.io/goldenImage',
|
GOLDEN_IMAGE: 'harvesterhci.io/goldenImage',
|
||||||
CLUSTER_NETWORK: 'network.harvesterhci.io/clusternetwork',
|
|
||||||
NETWORK_TYPE: 'network.harvesterhci.io/type',
|
NETWORK_TYPE: 'network.harvesterhci.io/type',
|
||||||
VM_NAME: 'harvesterhci.io/vmName',
|
VM_NAME: 'harvesterhci.io/vmName',
|
||||||
VM_NAME_PREFIX: 'harvesterhci.io/vmNamePrefix',
|
VM_NAME_PREFIX: 'harvesterhci.io/vmNamePrefix',
|
||||||
@@ -81,7 +80,6 @@ export const HCI = {
|
|||||||
VOLUME_MODE_ACCESS_MODES: 'cdi.harvesterhci.io/storageProfileVolumeModeAccessModes',
|
VOLUME_MODE_ACCESS_MODES: 'cdi.harvesterhci.io/storageProfileVolumeModeAccessModes',
|
||||||
VOLUME_SNAPSHOT_CLASS: 'cdi.harvesterhci.io/storageProfileVolumeSnapshotClass',
|
VOLUME_SNAPSHOT_CLASS: 'cdi.harvesterhci.io/storageProfileVolumeSnapshotClass',
|
||||||
MAC_ADDRESS: 'harvesterhci.io/mac-address',
|
MAC_ADDRESS: 'harvesterhci.io/mac-address',
|
||||||
STATIC_IP: 'static-ip.harvesterhci.io',
|
|
||||||
NODE_UPGRADE_PAUSE_MAP: 'harvesterhci.io/node-upgrade-pause-map',
|
NODE_UPGRADE_PAUSE_MAP: 'harvesterhci.io/node-upgrade-pause-map',
|
||||||
CDI_POPULATOR_KIND: 'cdi.kubevirt.io/storage.populator.kind',
|
CDI_POPULATOR_KIND: 'cdi.kubevirt.io/storage.populator.kind',
|
||||||
CNI_NETWORKS: 'k8s.v1.cni.cncf.io/networks',
|
CNI_NETWORKS: 'k8s.v1.cni.cncf.io/networks',
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ import { MiniMap } from '@vue-flow/minimap';
|
|||||||
import { allHash } from '@shell/utils/promise';
|
import { allHash } from '@shell/utils/promise';
|
||||||
import { NETWORK_ATTACHMENT } from '@shell/config/types';
|
import { NETWORK_ATTACHMENT } from '@shell/config/types';
|
||||||
import Checkbox from '@components/Form/Checkbox/Checkbox.vue';
|
import Checkbox from '@components/Form/Checkbox/Checkbox.vue';
|
||||||
import { HCI as HCI_ANNOTATIONS } from '@pkg/harvester/config/labels-annotations';
|
|
||||||
import { HCI } from '../types';
|
import { HCI } from '../types';
|
||||||
import { NETWORK_TYPE } from '../config/types';
|
import { NETWORK_TYPE } from '../config/types';
|
||||||
|
|
||||||
@@ -455,10 +454,10 @@ export default {
|
|||||||
const overlayName = nad?.parseConfig?.name || nad?.metadata?.name;
|
const overlayName = nad?.parseConfig?.name || nad?.metadata?.name;
|
||||||
|
|
||||||
const clusterNetwork =
|
const clusterNetwork =
|
||||||
nad?.metadata?.labels?.[HCI_ANNOTATIONS.CLUSTER_NETWORK] || 'mgmt';
|
nad?.metadata?.labels?.[HCI.CLUSTER_NETWORK] || 'mgmt';
|
||||||
|
|
||||||
const nadType =
|
const nadType =
|
||||||
nad?.metadata?.labels?.[HCI_ANNOTATIONS.NETWORK_TYPE] || NETWORK_TYPE.OVERLAY;
|
nad?.metadata?.labels?.[HCI.NETWORK_TYPE] || NETWORK_TYPE.OVERLAY;
|
||||||
const overlayNodeId = `overlay-${ provider }`;
|
const overlayNodeId = `overlay-${ provider }`;
|
||||||
|
|
||||||
nodes.push({
|
nodes.push({
|
||||||
|
|||||||
@@ -5,8 +5,6 @@ import { Card } from '@components/Card';
|
|||||||
import { Banner } from '@components/Banner';
|
import { Banner } from '@components/Banner';
|
||||||
import AsyncButton from '@shell/components/AsyncButton';
|
import AsyncButton from '@shell/components/AsyncButton';
|
||||||
import { LabeledInput } from '@components/Form/LabeledInput';
|
import { LabeledInput } from '@components/Form/LabeledInput';
|
||||||
import LabeledSelect from '@shell/components/form/LabeledSelect';
|
|
||||||
import { DEFAULT_FS_FREEZE_DEADLINE, getFsFreezeDeadlineOptions } from '../utils/backup';
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'HarvesterBackupModal',
|
name: 'HarvesterBackupModal',
|
||||||
@@ -17,7 +15,6 @@ export default {
|
|||||||
AsyncButton,
|
AsyncButton,
|
||||||
Card,
|
Card,
|
||||||
LabeledInput,
|
LabeledInput,
|
||||||
LabeledSelect,
|
|
||||||
Banner
|
Banner
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -30,9 +27,8 @@ export default {
|
|||||||
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
backUpName: '',
|
backUpName: '',
|
||||||
errors: [],
|
errors: []
|
||||||
fsFreezeDeadline: DEFAULT_FS_FREEZE_DEADLINE
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -41,22 +37,12 @@ export default {
|
|||||||
|
|
||||||
actionResource() {
|
actionResource() {
|
||||||
return this.resources[0];
|
return this.resources[0];
|
||||||
},
|
|
||||||
|
|
||||||
fsFreezeDeadlineEnabled() {
|
|
||||||
return this.$store.getters['harvester-common/getFeatureEnabled']('fsFreezeDeadline');
|
|
||||||
},
|
|
||||||
|
|
||||||
fsFreezeDeadlineOptions() {
|
|
||||||
return getFsFreezeDeadlineOptions(this.t);
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
close() {
|
close() {
|
||||||
this.backUpName = '';
|
this.backUpName = '';
|
||||||
this.fsFreezeDeadline = DEFAULT_FS_FREEZE_DEADLINE;
|
|
||||||
this.errors = [];
|
|
||||||
this.$emit('close');
|
this.$emit('close');
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -65,7 +51,7 @@ export default {
|
|||||||
try {
|
try {
|
||||||
const res = await this.actionResource.doAction(
|
const res = await this.actionResource.doAction(
|
||||||
'backup',
|
'backup',
|
||||||
{ name: this.backUpName, fsFreezeDeadline: this.fsFreezeDeadline },
|
{ name: this.backUpName },
|
||||||
{},
|
{},
|
||||||
false
|
false
|
||||||
);
|
);
|
||||||
@@ -114,18 +100,9 @@ export default {
|
|||||||
<template #body>
|
<template #body>
|
||||||
<LabeledInput
|
<LabeledInput
|
||||||
v-model:value="backUpName"
|
v-model:value="backUpName"
|
||||||
class="mt-20"
|
|
||||||
:label="t('generic.name')"
|
:label="t('generic.name')"
|
||||||
required
|
required
|
||||||
/>
|
/>
|
||||||
<LabeledSelect
|
|
||||||
v-if="fsFreezeDeadlineEnabled"
|
|
||||||
v-model:value="fsFreezeDeadline"
|
|
||||||
class="mt-20"
|
|
||||||
:options="fsFreezeDeadlineOptions"
|
|
||||||
:label="t('harvester.modal.backup.fileSystemFreezeDeadline.label')"
|
|
||||||
required
|
|
||||||
/>
|
|
||||||
<Banner
|
<Banner
|
||||||
v-for="(err, i) in errors"
|
v-for="(err, i) in errors"
|
||||||
:key="i"
|
:key="i"
|
||||||
|
|||||||
@@ -5,10 +5,8 @@ import { Card } from '@components/Card';
|
|||||||
import { Banner } from '@components/Banner';
|
import { Banner } from '@components/Banner';
|
||||||
import AsyncButton from '@shell/components/AsyncButton';
|
import AsyncButton from '@shell/components/AsyncButton';
|
||||||
import { LabeledInput } from '@components/Form/LabeledInput';
|
import { LabeledInput } from '@components/Form/LabeledInput';
|
||||||
import LabeledSelect from '@shell/components/form/LabeledSelect';
|
|
||||||
import { HCI } from '../types';
|
import { HCI } from '../types';
|
||||||
import { BACKUP_TYPE } from '../config/types';
|
import { BACKUP_TYPE } from '../config/types';
|
||||||
import { DEFAULT_FS_FREEZE_DEADLINE, getFsFreezeDeadlineOptions } from '../utils/backup';
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'HarvesterVMSnapshotDialog',
|
name: 'HarvesterVMSnapshotDialog',
|
||||||
@@ -19,7 +17,6 @@ export default {
|
|||||||
AsyncButton,
|
AsyncButton,
|
||||||
Card,
|
Card,
|
||||||
LabeledInput,
|
LabeledInput,
|
||||||
LabeledSelect,
|
|
||||||
Banner
|
Banner
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -34,8 +31,7 @@ export default {
|
|||||||
return {
|
return {
|
||||||
snapshotName: '',
|
snapshotName: '',
|
||||||
snapshotNamespace: '',
|
snapshotNamespace: '',
|
||||||
errors: [],
|
errors: []
|
||||||
fsFreezeDeadline: DEFAULT_FS_FREEZE_DEADLINE
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -44,23 +40,13 @@ export default {
|
|||||||
|
|
||||||
actionResource() {
|
actionResource() {
|
||||||
return this.resources[0];
|
return this.resources[0];
|
||||||
},
|
|
||||||
|
|
||||||
fsFreezeDeadlineEnabled() {
|
|
||||||
return this.$store.getters['harvester-common/getFeatureEnabled']('fsFreezeDeadline');
|
|
||||||
},
|
|
||||||
|
|
||||||
fsFreezeDeadlineOptions() {
|
|
||||||
return getFsFreezeDeadlineOptions(this.t);
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
close() {
|
close() {
|
||||||
this.fsFreezeDeadline = DEFAULT_FS_FREEZE_DEADLINE;
|
|
||||||
this.snapshotNamespace = '';
|
this.snapshotNamespace = '';
|
||||||
this.snapshotName = '';
|
this.snapshotName = '';
|
||||||
this.errors = [];
|
|
||||||
this.$emit('close');
|
this.$emit('close');
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -74,8 +60,7 @@ export default {
|
|||||||
ownerReferences: this.getOwnerReferencesFromVM(this.actionResource)
|
ownerReferences: this.getOwnerReferencesFromVM(this.actionResource)
|
||||||
},
|
},
|
||||||
spec: {
|
spec: {
|
||||||
fsFreezeDeadline: this.fsFreezeDeadline,
|
source: {
|
||||||
source: {
|
|
||||||
apiGroup: 'kubevirt.io',
|
apiGroup: 'kubevirt.io',
|
||||||
kind: 'VirtualMachine',
|
kind: 'VirtualMachine',
|
||||||
name: this.actionResource.metadata.name
|
name: this.actionResource.metadata.name
|
||||||
@@ -147,14 +132,6 @@ export default {
|
|||||||
:label="t('generic.name')"
|
:label="t('generic.name')"
|
||||||
required
|
required
|
||||||
/>
|
/>
|
||||||
<LabeledSelect
|
|
||||||
v-if="fsFreezeDeadlineEnabled"
|
|
||||||
v-model:value="fsFreezeDeadline"
|
|
||||||
class="mt-20"
|
|
||||||
:options="fsFreezeDeadlineOptions"
|
|
||||||
:label="t('harvester.modal.vmSnapshot.fileSystemFreezeDeadline.label')"
|
|
||||||
required
|
|
||||||
/>
|
|
||||||
<Banner
|
<Banner
|
||||||
v-for="(err, i) in errors"
|
v-for="(err, i) in errors"
|
||||||
:key="i"
|
:key="i"
|
||||||
|
|||||||
@@ -468,15 +468,10 @@ export default {
|
|||||||
const size = formatSi(sizeBytes, { increment: 1024, suffix: UNIT_SUFFIX });
|
const size = formatSi(sizeBytes, { increment: 1024, suffix: UNIT_SUFFIX });
|
||||||
const parentDevice = d.status?.deviceStatus?.parentDevice;
|
const parentDevice = d.status?.deviceStatus?.parentDevice;
|
||||||
const isChildAdded = this.newDisks.find((newDisk) => newDisk.blockDevice?.status?.deviceStatus?.parentDevice === devPath);
|
const isChildAdded = this.newDisks.find((newDisk) => newDisk.blockDevice?.status?.deviceStatus?.parentDevice === devPath);
|
||||||
const mountPoint = d.status?.deviceStatus?.fileSystem?.mountPoint;
|
|
||||||
const name = d.displayName;
|
const name = d.displayName;
|
||||||
|
|
||||||
let label = `${ name } (Type: ${ deviceType }, Size: ${ size })`;
|
let label = `${ name } (Type: ${ deviceType }, Size: ${ size })`;
|
||||||
|
|
||||||
if (mountPoint) {
|
|
||||||
label = `${ label } - ${ this.t('harvester.host.disk.mounted') }`;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (parentDevice) {
|
if (parentDevice) {
|
||||||
label = `- ${ label }`;
|
label = `- ${ label }`;
|
||||||
}
|
}
|
||||||
@@ -486,7 +481,7 @@ export default {
|
|||||||
value: d.id,
|
value: d.id,
|
||||||
action: this.addDisk,
|
action: this.addDisk,
|
||||||
kind: !parentDevice ? 'group' : '',
|
kind: !parentDevice ? 'group' : '',
|
||||||
disabled: !!isChildAdded || !!mountPoint,
|
disabled: !!isChildAdded,
|
||||||
group: parentDevice || devPath,
|
group: parentDevice || devPath,
|
||||||
isParent: !!parentDevice,
|
isParent: !!parentDevice,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -133,10 +133,6 @@ export default {
|
|||||||
}];
|
}];
|
||||||
|
|
||||||
return this.isMasquerade ? masquerade : other;
|
return this.isMasquerade ? masquerade : other;
|
||||||
},
|
|
||||||
|
|
||||||
staticIPForVMEnabled() {
|
|
||||||
return this.$store.getters['harvester-common/getFeatureEnabled']('staticIPForVM');
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -154,7 +150,6 @@ export default {
|
|||||||
isSingle(neu) {
|
isSingle(neu) {
|
||||||
if (!neu) {
|
if (!neu) {
|
||||||
this.value['macAddress'] = '';
|
this.value['macAddress'] = '';
|
||||||
this.value['staticIp'] = '';
|
|
||||||
this.update();
|
this.update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -168,7 +163,6 @@ export default {
|
|||||||
if (neu === MANAGEMENT_NETWORK) {
|
if (neu === MANAGEMENT_NETWORK) {
|
||||||
this.value.isPod = true;
|
this.value.isPod = true;
|
||||||
this.value.macAddress = '';
|
this.value.macAddress = '';
|
||||||
this.value.staticIp = '';
|
|
||||||
} else {
|
} else {
|
||||||
this.value.isPod = false;
|
this.value.isPod = false;
|
||||||
}
|
}
|
||||||
@@ -295,30 +289,9 @@ export default {
|
|||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div
|
<div class="row">
|
||||||
v-if="showAdvanced"
|
|
||||||
class="row"
|
|
||||||
>
|
|
||||||
<div
|
|
||||||
v-if="staticIPForVMEnabled"
|
|
||||||
data-testid="input-hen-staticIp"
|
|
||||||
class="col span-6"
|
|
||||||
>
|
|
||||||
<InputOrDisplay
|
|
||||||
:name="t('harvester.fields.staticIp')"
|
|
||||||
:value="value.staticIp"
|
|
||||||
:mode="mode"
|
|
||||||
>
|
|
||||||
<LabeledInput
|
|
||||||
v-model:value="value.staticIp"
|
|
||||||
label-key="harvester.fields.staticIp"
|
|
||||||
:mode="mode"
|
|
||||||
:tooltip="t('harvester.virtualMachine.volume.staticIpTip', { nic_name: value.name || 'default' })"
|
|
||||||
@update:value="update"
|
|
||||||
/>
|
|
||||||
</InputOrDisplay>
|
|
||||||
</div>
|
|
||||||
<div
|
<div
|
||||||
|
v-if="showAdvanced"
|
||||||
data-testid="input-hen-macAddress"
|
data-testid="input-hen-macAddress"
|
||||||
class="col span-6"
|
class="col span-6"
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -283,9 +283,9 @@ export default {
|
|||||||
v-model:value.number="vlanID"
|
v-model:value.number="vlanID"
|
||||||
type="number"
|
type="number"
|
||||||
required
|
required
|
||||||
:min="1"
|
:min="2"
|
||||||
:max="4094"
|
:max="4094"
|
||||||
placeholder="e.g. 1 ~ 4094"
|
placeholder="e.g. 2 ~ 4094"
|
||||||
:label="t('harvester.hostNetworkConfig.vlanID.label')"
|
:label="t('harvester.hostNetworkConfig.vlanID.label')"
|
||||||
:mode="mode"
|
:mode="mode"
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -36,10 +36,6 @@ export default {
|
|||||||
|
|
||||||
computed: {
|
computed: {
|
||||||
ips() {
|
ips() {
|
||||||
if (this.staticAnnotationIP.length) {
|
|
||||||
return this.staticAnnotationIP;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.vmiIp.length) {
|
if (this.vmiIp.length) {
|
||||||
return [...this.vmiIp, ...this.networkAnnotationIP]
|
return [...this.vmiIp, ...this.networkAnnotationIP]
|
||||||
.filter(Boolean)
|
.filter(Boolean)
|
||||||
@@ -49,24 +45,6 @@ export default {
|
|||||||
return this.customAnnotationIP;
|
return this.customAnnotationIP;
|
||||||
},
|
},
|
||||||
|
|
||||||
staticAnnotationIP() {
|
|
||||||
const annotations = this.row?.metadata?.annotations || {};
|
|
||||||
const staticIpPrefix = `${ HCI_ANNOTATIONS.STATIC_IP }/`;
|
|
||||||
|
|
||||||
return Object.entries(annotations)
|
|
||||||
.filter(([key, value]) => key.startsWith(staticIpPrefix) && !!value)
|
|
||||||
.map(([key, value]) => {
|
|
||||||
const nicName = key.slice(staticIpPrefix.length);
|
|
||||||
const ip = String(value).replace(/\/[\d\D]*/, '');
|
|
||||||
|
|
||||||
return {
|
|
||||||
ip,
|
|
||||||
name: nicName
|
|
||||||
};
|
|
||||||
})
|
|
||||||
.filter(({ ip }) => isIpv4(ip));
|
|
||||||
},
|
|
||||||
|
|
||||||
customAnnotationIP() {
|
customAnnotationIP() {
|
||||||
const annotationIp = get(this.row, `metadata.annotations."${ HCI_ANNOTATIONS.CUSTOM_IP }"`);
|
const annotationIp = get(this.row, `metadata.annotations."${ HCI_ANNOTATIONS.CUSTOM_IP }"`);
|
||||||
|
|
||||||
|
|||||||
@@ -13,15 +13,6 @@ generic:
|
|||||||
basic: Basic
|
basic: Basic
|
||||||
loading: Loading...
|
loading: Loading...
|
||||||
none: None
|
none: None
|
||||||
duration:
|
|
||||||
infinite: Infinite
|
|
||||||
1s: 1 second
|
|
||||||
5s: 5 seconds
|
|
||||||
10s: 10 seconds
|
|
||||||
30s: 30 seconds
|
|
||||||
1m: 1 minute
|
|
||||||
3m: 3 minutes
|
|
||||||
5m: 5 minutes
|
|
||||||
|
|
||||||
unsupported:
|
unsupported:
|
||||||
serverVersion: 'Current version: <code>{serverVersion}</code>'
|
serverVersion: 'Current version: <code>{serverVersion}</code>'
|
||||||
@@ -36,8 +27,7 @@ nav:
|
|||||||
Logging: Logging
|
Logging: Logging
|
||||||
'Monitoring and Logging': Monitoring and Logging
|
'Monitoring and Logging': Monitoring and Logging
|
||||||
vmimport: Virtual Machine Imports
|
vmimport: Virtual Machine Imports
|
||||||
vmMigration: Virtual Machine Migration
|
vmMigration: VM Migration
|
||||||
Configurations: Configurations
|
|
||||||
|
|
||||||
resourceTable:
|
resourceTable:
|
||||||
groupBy:
|
groupBy:
|
||||||
@@ -93,8 +83,6 @@ harvester:
|
|||||||
backup:
|
backup:
|
||||||
success: 'Backup { backUpName } has been initiated.'
|
success: 'Backup { backUpName } has been initiated.'
|
||||||
addBackup: Add Backup
|
addBackup: Add Backup
|
||||||
fileSystemFreezeDeadline:
|
|
||||||
label: 'File System Freeze Deadline'
|
|
||||||
quota:
|
quota:
|
||||||
editVMQuota: Edit VM Quota
|
editVMQuota: Edit VM Quota
|
||||||
editQuota: Edit Quota
|
editQuota: Edit Quota
|
||||||
@@ -234,8 +222,6 @@ harvester:
|
|||||||
title: Take Virtual Machine Snapshot
|
title: Take Virtual Machine Snapshot
|
||||||
name: Name
|
name: Name
|
||||||
success: 'Take virtual machine Snapshot { name } successfully.'
|
success: 'Take virtual machine Snapshot { name } successfully.'
|
||||||
fileSystemFreezeDeadline:
|
|
||||||
label: 'File System Freeze Deadline'
|
|
||||||
restart:
|
restart:
|
||||||
title: Restart Virtual Machine
|
title: Restart Virtual Machine
|
||||||
tip: Restart the virtual machine for configuration changes to take effect.
|
tip: Restart the virtual machine for configuration changes to take effect.
|
||||||
@@ -379,7 +365,7 @@ harvester:
|
|||||||
vmMigrationMapSourceProvider: Source Provider
|
vmMigrationMapSourceProvider: Source Provider
|
||||||
vmMigrationMapDestProvider: Destination Provider
|
vmMigrationMapDestProvider: Destination Provider
|
||||||
vmMigrationPlanTargetNs: Target Namespace
|
vmMigrationPlanTargetNs: Target Namespace
|
||||||
vmMigrationPlanVmCount: VM Count
|
vmMigrationPlanVmCount: VMs
|
||||||
vmMigrationMigrationPlan: Plan
|
vmMigrationMigrationPlan: Plan
|
||||||
tab:
|
tab:
|
||||||
volume: Volumes
|
volume: Volumes
|
||||||
@@ -405,7 +391,6 @@ harvester:
|
|||||||
network: Network
|
network: Network
|
||||||
model: Model
|
model: Model
|
||||||
macAddress: MAC address
|
macAddress: MAC address
|
||||||
staticIp: Static IP
|
|
||||||
port: Port
|
port: Port
|
||||||
protocol: Protocol
|
protocol: Protocol
|
||||||
remove: Remove
|
remove: Remove
|
||||||
@@ -641,7 +626,6 @@ harvester:
|
|||||||
notification:
|
notification:
|
||||||
success: 'Update host "{name}" storage configurations successfully.'
|
success: 'Update host "{name}" storage configurations successfully.'
|
||||||
error: Host has unready or unschedulable disks.
|
error: Host has unready or unschedulable disks.
|
||||||
mounted: Already Mounted
|
|
||||||
fileSystem:
|
fileSystem:
|
||||||
info: Current file system is {system}, You can format it manually.
|
info: Current file system is {system}, You can format it manually.
|
||||||
formatting: Disk is formatting, please wait.
|
formatting: Disk is formatting, please wait.
|
||||||
@@ -781,7 +765,6 @@ harvester:
|
|||||||
dragTip: Drag and drop volumes, or use the volume's arrows, to change the boot order.
|
dragTip: Drag and drop volumes, or use the volume's arrows, to change the boot order.
|
||||||
volumeTip: The virtual machine only contains a CD-ROM volume. You may want to add additional disk volumes.
|
volumeTip: The virtual machine only contains a CD-ROM volume. You may want to add additional disk volumes.
|
||||||
macTip: "MAC address as seen inside the guest system."
|
macTip: "MAC address as seen inside the guest system."
|
||||||
staticIpTip: "Static IP that will be stored to annotation static-ip.harvesterhci.io/{nic_name}."
|
|
||||||
volumeUpdate: 'Set volume { name } successfully'
|
volumeUpdate: 'Set volume { name } successfully'
|
||||||
type: Type
|
type: Type
|
||||||
size: Size
|
size: Size
|
||||||
@@ -1856,7 +1839,7 @@ harvester:
|
|||||||
connectionFailed: Connection failed
|
connectionFailed: Connection failed
|
||||||
providerNotReady: Provider not ready
|
providerNotReady: Provider not ready
|
||||||
labels:
|
labels:
|
||||||
dashboard: Migration Overview
|
dashboard: Migrations
|
||||||
provider: Providers
|
provider: Providers
|
||||||
networkMap: Network Maps
|
networkMap: Network Maps
|
||||||
storageMap: Storage Maps
|
storageMap: Storage Maps
|
||||||
@@ -1938,8 +1921,8 @@ harvester:
|
|||||||
network: Network
|
network: Network
|
||||||
datastore: Datastore
|
datastore: Datastore
|
||||||
dashboard:
|
dashboard:
|
||||||
title: Virtual Machine Migration Overview
|
title: VMware to Harvester Migration
|
||||||
description: "Migrate virtual machines from VMware vSphere to Harvester using cold migration for data consistency. Create a migration plan to select VMs, map networks and storage, and prepare a migration to Harvester."
|
description: Migrate virtual machines from VMware vSphere to Harvester using cold migration for data consistency. Create a migration plan to select VMs, map networks and storage, and prepare a migration to Harvester.
|
||||||
createPlan: Create Migration
|
createPlan: Create Migration
|
||||||
tableTitle: Migrations
|
tableTitle: Migrations
|
||||||
columns:
|
columns:
|
||||||
@@ -1947,7 +1930,6 @@ harvester:
|
|||||||
plan: Migration Plan
|
plan: Migration Plan
|
||||||
progress: Progress
|
progress: Progress
|
||||||
mappings: Mappings
|
mappings: Mappings
|
||||||
duration: Duration
|
|
||||||
progress:
|
progress:
|
||||||
failed: Failed
|
failed: Failed
|
||||||
migration: Migration
|
migration: Migration
|
||||||
@@ -1968,7 +1950,7 @@ harvester:
|
|||||||
placeholder: Choose a Harvester network
|
placeholder: Choose a Harvester network
|
||||||
template: Use existing network mapping as template
|
template: Use existing network mapping as template
|
||||||
options:
|
options:
|
||||||
podNetworking: Management Network
|
podNetworking: Pod Networking
|
||||||
ignored: Ignored
|
ignored: Ignored
|
||||||
storageMapping:
|
storageMapping:
|
||||||
title: Storage Mapping
|
title: Storage Mapping
|
||||||
@@ -2003,8 +1985,6 @@ harvester:
|
|||||||
start: Start
|
start: Start
|
||||||
restart: Restart
|
restart: Restart
|
||||||
stop: Stop
|
stop: Stop
|
||||||
deleteDialog:
|
|
||||||
warning: Deleting this migration plan will also delete the following related resources
|
|
||||||
|
|
||||||
vmImport:
|
vmImport:
|
||||||
titles:
|
titles:
|
||||||
|
|||||||
@@ -53,6 +53,7 @@ export default {
|
|||||||
|
|
||||||
devices() {
|
devices() {
|
||||||
const inStore = this.$store.getters['currentProduct'].inStore;
|
const inStore = this.$store.getters['currentProduct'].inStore;
|
||||||
|
|
||||||
const data = this.$store.getters[`${ inStore }/all`](HCI.USB_DEVICE) || [];
|
const data = this.$store.getters[`${ inStore }/all`](HCI.USB_DEVICE) || [];
|
||||||
|
|
||||||
data.forEach((row) => {
|
data.forEach((row) => {
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ export default {
|
|||||||
|
|
||||||
const configs = this.$store.getters[`${ inStore }/all`](HCI.VLAN_CONFIG);
|
const configs = this.$store.getters[`${ inStore }/all`](HCI.VLAN_CONFIG);
|
||||||
|
|
||||||
return configs.filter((config) => config.spec?.clusterNetwork !== 'mgmt');
|
return configs;
|
||||||
},
|
},
|
||||||
|
|
||||||
vlanConfigSchema() {
|
vlanConfigSchema() {
|
||||||
@@ -121,22 +121,6 @@ export default {
|
|||||||
|
|
||||||
return [...this.rows, ...fakeRows];
|
return [...this.rows, ...fakeRows];
|
||||||
},
|
},
|
||||||
|
|
||||||
managementVlanConfigs() {
|
|
||||||
const inStore = this.$store.getters['currentProduct'].inStore;
|
|
||||||
|
|
||||||
const configs = this.$store.getters[`${ inStore }/all`](HCI.VLAN_CONFIG);
|
|
||||||
|
|
||||||
return configs
|
|
||||||
.filter((vc) => vc.spec?.clusterNetwork === 'mgmt')
|
|
||||||
.map((vc) => ({
|
|
||||||
id: vc.id,
|
|
||||||
node: vc.id.replace('mgmt-vlanconfig-', ''),
|
|
||||||
bondMode: vc.spec?.uplink?.bondOptions?.mode || '-',
|
|
||||||
interfaces: (vc.spec?.uplink?.nics?.length ? vc.spec.uplink.nics.join(', ') : '-'),
|
|
||||||
mtu: vc.spec?.uplink?.linkAttributes?.mtu || '-',
|
|
||||||
}));
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
@@ -240,29 +224,6 @@ export default {
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div
|
|
||||||
v-if="group.key === 'mgmt'"
|
|
||||||
class="mgmt-summary"
|
|
||||||
>
|
|
||||||
<div class="mgmt-header">
|
|
||||||
<div>{{ t('harvester.tableHeaders.vm.node') }}</div>
|
|
||||||
<div>{{ t('harvester.vlanConfig.uplink.bondOptions.mode.label') }}</div>
|
|
||||||
<div>{{ t('harvester.vlanConfig.uplink.nics.label') }}</div>
|
|
||||||
<div>{{ t('harvester.vlanConfig.uplink.linkAttributes.mtu.label') }}</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div
|
|
||||||
v-for="config in managementVlanConfigs"
|
|
||||||
:key="config.id"
|
|
||||||
class="mgmt-row"
|
|
||||||
>
|
|
||||||
<div>{{ config.node }}</div>
|
|
||||||
<div>{{ config.bondMode }}</div>
|
|
||||||
<div>{{ config.interfaces }}</div>
|
|
||||||
<div>{{ config.mtu }}</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
</template>
|
||||||
<template
|
<template
|
||||||
v-for="(clusterNetwork, i) in clusterNetworkWithoutConfigs"
|
v-for="(clusterNetwork, i) in clusterNetworkWithoutConfigs"
|
||||||
@@ -312,21 +273,6 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.mgmt-header,
|
|
||||||
.mgmt-row {
|
|
||||||
display: grid;
|
|
||||||
grid-template-columns: 2fr 2fr 2fr 1fr;
|
|
||||||
padding: 8px 12px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.mgmt-header {
|
|
||||||
font-weight: 600;
|
|
||||||
}
|
|
||||||
|
|
||||||
.mgmt-row {
|
|
||||||
border-top: 1px solid var(--border);
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
|
|||||||
@@ -630,8 +630,6 @@ export default {
|
|||||||
|
|
||||||
const networks = vm.spec.template.spec.networks || [];
|
const networks = vm.spec.template.spec.networks || [];
|
||||||
const interfaces = vm.spec.template.spec.domain.devices.interfaces || [];
|
const interfaces = vm.spec.template.spec.domain.devices.interfaces || [];
|
||||||
const annotations = vm.metadata?.annotations || {};
|
|
||||||
const staticIpPrefix = `${ HCI_ANNOTATIONS.STATIC_IP }/`;
|
|
||||||
|
|
||||||
const out = interfaces.map( (I, index) => {
|
const out = interfaces.map( (I, index) => {
|
||||||
const network = networks.find( (N) => I.name === N.name);
|
const network = networks.find( (N) => I.name === N.name);
|
||||||
@@ -648,7 +646,6 @@ export default {
|
|||||||
newCreateId: (fromTemplate || init) ? randomStr(10) : false,
|
newCreateId: (fromTemplate || init) ? randomStr(10) : false,
|
||||||
model: I.model,
|
model: I.model,
|
||||||
networkName: isPod ? MANAGEMENT_NETWORK : network?.multus?.networkName,
|
networkName: isPod ? MANAGEMENT_NETWORK : network?.multus?.networkName,
|
||||||
staticIp: annotations[`${ staticIpPrefix }${ I.name }`] || '',
|
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -750,8 +747,6 @@ export default {
|
|||||||
|
|
||||||
const vm = this.resourceType === HCI.VM ? this.value : this.value.spec.vm;
|
const vm = this.resourceType === HCI.VM ? this.value : this.value.spec.vm;
|
||||||
|
|
||||||
this.syncStaticIpAnnotations(vm);
|
|
||||||
|
|
||||||
// parse reserved memory
|
// parse reserved memory
|
||||||
if (!this.reservedMemory) {
|
if (!this.reservedMemory) {
|
||||||
delete vm.metadata.annotations[HCI_ANNOTATIONS.VM_RESERVED_MEMORY];
|
delete vm.metadata.annotations[HCI_ANNOTATIONS.VM_RESERVED_MEMORY];
|
||||||
@@ -773,30 +768,6 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
syncStaticIpAnnotations(vm) {
|
|
||||||
if (!vm?.metadata) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!vm.metadata.annotations) {
|
|
||||||
vm.metadata.annotations = {};
|
|
||||||
}
|
|
||||||
|
|
||||||
const staticIpPrefix = `${ HCI_ANNOTATIONS.STATIC_IP }/`;
|
|
||||||
|
|
||||||
Object.keys(vm.metadata.annotations).forEach((key) => {
|
|
||||||
if (key.startsWith(staticIpPrefix)) {
|
|
||||||
delete vm.metadata.annotations[key];
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
this.networkRows.forEach((row) => {
|
|
||||||
if (row.name && row.staticIp) {
|
|
||||||
vm.metadata.annotations[`${ staticIpPrefix }${ row.name }`] = row.staticIp;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
setCPUAndMemory() {
|
setCPUAndMemory() {
|
||||||
if (this.cpuMemoryHotplugEnabled) {
|
if (this.cpuMemoryHotplugEnabled) {
|
||||||
// set CPU
|
// set CPU
|
||||||
@@ -1788,18 +1759,7 @@ export default {
|
|||||||
const specDevice = specDeviceMap.get(device.name);
|
const specDevice = specDeviceMap.get(device.name);
|
||||||
|
|
||||||
if (specDevice) {
|
if (specDevice) {
|
||||||
const merged = { ...specDevice, ...device };
|
return { ...specDevice, ...device };
|
||||||
|
|
||||||
// A disk entry must be either `disk` or `cdrom`, never both.
|
|
||||||
const type = device?.cdrom ? CD_ROM : device?.disk ? HARD_DISK : '';
|
|
||||||
|
|
||||||
if (type === CD_ROM) {
|
|
||||||
delete merged.disk;
|
|
||||||
} else if (type === HARD_DISK) {
|
|
||||||
delete merged.cdrom;
|
|
||||||
}
|
|
||||||
|
|
||||||
return merged;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return device;
|
return device;
|
||||||
@@ -1847,15 +1807,6 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
watch: {
|
watch: {
|
||||||
networkRows: {
|
|
||||||
handler() {
|
|
||||||
const vm = this.resourceType === HCI.VM ? this.value : this.value?.spec?.vm;
|
|
||||||
|
|
||||||
this.syncStaticIpAnnotations(vm);
|
|
||||||
},
|
|
||||||
deep: true
|
|
||||||
},
|
|
||||||
|
|
||||||
diskRows: {
|
diskRows: {
|
||||||
handler(neu, old) {
|
handler(neu, old) {
|
||||||
if (Array.isArray(neu)) {
|
if (Array.isArray(neu)) {
|
||||||
|
|||||||
@@ -14,17 +14,6 @@ export default class ForkliftPlan extends HarvesterResource {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* The base HarvesterResource sets `doneOverride` to `listLocation`, which would
|
|
||||||
* force every single-item delete to redirect to the VM Migration dashboard.
|
|
||||||
* Return undefined so the delete flow stays on the current page (list/dashboard)
|
|
||||||
* and only falls back to the shell's default navigation when a now-invalid
|
|
||||||
* detail page is being viewed.
|
|
||||||
*/
|
|
||||||
get doneOverride() {
|
|
||||||
return undefined;
|
|
||||||
}
|
|
||||||
|
|
||||||
get planFailed() {
|
get planFailed() {
|
||||||
const conditions = this.status?.conditions || [];
|
const conditions = this.status?.conditions || [];
|
||||||
|
|
||||||
@@ -46,10 +35,6 @@ export default class ForkliftPlan extends HarvesterResource {
|
|||||||
}
|
}
|
||||||
|
|
||||||
get stateDescription() {
|
get stateDescription() {
|
||||||
if (this.metadata?.deletionTimestamp) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
const messages = [];
|
const messages = [];
|
||||||
const conditions = this.status?.conditions || [];
|
const conditions = this.status?.conditions || [];
|
||||||
|
|
||||||
@@ -71,7 +56,7 @@ export default class ForkliftPlan extends HarvesterResource {
|
|||||||
get stateObj() {
|
get stateObj() {
|
||||||
return {
|
return {
|
||||||
error: this.planFailed || this.planCritical,
|
error: this.planFailed || this.planCritical,
|
||||||
transitioning: this.isMigrating || this.isPendingMigrationStart || !!this.metadata?.deletionTimestamp,
|
transitioning: this.isMigrating,
|
||||||
message: this.stateDescription,
|
message: this.stateDescription,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -82,14 +67,6 @@ export default class ForkliftPlan extends HarvesterResource {
|
|||||||
return !!migration?.started && !migration?.completed;
|
return !!migration?.started && !migration?.completed;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Right after creating a plan, controller status can lag briefly.
|
|
||||||
// Treat this window as in-progress so we don't flash a succeeded badge.
|
|
||||||
get isPendingMigrationStart() {
|
|
||||||
const vmCount = this.spec?.vms?.length || 0;
|
|
||||||
|
|
||||||
return vmCount > 0 && !this.planFailed && !this.planCritical && !this.planCanceled && !this.planSucceeded && !this.isMigrating;
|
|
||||||
}
|
|
||||||
|
|
||||||
get planCanceled() {
|
get planCanceled() {
|
||||||
const history = this.status?.migration?.history || [];
|
const history = this.status?.migration?.history || [];
|
||||||
|
|
||||||
@@ -110,10 +87,6 @@ export default class ForkliftPlan extends HarvesterResource {
|
|||||||
}
|
}
|
||||||
|
|
||||||
get stateDisplay() {
|
get stateDisplay() {
|
||||||
if (this.metadata?.deletionTimestamp) {
|
|
||||||
return 'Terminating';
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.planFailed) {
|
if (this.planFailed) {
|
||||||
return this.t('harvester.addons.vmMigration.plan.states.error');
|
return this.t('harvester.addons.vmMigration.plan.states.error');
|
||||||
}
|
}
|
||||||
@@ -130,18 +103,10 @@ export default class ForkliftPlan extends HarvesterResource {
|
|||||||
return this.t('harvester.addons.vmMigration.plan.states.inProgress');
|
return this.t('harvester.addons.vmMigration.plan.states.inProgress');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.isPendingMigrationStart) {
|
|
||||||
return this.t('harvester.addons.vmMigration.plan.states.inProgress');
|
|
||||||
}
|
|
||||||
|
|
||||||
return this.t('harvester.addons.vmMigration.plan.states.active');
|
return this.t('harvester.addons.vmMigration.plan.states.active');
|
||||||
}
|
}
|
||||||
|
|
||||||
get stateBackground() {
|
get stateBackground() {
|
||||||
if (this.metadata?.deletionTimestamp) {
|
|
||||||
return 'bg-info';
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.planFailed) {
|
if (this.planFailed) {
|
||||||
return 'bg-error';
|
return 'bg-error';
|
||||||
}
|
}
|
||||||
@@ -158,10 +123,6 @@ export default class ForkliftPlan extends HarvesterResource {
|
|||||||
return 'bg-info';
|
return 'bg-info';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.isPendingMigrationStart) {
|
|
||||||
return 'bg-info';
|
|
||||||
}
|
|
||||||
|
|
||||||
return 'bg-success';
|
return 'bg-success';
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -283,4 +244,15 @@ export default class ForkliftPlan extends HarvesterResource {
|
|||||||
async deletePlan() {
|
async deletePlan() {
|
||||||
await this.remove();
|
await this.remove();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Deleting a Plan cascades via ownerReferences set at creation time.
|
||||||
|
* Kubernetes GC will automatically delete: Migration, NetworkMap, StorageMap, Provider (→ Secret).
|
||||||
|
* Use foreground propagation to ensure children are deleted before the parent.
|
||||||
|
*/
|
||||||
|
remove(opt = {}) {
|
||||||
|
opt.params = { ...(opt.params || {}), propagationPolicy: 'Foreground' };
|
||||||
|
|
||||||
|
return this._remove(opt);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,13 +1,13 @@
|
|||||||
{
|
{
|
||||||
"name": "harvester",
|
"name": "harvester",
|
||||||
"description": "Rancher UI Extension for Harvester",
|
"description": "Rancher UI Extension for Harvester",
|
||||||
"version": "1.9.0-rc2",
|
"version": "1.9.0-dev",
|
||||||
"private": false,
|
"private": false,
|
||||||
"rancher": {
|
"rancher": {
|
||||||
"annotations": {
|
"annotations": {
|
||||||
"catalog.cattle.io/display-name": "Harvester",
|
"catalog.cattle.io/display-name": "Harvester",
|
||||||
"catalog.cattle.io/kube-version": ">= 1.16.0-0",
|
"catalog.cattle.io/kube-version": ">= 1.16.0-0",
|
||||||
"catalog.cattle.io/rancher-version": ">= 2.15.0-0",
|
"catalog.cattle.io/rancher-version": ">= 2.14.0-0",
|
||||||
"catalog.cattle.io/ui-extensions-version": ">= 3.0.0 < 4.0.0"
|
"catalog.cattle.io/ui-extensions-version": ">= 3.0.0 < 4.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -11,8 +11,6 @@ import { SCHEMA } from '@shell/config/types';
|
|||||||
import { useI18n } from '@shell/composables/useI18n';
|
import { useI18n } from '@shell/composables/useI18n';
|
||||||
import { HCI } from '../../../../types';
|
import { HCI } from '../../../../types';
|
||||||
import { PRODUCT_NAME } from '../../../../config/harvester';
|
import { PRODUCT_NAME } from '../../../../config/harvester';
|
||||||
import { ADD_ONS } from '../../../../config/harvester-map';
|
|
||||||
import { currentRouter } from '../../../../utils/router';
|
|
||||||
import { FORKLIFT_PLAN_VM_COUNT } from '../../../../config/table-headers';
|
import { FORKLIFT_PLAN_VM_COUNT } from '../../../../config/table-headers';
|
||||||
import { STATE, NAME as NAME_COL, AGE } from '@shell/config/table-headers';
|
import { STATE, NAME as NAME_COL, AGE } from '@shell/config/table-headers';
|
||||||
|
|
||||||
@@ -38,87 +36,6 @@ const allPlans = computed(() => store.getters[`${ inStore.value }/all`](HCI.FORK
|
|||||||
const allNetworkMaps = computed(() => store.getters[`${ inStore.value }/all`](HCI.FORKLIFT_NETWORK_MAP));
|
const allNetworkMaps = computed(() => store.getters[`${ inStore.value }/all`](HCI.FORKLIFT_NETWORK_MAP));
|
||||||
const allStorageMaps = computed(() => store.getters[`${ inStore.value }/all`](HCI.FORKLIFT_STORAGE_MAP));
|
const allStorageMaps = computed(() => store.getters[`${ inStore.value }/all`](HCI.FORKLIFT_STORAGE_MAP));
|
||||||
|
|
||||||
const escapeHtml = (value = '') => String(value)
|
|
||||||
.replaceAll('&', '&')
|
|
||||||
.replaceAll('<', '<')
|
|
||||||
.replaceAll('>', '>')
|
|
||||||
.replaceAll('"', '"')
|
|
||||||
.replaceAll("'", ''');
|
|
||||||
|
|
||||||
const getPipelineStepMeta = (step = {}) => {
|
|
||||||
const phase = String(step.phase || '').toLowerCase();
|
|
||||||
const hasProgress = typeof step.progress?.completed === 'number' && typeof step.progress?.total === 'number' && step.progress.total > 0;
|
|
||||||
const progressPct = hasProgress ? Math.round((step.progress.completed / step.progress.total) * 1000) / 10 : null;
|
|
||||||
|
|
||||||
if (phase === 'completed' || phase === 'succeeded') {
|
|
||||||
return {
|
|
||||||
icon: '✓',
|
|
||||||
color: 'var(--success)',
|
|
||||||
text: ''
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
if (phase === 'running' || phase === 'inprogress' || phase === 'progressing' || phase === 'started' || (hasProgress && progressPct > 0)) {
|
|
||||||
return {
|
|
||||||
icon: '↻',
|
|
||||||
color: 'var(--primary)',
|
|
||||||
text: progressPct !== null ? `${ step.phase || t('generic.inProgress') } (${ progressPct }%)` : (step.phase || t('generic.inProgress'))
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
if (phase === 'failed' || phase === 'error') {
|
|
||||||
return {
|
|
||||||
icon: '✕',
|
|
||||||
color: 'var(--error)',
|
|
||||||
text: step.phase || t('harvester.addons.vmMigration.dashboard.progress.failed')
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
|
||||||
icon: '○',
|
|
||||||
color: 'var(--muted)',
|
|
||||||
text: ''
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
const formatPipelineTooltip = (pipeline = []) => {
|
|
||||||
if (!pipeline.length) {
|
|
||||||
return `<div style="display:flex;align-items:center;gap:8px;"><span style="color:var(--muted);font-weight:700;">○</span><span>${ escapeHtml(t('harvester.addons.vmMigration.dashboard.progress.initializingMigration')) }</span></div>`;
|
|
||||||
}
|
|
||||||
|
|
||||||
return pipeline
|
|
||||||
.map((step, idx) => {
|
|
||||||
const stepName = step.name || t('harvester.addons.vmMigration.dashboard.progress.step', { index: idx + 1 });
|
|
||||||
const meta = getPipelineStepMeta(step);
|
|
||||||
const lineText = meta.text ? `${ escapeHtml(stepName) } : ${ escapeHtml(meta.text) }` : escapeHtml(stepName);
|
|
||||||
|
|
||||||
return `<div style="display:flex;align-items:center;gap:8px;"><span style="color:${ meta.color };font-weight:700;">${ meta.icon }</span><span>${ lineText }</span></div>`;
|
|
||||||
})
|
|
||||||
.join('');
|
|
||||||
};
|
|
||||||
|
|
||||||
const formatDuration = (started, completed) => {
|
|
||||||
if (!started || !completed) {
|
|
||||||
return { display: null, seconds: -1 };
|
|
||||||
}
|
|
||||||
|
|
||||||
const startMs = new Date(started).getTime();
|
|
||||||
const endMs = new Date(completed).getTime();
|
|
||||||
|
|
||||||
if (isNaN(startMs) || isNaN(endMs) || endMs < startMs) {
|
|
||||||
return { display: null, seconds: -1 };
|
|
||||||
}
|
|
||||||
|
|
||||||
const totalSeconds = Math.floor((endMs - startMs) / 1000);
|
|
||||||
const hours = Math.floor(totalSeconds / 3600);
|
|
||||||
const minutes = Math.floor((totalSeconds % 3600) / 60);
|
|
||||||
const seconds = totalSeconds % 60;
|
|
||||||
|
|
||||||
const display = hours > 0 ? `${ hours }h ${ minutes }m` : `${ minutes }m ${ seconds }s`;
|
|
||||||
|
|
||||||
return { display, seconds: totalSeconds };
|
|
||||||
};
|
|
||||||
|
|
||||||
const rows = computed(() => {
|
const rows = computed(() => {
|
||||||
return allPlans.value.map((plan) => {
|
return allPlans.value.map((plan) => {
|
||||||
const netMapName = plan.spec?.map?.network?.name;
|
const netMapName = plan.spec?.map?.network?.name;
|
||||||
@@ -184,36 +101,29 @@ const rows = computed(() => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
vmName: vm.name || vm.id || t('harvester.addons.vmMigration.generic.unknown'),
|
vmName: vm.name || vm.id || t('harvester.addons.vmMigration.generic.unknown'),
|
||||||
vmId: vm.id || '',
|
vmId: vm.id || '',
|
||||||
progress: overallProgress,
|
progress: overallProgress,
|
||||||
currentStep,
|
currentStep,
|
||||||
pipelineTooltip: formatPipelineTooltip(pipeline),
|
|
||||||
errorMsg,
|
errorMsg,
|
||||||
canceled: plan.planCanceled,
|
canceled: plan.planCanceled,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
// If no migration progress but we have VMs in the spec, show them at 0%
|
// If no migration progress but we have VMs in the spec, show them at 0%
|
||||||
if (plan.vmProgress.length === 0 && plan.spec?.vms?.length > 0) {
|
if (plan.vmProgress.length === 0 && plan.spec?.vms?.length > 0) {
|
||||||
plan.vmProgress = plan.spec.vms.map((vm) => ({
|
plan.vmProgress = plan.spec.vms.map((vm) => ({
|
||||||
vmName: vm.name || vm.id || t('harvester.addons.vmMigration.generic.unknown'),
|
vmName: vm.name || vm.id || t('harvester.addons.vmMigration.generic.unknown'),
|
||||||
vmId: vm.id || '',
|
vmId: vm.id || '',
|
||||||
progress: 0,
|
progress: 0,
|
||||||
currentStep: t('harvester.addons.vmMigration.dashboard.progress.initializingMigration'),
|
currentStep: t('harvester.addons.vmMigration.dashboard.progress.initializingMigration'),
|
||||||
pipelineTooltip: formatPipelineTooltip([]),
|
errorMsg: '',
|
||||||
errorMsg: '',
|
canceled: false,
|
||||||
canceled: false,
|
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
plan.progress = plan.vmProgress.length > 0 ? Math.round(plan.vmProgress.reduce((sum, vm) => sum + vm.progress, 0) / plan.vmProgress.length * 10) / 10 : 0;
|
plan.progress = plan.vmProgress.length > 0 ? Math.round(plan.vmProgress.reduce((sum, vm) => sum + vm.progress, 0) / plan.vmProgress.length * 10) / 10 : 0;
|
||||||
|
|
||||||
const durationResult = formatDuration(plan.status?.migration?.started, plan.status?.migration?.completed);
|
|
||||||
|
|
||||||
plan.duration = durationResult.display;
|
|
||||||
plan.durationSeconds = durationResult.seconds;
|
|
||||||
|
|
||||||
return plan;
|
return plan;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -237,47 +147,17 @@ const headers = [
|
|||||||
name: 'progress',
|
name: 'progress',
|
||||||
labelKey: 'harvester.addons.vmMigration.dashboard.columns.progress',
|
labelKey: 'harvester.addons.vmMigration.dashboard.columns.progress',
|
||||||
value: 'progress',
|
value: 'progress',
|
||||||
width: 450,
|
width: 500,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'mappings',
|
name: 'mappings',
|
||||||
labelKey: 'harvester.addons.vmMigration.dashboard.columns.mappings',
|
labelKey: 'harvester.addons.vmMigration.dashboard.columns.mappings',
|
||||||
},
|
},
|
||||||
{
|
|
||||||
name: 'duration',
|
|
||||||
labelKey: 'harvester.addons.vmMigration.dashboard.columns.duration',
|
|
||||||
value: 'duration',
|
|
||||||
sort: 'durationSeconds',
|
|
||||||
width: 120,
|
|
||||||
},
|
|
||||||
{ ...AGE },
|
{ ...AGE },
|
||||||
];
|
];
|
||||||
|
|
||||||
const init = async() => {
|
const init = async() => {
|
||||||
try {
|
try {
|
||||||
// Guard: the Forklift dashboard is only available when the Forklift addon is
|
|
||||||
// enabled. Redirect back to the Harvester dashboard otherwise (e.g. direct URL).
|
|
||||||
let forkliftEnabled = false;
|
|
||||||
|
|
||||||
if (store.getters[`${ inStore.value }/schemaFor`](HCI.ADD_ONS)) {
|
|
||||||
const addons = await store.dispatch(`${ inStore.value }/findAll`, { type: HCI.ADD_ONS });
|
|
||||||
|
|
||||||
forkliftEnabled = addons.find((a) => a.metadata?.name === ADD_ONS.FORKLIFT_OPERATOR)?.spec?.enabled === true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!forkliftEnabled) {
|
|
||||||
await currentRouter().replace({
|
|
||||||
name: `${ PRODUCT_NAME }-c-cluster-resource`,
|
|
||||||
params: {
|
|
||||||
product: store.getters['productId'],
|
|
||||||
cluster: store.getters['clusterId'],
|
|
||||||
resource: HCI.DASHBOARD,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
await Promise.all([
|
await Promise.all([
|
||||||
store.dispatch(`${ inStore.value }/findAll`, { type: HCI.FORKLIFT_PLAN }),
|
store.dispatch(`${ inStore.value }/findAll`, { type: HCI.FORKLIFT_PLAN }),
|
||||||
store.dispatch(`${ inStore.value }/findAll`, { type: HCI.FORKLIFT_NETWORK_MAP }),
|
store.dispatch(`${ inStore.value }/findAll`, { type: HCI.FORKLIFT_NETWORK_MAP }),
|
||||||
@@ -309,10 +189,9 @@ init();
|
|||||||
>
|
>
|
||||||
<template #subHeader>
|
<template #subHeader>
|
||||||
<div class="mmt-5">
|
<div class="mmt-5">
|
||||||
<p
|
<p class="text-muted">
|
||||||
v-clean-html="t('harvester.addons.vmMigration.dashboard.description')"
|
{{ t('harvester.addons.vmMigration.dashboard.description') }}
|
||||||
class="text-muted"
|
</p>
|
||||||
></p>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<template #createButton>
|
<template #createButton>
|
||||||
@@ -334,19 +213,14 @@ init();
|
|||||||
:search="false"
|
:search="false"
|
||||||
key-field="_key"
|
key-field="_key"
|
||||||
>
|
>
|
||||||
|
<template #header-left>
|
||||||
|
<h3 class="table-title m-0">
|
||||||
|
{{ t('harvester.addons.vmMigration.dashboard.tableTitle') }}
|
||||||
|
</h3>
|
||||||
|
</template>
|
||||||
<template #cell:name="{ row }">
|
<template #cell:name="{ row }">
|
||||||
<div class="plan-name-cell">
|
<div class="plan-name-cell">
|
||||||
<router-link
|
<div class="plan-name">
|
||||||
v-if="row.detailLocation"
|
|
||||||
:to="row.detailLocation"
|
|
||||||
class="plan-name"
|
|
||||||
>
|
|
||||||
{{ row.metadata.name }}
|
|
||||||
</router-link>
|
|
||||||
<div
|
|
||||||
v-else
|
|
||||||
class="plan-name"
|
|
||||||
>
|
|
||||||
{{ row.metadata.name }}
|
{{ row.metadata.name }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -371,16 +245,12 @@ init();
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="vm-pct-block">
|
<div class="vm-pct-block">
|
||||||
<div
|
<PercentageBar
|
||||||
v-clean-tooltip="{ content: vm.pipelineTooltip, html: true }"
|
:model-value="vm.progress"
|
||||||
|
:color-stops="vm.errorMsg ? { 100: '--error' } : vm.canceled ? { 100: '--darker' } : vm.progress >= 100 ? { 100: '--success' } : { 100: '--primary' }"
|
||||||
|
preferred-direction="MORE"
|
||||||
class="vm-bar"
|
class="vm-bar"
|
||||||
>
|
/>
|
||||||
<PercentageBar
|
|
||||||
:model-value="vm.progress"
|
|
||||||
:color-stops="vm.errorMsg ? { 100: '--error' } : vm.canceled ? { 100: '--darker' } : vm.progress >= 100 ? { 100: '--success' } : { 100: '--primary' }"
|
|
||||||
preferred-direction="MORE"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<span class="vm-pct text-muted mr-10">{{ vm.progress }}%</span>
|
<span class="vm-pct text-muted mr-10">{{ vm.progress }}%</span>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
@@ -417,13 +287,6 @@ init();
|
|||||||
:storage-entries="row.storageEntries"
|
:storage-entries="row.storageEntries"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
<template #cell:duration="{ row }">
|
|
||||||
<span v-if="row.duration">{{ row.duration }}</span>
|
|
||||||
<span
|
|
||||||
v-else
|
|
||||||
class="text-muted"
|
|
||||||
>—</span>
|
|
||||||
</template>
|
|
||||||
</ResourceTable>
|
</ResourceTable>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -9,7 +9,6 @@ import ConfigureMappingsStep from '@pkg/harvester/components/vm-migration/Config
|
|||||||
import ReviewMigrationStep from '@pkg/harvester/components/vm-migration/ReviewMigrationStep.vue';
|
import ReviewMigrationStep from '@pkg/harvester/components/vm-migration/ReviewMigrationStep.vue';
|
||||||
import { PRODUCT_NAME } from '@pkg/harvester/config/harvester';
|
import { PRODUCT_NAME } from '@pkg/harvester/config/harvester';
|
||||||
import { currentRouter } from '@pkg/harvester/utils/router';
|
import { currentRouter } from '@pkg/harvester/utils/router';
|
||||||
import { exceptionToErrorsArray, stringify } from '@shell/utils/error';
|
|
||||||
|
|
||||||
const store = useStore();
|
const store = useStore();
|
||||||
const { t } = useI18n(store);
|
const { t } = useI18n(store);
|
||||||
@@ -221,13 +220,7 @@ const onFinish = async(buttonCb) => {
|
|||||||
buttonCb(true);
|
buttonCb(true);
|
||||||
currentRouter().push(migrationListLocation);
|
currentRouter().push(migrationListLocation);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
errors.value = exceptionToErrorsArray(err).map((e) => {
|
errors.value = [err instanceof Error ? err.message : String(err)];
|
||||||
if (typeof e === 'string') {
|
|
||||||
return e;
|
|
||||||
}
|
|
||||||
|
|
||||||
return stringify(e);
|
|
||||||
});
|
|
||||||
buttonCb(false);
|
buttonCb(false);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,316 +0,0 @@
|
|||||||
<script>
|
|
||||||
import { defineComponent } from 'vue';
|
|
||||||
import { mapState, mapGetters } from 'vuex';
|
|
||||||
import { resourceNames } from '@shell/utils/string';
|
|
||||||
import { exceptionToErrorsArray } from '@shell/utils/error';
|
|
||||||
import { HCI } from '../types';
|
|
||||||
|
|
||||||
export default defineComponent({
|
|
||||||
name: 'PromptRemoveForkliftPlanDialog',
|
|
||||||
|
|
||||||
emits: ['errors'],
|
|
||||||
|
|
||||||
props: {
|
|
||||||
value: {
|
|
||||||
type: Array,
|
|
||||||
default: () => []
|
|
||||||
},
|
|
||||||
|
|
||||||
names: {
|
|
||||||
type: Array,
|
|
||||||
default: () => []
|
|
||||||
},
|
|
||||||
|
|
||||||
type: {
|
|
||||||
type: String,
|
|
||||||
required: true
|
|
||||||
},
|
|
||||||
|
|
||||||
close: {
|
|
||||||
type: Function,
|
|
||||||
required: true
|
|
||||||
},
|
|
||||||
|
|
||||||
doneLocation: {
|
|
||||||
type: Object,
|
|
||||||
default: () => {}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
errors: [],
|
|
||||||
removing: false,
|
|
||||||
};
|
|
||||||
},
|
|
||||||
|
|
||||||
computed: {
|
|
||||||
...mapState('action-menu', ['toRemove']),
|
|
||||||
...mapGetters({ t: 'i18n/t' }),
|
|
||||||
|
|
||||||
existingRelatedResources() {
|
|
||||||
const inStore = this.$store.getters['currentProduct'].inStore;
|
|
||||||
|
|
||||||
return {
|
|
||||||
[HCI.FORKLIFT_MIGRATION]: this.$store.getters[`${ inStore }/all`](HCI.FORKLIFT_MIGRATION) || [],
|
|
||||||
[HCI.FORKLIFT_NETWORK_MAP]: this.$store.getters[`${ inStore }/all`](HCI.FORKLIFT_NETWORK_MAP) || [],
|
|
||||||
[HCI.FORKLIFT_STORAGE_MAP]: this.$store.getters[`${ inStore }/all`](HCI.FORKLIFT_STORAGE_MAP) || [],
|
|
||||||
};
|
|
||||||
},
|
|
||||||
|
|
||||||
resourceType() {
|
|
||||||
return this.t('typeLabel."forklift.konveyor.io.plan"', { count: this.names?.length || 1 });
|
|
||||||
},
|
|
||||||
|
|
||||||
relatedSummary() {
|
|
||||||
const existing = this.existingRelatedResources;
|
|
||||||
|
|
||||||
return (this.value || []).map((plan) => {
|
|
||||||
const planName = plan?.metadata?.name || '-';
|
|
||||||
const namespace = plan?.metadata?.namespace || '';
|
|
||||||
const networkMap = plan?.spec?.map?.network;
|
|
||||||
const storageMap = plan?.spec?.map?.storage;
|
|
||||||
const history = plan?.status?.migration?.history || [];
|
|
||||||
|
|
||||||
const migrationsMap = new Map();
|
|
||||||
|
|
||||||
history
|
|
||||||
.map((entry) => ({
|
|
||||||
name: entry?.migration?.name,
|
|
||||||
namespace: entry?.migration?.namespace || namespace,
|
|
||||||
}))
|
|
||||||
.filter((entry) => !!entry.name)
|
|
||||||
.forEach((entry) => {
|
|
||||||
const matched = existing[HCI.FORKLIFT_MIGRATION].find((resource) => resource?.metadata?.name === entry.name && resource?.metadata?.namespace === entry.namespace);
|
|
||||||
|
|
||||||
if (matched) {
|
|
||||||
migrationsMap.set(`${ entry.namespace }/${ entry.name }`, entry);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
const matchedNetworkMap = networkMap?.name && existing[HCI.FORKLIFT_NETWORK_MAP].find((resource) => resource?.metadata?.name === networkMap.name && resource?.metadata?.namespace === (networkMap.namespace || namespace));
|
|
||||||
const matchedStorageMap = storageMap?.name && existing[HCI.FORKLIFT_STORAGE_MAP].find((resource) => resource?.metadata?.name === storageMap.name && resource?.metadata?.namespace === (storageMap.namespace || namespace));
|
|
||||||
|
|
||||||
return {
|
|
||||||
planName,
|
|
||||||
namespace,
|
|
||||||
migrations: [...migrationsMap.values()],
|
|
||||||
networkMap: matchedNetworkMap ? {
|
|
||||||
namespace: networkMap.namespace || namespace,
|
|
||||||
name: networkMap.name,
|
|
||||||
} : null,
|
|
||||||
storageMap: matchedStorageMap ? {
|
|
||||||
namespace: storageMap.namespace || namespace,
|
|
||||||
name: storageMap.name,
|
|
||||||
} : null,
|
|
||||||
};
|
|
||||||
});
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
async mounted() {
|
|
||||||
const inStore = this.$store.getters['currentProduct'].inStore;
|
|
||||||
|
|
||||||
try {
|
|
||||||
await Promise.all([
|
|
||||||
this.$store.dispatch(`${ inStore }/findAll`, { type: HCI.FORKLIFT_MIGRATION }),
|
|
||||||
this.$store.dispatch(`${ inStore }/findAll`, { type: HCI.FORKLIFT_NETWORK_MAP }),
|
|
||||||
this.$store.dispatch(`${ inStore }/findAll`, { type: HCI.FORKLIFT_STORAGE_MAP }),
|
|
||||||
]);
|
|
||||||
} catch {
|
|
||||||
// Best-effort: the dialog can still function without this prefetch.
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
methods: {
|
|
||||||
resourceNames,
|
|
||||||
|
|
||||||
buildDeleteTargets() {
|
|
||||||
const targets = new Map();
|
|
||||||
|
|
||||||
for (const plan of this.value || []) {
|
|
||||||
const namespace = plan?.metadata?.namespace || '';
|
|
||||||
const networkMap = plan?.spec?.map?.network;
|
|
||||||
const storageMap = plan?.spec?.map?.storage;
|
|
||||||
const history = plan?.status?.migration?.history || [];
|
|
||||||
|
|
||||||
if (networkMap?.name) {
|
|
||||||
const ns = networkMap.namespace || namespace;
|
|
||||||
const key = `${ HCI.FORKLIFT_NETWORK_MAP }|${ ns }|${ networkMap.name }`;
|
|
||||||
|
|
||||||
targets.set(key, {
|
|
||||||
type: HCI.FORKLIFT_NETWORK_MAP,
|
|
||||||
name: networkMap.name,
|
|
||||||
namespace: ns,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
if (storageMap?.name) {
|
|
||||||
const ns = storageMap.namespace || namespace;
|
|
||||||
const key = `${ HCI.FORKLIFT_STORAGE_MAP }|${ ns }|${ storageMap.name }`;
|
|
||||||
|
|
||||||
targets.set(key, {
|
|
||||||
type: HCI.FORKLIFT_STORAGE_MAP,
|
|
||||||
name: storageMap.name,
|
|
||||||
namespace: ns,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
for (const entry of history) {
|
|
||||||
const migrationName = entry?.migration?.name;
|
|
||||||
|
|
||||||
if (!migrationName) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
const migrationNs = entry?.migration?.namespace || namespace;
|
|
||||||
const key = `${ HCI.FORKLIFT_MIGRATION }|${ migrationNs }|${ migrationName }`;
|
|
||||||
|
|
||||||
targets.set(key, {
|
|
||||||
type: HCI.FORKLIFT_MIGRATION,
|
|
||||||
name: migrationName,
|
|
||||||
namespace: migrationNs,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return [...targets.values()];
|
|
||||||
},
|
|
||||||
|
|
||||||
async deleteRelatedResources() {
|
|
||||||
const inStore = this.$store.getters['currentProduct'].inStore;
|
|
||||||
const targets = this.buildDeleteTargets();
|
|
||||||
|
|
||||||
if (!targets.length) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
let cache = {};
|
|
||||||
|
|
||||||
try {
|
|
||||||
cache = {
|
|
||||||
[HCI.FORKLIFT_MIGRATION]: await this.$store.dispatch(`${ inStore }/findAll`, { type: HCI.FORKLIFT_MIGRATION }),
|
|
||||||
[HCI.FORKLIFT_NETWORK_MAP]: await this.$store.dispatch(`${ inStore }/findAll`, { type: HCI.FORKLIFT_NETWORK_MAP }),
|
|
||||||
[HCI.FORKLIFT_STORAGE_MAP]: await this.$store.dispatch(`${ inStore }/findAll`, { type: HCI.FORKLIFT_STORAGE_MAP }),
|
|
||||||
};
|
|
||||||
} catch (err) {
|
|
||||||
// Best-effort cleanup; don't block closing the dialog if listing related resources fails.
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (const target of targets) {
|
|
||||||
const matched = (cache[target.type] || []).find((resource) => resource?.metadata?.name === target.name && resource?.metadata?.namespace === target.namespace
|
|
||||||
);
|
|
||||||
|
|
||||||
if (!matched) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
await matched.remove({ params: { propagationPolicy: 'Background' } });
|
|
||||||
} catch (err) {
|
|
||||||
// Continue deleting remaining resources and let final plan deletion fail if needed.
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
async remove(buttonDone) {
|
|
||||||
this.errors = [];
|
|
||||||
this.removing = true;
|
|
||||||
|
|
||||||
try {
|
|
||||||
const results = await Promise.allSettled((this.value || []).map((resource) => resource.remove({ params: { propagationPolicy: 'Background' } })));
|
|
||||||
|
|
||||||
await this.deleteRelatedResources();
|
|
||||||
const rejected = results.filter((r) => r.status === 'rejected');
|
|
||||||
|
|
||||||
if (rejected.length) {
|
|
||||||
throw rejected[0].reason;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.close(buttonDone);
|
|
||||||
} catch (err) {
|
|
||||||
this.errors = exceptionToErrorsArray(err);
|
|
||||||
this.$emit('errors', err);
|
|
||||||
if (buttonDone) {
|
|
||||||
buttonDone(false);
|
|
||||||
}
|
|
||||||
} finally {
|
|
||||||
this.removing = false;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
}
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<template>
|
|
||||||
<div class="mt-10">
|
|
||||||
<div class="mb-10">
|
|
||||||
{{ t('promptRemove.attemptingToRemove', { type: resourceType }) }}
|
|
||||||
<span v-clean-html="resourceNames(names, null, t)" />
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<hr class="mb-10">
|
|
||||||
|
|
||||||
<div class="mb-10 text-warning">
|
|
||||||
<i class="icon icon-warning icon-lg mr-5" />
|
|
||||||
{{ t('harvester.addons.vmMigration.deleteDialog.warning') }}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div
|
|
||||||
v-for="summary in relatedSummary"
|
|
||||||
:key="`${ summary.namespace }/${ summary.planName }`"
|
|
||||||
class="mb-10"
|
|
||||||
>
|
|
||||||
<div>• {{ t('harvester.addons.vmMigration.labels.migration') }}:</div>
|
|
||||||
<template v-if="summary.migrations.length">
|
|
||||||
<div
|
|
||||||
v-for="migration in summary.migrations"
|
|
||||||
:key="`${ migration.namespace }/${ migration.name }`"
|
|
||||||
>
|
|
||||||
<div class="ml-20">
|
|
||||||
- {{ migration.name }}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
<div
|
|
||||||
v-else
|
|
||||||
class="ml-20"
|
|
||||||
>
|
|
||||||
- -
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div>• {{ t('harvester.addons.vmMigration.labels.networkMap') }}:</div>
|
|
||||||
<template v-if="summary.networkMap">
|
|
||||||
<div class="ml-20">
|
|
||||||
- {{ summary.networkMap.name }}
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
<div
|
|
||||||
v-else
|
|
||||||
class="ml-20"
|
|
||||||
>
|
|
||||||
- -
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div>• {{ t('harvester.addons.vmMigration.labels.storageMap') }}:</div>
|
|
||||||
<template v-if="summary.storageMap">
|
|
||||||
<div class="ml-20">
|
|
||||||
- {{ summary.storageMap.name }}
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
<div
|
|
||||||
v-else
|
|
||||||
class="ml-20"
|
|
||||||
>
|
|
||||||
- -
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<Banner
|
|
||||||
v-for="(error, i) in errors"
|
|
||||||
:key="i"
|
|
||||||
color="error"
|
|
||||||
:label="error"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
@@ -1,43 +0,0 @@
|
|||||||
export const DEFAULT_FS_FREEZE_DEADLINE = '1s';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Generate filesystem freeze deadline options with i18n translations
|
|
||||||
* @param {Function} t - i18n translation function
|
|
||||||
* @returns {Array} Array of deadline options
|
|
||||||
*/
|
|
||||||
export function getFsFreezeDeadlineOptions(t) {
|
|
||||||
return [
|
|
||||||
{
|
|
||||||
label: t('generic.duration.infinite'),
|
|
||||||
value: '0s'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: t('generic.duration.1s'),
|
|
||||||
value: '1s'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: t('generic.duration.5s'),
|
|
||||||
value: '5s'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: t('generic.duration.10s'),
|
|
||||||
value: '10s'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: t('generic.duration.30s'),
|
|
||||||
value: '30s'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: t('generic.duration.1m'),
|
|
||||||
value: '1m'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: t('generic.duration.3m'),
|
|
||||||
value: '3m'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: t('generic.duration.5m'),
|
|
||||||
value: '5m'
|
|
||||||
}
|
|
||||||
];
|
|
||||||
}
|
|
||||||
@@ -8,11 +8,9 @@
|
|||||||
* @param {String} config.resourceType - The schema ID for addons.
|
* @param {String} config.resourceType - The schema ID for addons.
|
||||||
* @param {String} config.navGroup - The group name in the side nav.
|
* @param {String} config.navGroup - The group name in the side nav.
|
||||||
* @param {Array<String>} config.types - Array of Resource IDs to show/hide.
|
* @param {Array<String>} config.types - Array of Resource IDs to show/hide.
|
||||||
* @param {Boolean} [config.requireSchema=true] - When true, only types with an
|
|
||||||
* accessible schema are shown. Set false for schema-less virtual types.
|
|
||||||
*/
|
*/
|
||||||
export function registerAddonSideNav(store, productName, {
|
export function registerAddonSideNav(store, productName, {
|
||||||
addonName, resourceType, navGroup, types, requireSchema = true
|
addonName, resourceType, navGroup, types
|
||||||
}) {
|
}) {
|
||||||
if (typeof window === 'undefined') {
|
if (typeof window === 'undefined') {
|
||||||
return;
|
return;
|
||||||
@@ -59,7 +57,7 @@ export function registerAddonSideNav(store, productName, {
|
|||||||
|
|
||||||
// Adds or removes the resource IDs from the product visibility whitelist.
|
// Adds or removes the resource IDs from the product visibility whitelist.
|
||||||
const setMenuVisibility = (visible) => {
|
const setMenuVisibility = (visible) => {
|
||||||
const accessibleTypes = visible ? (requireSchema ? types.filter(hasAccessibleSchema) : types) : [];
|
const accessibleTypes = visible ? types.filter(hasAccessibleSchema) : [];
|
||||||
|
|
||||||
// Always clear first to remove any previously-registered types that are
|
// Always clear first to remove any previously-registered types that are
|
||||||
// no longer accessible (e.g. partial permission changes like types=[A,B] where B is dropped).
|
// no longer accessible (e.g. partial permission changes like types=[A,B] where B is dropped).
|
||||||
|
|||||||
Reference in new issue
Block a user