mirror of
https://github.com/harvester/harvester-ui-extension.git
synced 2026-11-21 00:06:57 +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 |
@@ -1,19 +1,14 @@
|
||||
<!-- This template is for Devs to give QA details before moving the issue To-Test -->
|
||||
### Summary
|
||||
<!-- Give the fix root cause or feature requirement, at least list what this PR changes -->
|
||||
|
||||
|
||||
### PR Checklist
|
||||
<!-- Check Yes if there is backend PR related to this UI PR, tag the backend owner's Github account -->
|
||||
### PR Checklists
|
||||
- Are backend engineers aware of UI changes ?
|
||||
- [ ] Yes, the backend owner is @
|
||||
- [ ] No, frontend-only.
|
||||
- [ ] Yes, the backend owner is:
|
||||
|
||||
### Related Issue #
|
||||
<!-- Link the issue as harvester/harvester#<issue_number> -->
|
||||
harvester/harvester#<issue_number>
|
||||
<!-- Define findings related to the feature or bug issue. -->
|
||||
|
||||
|
||||
### Test screenshot or video (Required)
|
||||
### Test screenshot or video
|
||||
<!-- Attach screenshot or video of the changes and eventual comparison if you find it necessary -->
|
||||
|
||||
|
||||
|
||||
@@ -6,11 +6,13 @@ on:
|
||||
- main
|
||||
- 'release-harvester-v*'
|
||||
- '*-dev'
|
||||
- forklift-poc
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
- 'release-harvester-v*'
|
||||
- '*-dev'
|
||||
- forklift-poc
|
||||
types:
|
||||
- merged
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
> This `./AGENTS.md` file is generated by running `yarn agents:generate`. `CLAUDE.md` and `GEMINI.md` are symlinks to this file so Claude Code, GitHub Copilot and Gemini all read the same content.
|
||||
> This `./AGENTS.md` file is generated by running `yarn agents:generate`.
|
||||
|
||||
|
||||
# Project Overview
|
||||
@@ -28,7 +28,9 @@ You are an expert Senior Software Engineer specializing in Vue.js and TypeScript
|
||||
- Run `yarn lint:fix` before commits.
|
||||
- Use conventional commit format:
|
||||
```
|
||||
<type>: <description>
|
||||
<type>:
|
||||
|
||||
<description>
|
||||
```
|
||||
- Follow existing naming conventions (PascalCase for components, camelCase for functions).
|
||||
- After changing a Vue, JS, or TS file, make sure it's automatically formatted with ESLint.
|
||||
@@ -128,8 +130,8 @@ To get started, follow the `Development Setup` section.
|
||||
- `Vue.js`:
|
||||
- Composition API components are preferred over Options API.
|
||||
- Large pages with lots of code and styles should be avoided by breaking the page up into smaller Vue components.
|
||||
- Order the Single File Component blocks as `<script>`, then `<template>`, then `<style>`.
|
||||
- The `<style>` tag should include `lang="scss" scoped`.
|
||||
- Place source tag above template above style.
|
||||
- style tag should contain `lang='scss' scoped`.
|
||||
- `Linting`: Follow the ESLint configuration in the root.
|
||||
|
||||
- **File Structure:**
|
||||
@@ -161,26 +163,24 @@ To get started, follow the `Development Setup` section.
|
||||
|
||||
## Harvester UI Extension Development Guide
|
||||
|
||||
### Backward Compatibility
|
||||
|
||||
The Harvester UI Extension supports earlier cluster versions (e.g., UI Ext v1.8.0 works with clusters v1.7.0 and v1.6.0). It uses Feature Flags defined in `pkg/harvester/config/` to ensure the UI matches the cluster's specific version.
|
||||
|
||||
### Implementation Steps for New Features
|
||||
1. Backward Compatibility
|
||||
The Harvester UI Extension supports earlier cluster versions (e.g., UI Ext v1.8.0 works with clusters v1.7.0 and v1.6.0). It uses Feature Flags defined in pkg/config/feature-flags to ensure the UI matches the cluster's specific version.
|
||||
|
||||
2. Implementation Steps for New Features
|
||||
To add a feature in a new release, follow these steps:
|
||||
|
||||
1. **Register**: Add a unique `[Feature Name]` to the corresponding release array in the configuration.
|
||||
2. **Check**: Use the following getter to verify if the feature is enabled for the current version:
|
||||
Register: Add a unique [Feature Name] to the corresponding release array in the configuration.
|
||||
|
||||
```js
|
||||
computed: {
|
||||
newFeatureEnabled() {
|
||||
return this.$store.getters['harvester-common/getFeatureEnabled']('[Feature Name]');
|
||||
},
|
||||
},
|
||||
```
|
||||
Check: Use the following getter to verify if the feature is enabled for the current version:
|
||||
|
||||
3. **Render**: Use the result of the check to conditionally render the UI components.
|
||||
```
|
||||
computed: {
|
||||
newFeatureEnabled() {
|
||||
return this.$store.getters['harvester-common/getFeatureEnabled']('[Feature Name]');
|
||||
},
|
||||
},
|
||||
```
|
||||
Render: Use the result of the check to conditionally render the UI components.
|
||||
|
||||
|
||||
## E2E Tests (Cypress)
|
||||
@@ -228,7 +228,7 @@ For the Renovate config, see `.github/renovate.json`.
|
||||
### Commit Message Format
|
||||
All commit messages must follow the conventional commit format:
|
||||
```
|
||||
<type>: <description>
|
||||
<type>[optional scope]: <description>
|
||||
|
||||
[optional body]
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ For Harvester UI extension installation instructions, please refer to the page *
|
||||
|
||||
## Development Setup
|
||||
|
||||
Ensure **Node.js v24 or later** is installed for development and debugging.
|
||||
Ensure **Node.js v20 or later** is installed for development and debugging.
|
||||
|
||||
### Standalone Mode
|
||||
|
||||
|
||||
@@ -32,7 +32,6 @@ module.exports = {
|
||||
'subject-empty': [2, 'never'],
|
||||
'subject-full-stop': [2, 'never', '.'],
|
||||
'subject-max-length': [0, 'never'],
|
||||
'header-max-length': [0, 'always', 100],
|
||||
'body-leading-blank': [2, 'always'],
|
||||
'body-max-line-length': [0, 'always', 100],
|
||||
'footer-leading-blank': [2, 'always'],
|
||||
|
||||
@@ -6,7 +6,9 @@
|
||||
- Run `yarn lint:fix` before commits.
|
||||
- Use conventional commit format:
|
||||
```
|
||||
<type>: <description>
|
||||
<type>:
|
||||
|
||||
<description>
|
||||
```
|
||||
- Follow existing naming conventions (PascalCase for components, camelCase for functions).
|
||||
- After changing a Vue, JS, or TS file, make sure it's automatically formatted with ESLint.
|
||||
|
||||
@@ -16,8 +16,8 @@ To get started, follow the `Development Setup` section.
|
||||
- `Vue.js`:
|
||||
- Composition API components are preferred over Options API.
|
||||
- Large pages with lots of code and styles should be avoided by breaking the page up into smaller Vue components.
|
||||
- Order the Single File Component blocks as `<script>`, then `<template>`, then `<style>`.
|
||||
- The `<style>` tag should include `lang="scss" scoped`.
|
||||
- Place source tag above template above style.
|
||||
- style tag should contain `lang='scss' scoped`.
|
||||
- `Linting`: Follow the ESLint configuration in the root.
|
||||
|
||||
- **File Structure:**
|
||||
@@ -49,24 +49,22 @@ To get started, follow the `Development Setup` section.
|
||||
|
||||
## Harvester UI Extension Development Guide
|
||||
|
||||
### Backward Compatibility
|
||||
|
||||
The Harvester UI Extension supports earlier cluster versions (e.g., UI Ext v1.8.0 works with clusters v1.7.0 and v1.6.0). It uses Feature Flags defined in `pkg/harvester/config/` to ensure the UI matches the cluster's specific version.
|
||||
|
||||
### Implementation Steps for New Features
|
||||
1. Backward Compatibility
|
||||
The Harvester UI Extension supports earlier cluster versions (e.g., UI Ext v1.8.0 works with clusters v1.7.0 and v1.6.0). It uses Feature Flags defined in pkg/config/feature-flags to ensure the UI matches the cluster's specific version.
|
||||
|
||||
2. Implementation Steps for New Features
|
||||
To add a feature in a new release, follow these steps:
|
||||
|
||||
1. **Register**: Add a unique `[Feature Name]` to the corresponding release array in the configuration.
|
||||
2. **Check**: Use the following getter to verify if the feature is enabled for the current version:
|
||||
Register: Add a unique [Feature Name] to the corresponding release array in the configuration.
|
||||
|
||||
```js
|
||||
computed: {
|
||||
newFeatureEnabled() {
|
||||
return this.$store.getters['harvester-common/getFeatureEnabled']('[Feature Name]');
|
||||
},
|
||||
},
|
||||
```
|
||||
Check: Use the following getter to verify if the feature is enabled for the current version:
|
||||
|
||||
3. **Render**: Use the result of the check to conditionally render the UI components.
|
||||
```
|
||||
computed: {
|
||||
newFeatureEnabled() {
|
||||
return this.$store.getters['harvester-common/getFeatureEnabled']('[Feature Name]');
|
||||
},
|
||||
},
|
||||
```
|
||||
Render: Use the result of the check to conditionally render the UI components.
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
### Commit Message Format
|
||||
All commit messages must follow the conventional commit format:
|
||||
```
|
||||
<type>: <description>
|
||||
<type>[optional scope]: <description>
|
||||
|
||||
[optional body]
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
> This `./AGENTS.md` file is generated by running `yarn agents:generate`. `CLAUDE.md` and `GEMINI.md` are symlinks to this file so Claude Code, GitHub Copilot and Gemini all read the same content.
|
||||
> This `./AGENTS.md` file is generated by running `yarn agents:generate`.
|
||||
|
||||
|
||||
# Project Overview
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "harvester-ui-extension",
|
||||
"version": "1.9.0-rc3",
|
||||
"version": "1.9.0-dev",
|
||||
"private": false,
|
||||
"engines": {
|
||||
"node": ">=24.0.0"
|
||||
@@ -21,7 +21,7 @@
|
||||
"yaml": "^2.5.1"
|
||||
},
|
||||
"resolutions": {
|
||||
"@types/node": "25.9.5",
|
||||
"@types/node": "25.9.4",
|
||||
"cronstrue": "2.59.0",
|
||||
"d3-color": "3.1.0",
|
||||
"ejs": "3.1.10",
|
||||
|
||||
@@ -55,12 +55,8 @@ export default {
|
||||
!this.latestUpgrade.isUpgradeFailed;
|
||||
},
|
||||
|
||||
canUpgrade() {
|
||||
return this.versionOptions.length > 0 && !this.isUpgradeInProgress;
|
||||
},
|
||||
|
||||
versionOptions() {
|
||||
const versions = this.$store.getters['harvester/all'](HCI.VERSION) || [];
|
||||
const versions = this.$store.getters['harvester/all'](HCI.VERSION);
|
||||
|
||||
return versions.map((V) => V.metadata.name);
|
||||
},
|
||||
@@ -158,23 +154,14 @@ export default {
|
||||
:cluster="currentCluster.nameDisplay"
|
||||
/>
|
||||
</h1>
|
||||
<span
|
||||
v-clean-tooltip="{
|
||||
content: canUpgrade ? t('harvester.upgradePage.upgradeAvailable') : t('harvester.upgradePage.upgradeUnavailable'),
|
||||
triggers: ['hover', 'focus', 'touch'],
|
||||
}"
|
||||
class="upgrade-btn-wrap"
|
||||
:tabindex="canUpgrade ? -1 : 0"
|
||||
<button
|
||||
v-if="versionOptions.length && !isUpgradeInProgress"
|
||||
type="button"
|
||||
class="btn bg-warning btn-sm"
|
||||
@click="open"
|
||||
>
|
||||
<button
|
||||
:disabled="!canUpgrade"
|
||||
type="button"
|
||||
class="btn bg-warning btn-sm"
|
||||
@click="open"
|
||||
>
|
||||
<t k="harvester.upgradePage.upgrade" />
|
||||
</button>
|
||||
</span>
|
||||
<t k="harvester.upgradePage.upgrade" />
|
||||
</button>
|
||||
</header>
|
||||
|
||||
<ModalWithCard
|
||||
@@ -309,18 +296,6 @@ export default {
|
||||
line-height: 23px;
|
||||
}
|
||||
|
||||
.upgrade-btn-wrap {
|
||||
display: inline-flex;
|
||||
|
||||
button {
|
||||
color: #000 !important;
|
||||
}
|
||||
|
||||
button:hover {
|
||||
color: #000 !important;
|
||||
}
|
||||
}
|
||||
|
||||
.currentVersion {
|
||||
margin-top: 10px;
|
||||
display: flex;
|
||||
|
||||
@@ -9,7 +9,6 @@ import { randomStr } from '@shell/utils/string';
|
||||
import { HCI } from '../../types';
|
||||
import { FORKLIFT_NAMESPACE } from '../../config/harvester-map';
|
||||
import { buildNetworkMapEntries, buildStorageMapEntries } from '../../utils/forklift';
|
||||
import { isInternalStorageClass } from '../../utils/storage-class';
|
||||
import MappingColumn from './MappingColumn.vue';
|
||||
|
||||
const props = defineProps({
|
||||
@@ -57,22 +56,10 @@ const harvesterNetworkOptions = computed(() => {
|
||||
});
|
||||
|
||||
const storageClassOptions = computed(() => {
|
||||
const options = storageClasses.value.filter((s) => !s.parameters?.backingImage).map((sc) => {
|
||||
const value = sc.name;
|
||||
let label = sc.isDefault ? `${ value } (${ t('generic.default') })` : value;
|
||||
let disabled = false;
|
||||
|
||||
if (isInternalStorageClass(value)) {
|
||||
label += ` (${ t('harvester.storage.internal.label') })`;
|
||||
disabled = true;
|
||||
}
|
||||
|
||||
return {
|
||||
label,
|
||||
value,
|
||||
disabled,
|
||||
};
|
||||
});
|
||||
const options = storageClasses.value.map((sc) => ({
|
||||
label: sc.metadata?.name || sc.id,
|
||||
value: sc.metadata?.name || sc.id,
|
||||
}));
|
||||
|
||||
if (!options.find((o) => o.value === 'harvester-longhorn')) {
|
||||
options.unshift({ label: 'harvester-longhorn', value: 'harvester-longhorn' });
|
||||
|
||||
@@ -402,7 +402,6 @@ defineExpose({ testConnection, clickTestButton });
|
||||
<div v-if="!createOnly && !editMode">
|
||||
<LabeledSelect
|
||||
v-model:value="selectedProvider"
|
||||
required
|
||||
:label="t('harvester.addons.vmMigration.configureProvider.providerSelect')"
|
||||
:options="providerOptions"
|
||||
:reduce="(opt) => opt.value"
|
||||
|
||||
@@ -5,10 +5,8 @@ import Loading from '@shell/components/Loading';
|
||||
import { Banner } from '@components/Banner';
|
||||
import { RcItemCard } from '@components/RcItemCard';
|
||||
import { LabeledInput } from '@components/Form/LabeledInput';
|
||||
import LabeledSelect from '@shell/components/form/LabeledSelect';
|
||||
import MappingsCell from '../MappingsCell';
|
||||
import { useI18n } from '@shell/composables/useI18n';
|
||||
import { NAMESPACE } from '@shell/config/types';
|
||||
import { HCI } from '../../types';
|
||||
import { FORKLIFT_NAMESPACE } from '../../config/harvester-map';
|
||||
import {
|
||||
@@ -32,41 +30,20 @@ const vms = ref([]);
|
||||
const networkMappings = ref([]);
|
||||
const storageMappings = ref([]);
|
||||
const planName = ref('');
|
||||
const targetNamespace = ref('');
|
||||
const namespaceOptions = ref([]);
|
||||
const errors = ref([]);
|
||||
const loading = ref(true);
|
||||
|
||||
// Restore persisted state
|
||||
planName.value = props.stepData.planName;
|
||||
targetNamespace.value = props.stepData.targetNamespace || '';
|
||||
|
||||
const NS = FORKLIFT_NAMESPACE;
|
||||
const NAMESPACE = FORKLIFT_NAMESPACE;
|
||||
const TARGET_NAMESPACE = 'default';
|
||||
|
||||
watch(planName, (val) => {
|
||||
props.stepData.planName = val;
|
||||
emit('ready', !!val);
|
||||
}, { immediate: true });
|
||||
|
||||
watch(targetNamespace, (val) => {
|
||||
props.stepData.targetNamespace = val;
|
||||
});
|
||||
|
||||
watch([planName, targetNamespace], ([name, namespace]) => {
|
||||
emit('ready', !!name && !!namespace);
|
||||
}, { immediate: true });
|
||||
|
||||
const formatNetworkTarget = (target = '') => {
|
||||
if (target === 'pod') {
|
||||
return t('harvester.addons.vmMigration.configureMappings.networkMapping.options.podNetworking');
|
||||
}
|
||||
|
||||
if (target === 'ignored') {
|
||||
return t('harvester.addons.vmMigration.generic.ignored');
|
||||
}
|
||||
|
||||
return target;
|
||||
};
|
||||
|
||||
const totalVCpu = computed(() => vms.value.reduce((sum, vm) => sum + (vm.cpuCount || vm.numCPU || 0), 0));
|
||||
|
||||
const totalMemoryGB = computed(() => {
|
||||
@@ -126,13 +103,13 @@ const startMigrationAction = async() => {
|
||||
apiVersion: FORKLIFT_API_VERSION,
|
||||
kind: 'Provider',
|
||||
name: props.providerName,
|
||||
namespace: NS,
|
||||
namespace: NAMESPACE,
|
||||
},
|
||||
destination: {
|
||||
apiVersion: FORKLIFT_API_VERSION,
|
||||
kind: 'Provider',
|
||||
name: 'host',
|
||||
namespace: NS,
|
||||
namespace: NAMESPACE,
|
||||
},
|
||||
};
|
||||
|
||||
@@ -141,15 +118,15 @@ const startMigrationAction = async() => {
|
||||
|
||||
const networkMap = await store.dispatch(`${ inStore }/create`, {
|
||||
type: HCI.FORKLIFT_NETWORK_MAP,
|
||||
metadata: { name: networkMapName, namespace: NS },
|
||||
spec: { map: buildNetworkMapEntries(props.mappingEntries?.networkEntries || [], NS), provider: providerRef },
|
||||
metadata: { name: networkMapName, namespace: NAMESPACE },
|
||||
spec: { map: buildNetworkMapEntries(props.mappingEntries?.networkEntries || [], NAMESPACE), provider: providerRef },
|
||||
});
|
||||
|
||||
await networkMap.save();
|
||||
|
||||
const storageMap = await store.dispatch(`${ inStore }/create`, {
|
||||
type: HCI.FORKLIFT_STORAGE_MAP,
|
||||
metadata: { name: storageMapName, namespace: NS },
|
||||
metadata: { name: storageMapName, namespace: NAMESPACE },
|
||||
spec: { map: buildStorageMapEntries(props.mappingEntries?.storageEntries || []), provider: providerRef },
|
||||
});
|
||||
|
||||
@@ -157,7 +134,7 @@ const startMigrationAction = async() => {
|
||||
|
||||
const plan = await store.dispatch(`${ inStore }/create`, {
|
||||
type: HCI.FORKLIFT_PLAN,
|
||||
metadata: { name: planName.value, namespace: NS },
|
||||
metadata: { name: planName.value, namespace: NAMESPACE },
|
||||
spec: {
|
||||
provider: providerRef,
|
||||
map: {
|
||||
@@ -165,16 +142,16 @@ const startMigrationAction = async() => {
|
||||
apiVersion: FORKLIFT_API_VERSION,
|
||||
kind: 'NetworkMap',
|
||||
name: networkMapName,
|
||||
namespace: NS,
|
||||
namespace: NAMESPACE,
|
||||
},
|
||||
storage: {
|
||||
apiVersion: FORKLIFT_API_VERSION,
|
||||
kind: 'StorageMap',
|
||||
name: storageMapName,
|
||||
namespace: NS,
|
||||
namespace: NAMESPACE,
|
||||
},
|
||||
},
|
||||
targetNamespace: targetNamespace.value,
|
||||
targetNamespace: TARGET_NAMESPACE,
|
||||
vms: vms.value.map((vm) => ({ id: vm.id, name: vm.name || vm.id })),
|
||||
warm: false,
|
||||
},
|
||||
@@ -200,19 +177,9 @@ const startMigrationAction = async() => {
|
||||
await plan.startMigration();
|
||||
};
|
||||
|
||||
const init = async() => {
|
||||
const init = () => {
|
||||
vms.value = props.selectedVms;
|
||||
|
||||
const inStore = store.getters['currentProduct'].inStore;
|
||||
|
||||
try {
|
||||
const namespaces = await store.dispatch(`${ inStore }/findAll`, { type: NAMESPACE });
|
||||
|
||||
namespaceOptions.value = namespaces.filter((ns) => !ns.isSystem).map((ns) => ns.metadata.name).sort().map((name) => ({ label: name, value: name }));
|
||||
} catch (e) {
|
||||
namespaceOptions.value = [];
|
||||
}
|
||||
|
||||
if (props.mappingEntries) {
|
||||
networkMappings.value = (props.mappingEntries.networkEntries || []).map((entry) => ({
|
||||
source: entry.name || entry.id,
|
||||
@@ -249,18 +216,9 @@ defineExpose({ startMigration: startMigrationAction });
|
||||
<h3 class="section-title m-0">
|
||||
{{ t('harvester.addons.vmMigration.reviewMigration.migrationDetails') }}
|
||||
</h3>
|
||||
<div class="name-row">
|
||||
<LabeledSelect
|
||||
v-model:value="targetNamespace"
|
||||
class="namespace-select"
|
||||
:label="t('harvester.addons.vmMigration.reviewMigration.targetNamespace')"
|
||||
:placeholder="t('harvester.addons.vmMigration.reviewMigration.targetNamespacePlaceholder')"
|
||||
:options="namespaceOptions"
|
||||
required
|
||||
/>
|
||||
<div class="span-9">
|
||||
<LabeledInput
|
||||
v-model:value="planName"
|
||||
class="name-input"
|
||||
:label="t('harvester.addons.vmMigration.reviewMigration.planName')"
|
||||
:placeholder="t('harvester.addons.vmMigration.reviewMigration.planNamePlaceholder')"
|
||||
required
|
||||
@@ -286,7 +244,7 @@ defineExpose({ startMigration: startMigrationAction });
|
||||
<span class="detail-label">{{ t('harvester.addons.vmMigration.reviewMigration.targetNamespace') }}</span>
|
||||
</div>
|
||||
<div class="detail-item">
|
||||
<span class="detail-value">{{ targetNamespace }}</span>
|
||||
<span class="detail-value">{{ TARGET_NAMESPACE }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="detail-column">
|
||||
@@ -343,7 +301,7 @@ defineExpose({ startMigration: startMigrationAction });
|
||||
</span>
|
||||
</div>
|
||||
<MappingsCell
|
||||
:network-entries="vm.networkMappings.map(m => `${m.source} → ${formatNetworkTarget(m.target)}`)"
|
||||
:network-entries="vm.networkMappings.map(m => `${m.source} → ${m.target}`)"
|
||||
:storage-entries="vm.storageMappings.map(m => `${m.source} → ${m.target}`)"
|
||||
/>
|
||||
</div>
|
||||
@@ -389,22 +347,6 @@ defineExpose({ startMigration: startMigrationAction });
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.name-row {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: flex-start;
|
||||
gap: 12px;
|
||||
|
||||
.namespace-select {
|
||||
max-width: 280px;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.name-input {
|
||||
flex: 1;
|
||||
}
|
||||
}
|
||||
|
||||
.details-grid {
|
||||
display: grid;
|
||||
grid-template-columns: minmax(230px, 1fr) 1fr 1fr;
|
||||
|
||||
@@ -107,21 +107,18 @@ const headers = [
|
||||
labelKey: 'harvester.addons.vmMigration.selectVms.columns.os',
|
||||
value: 'os',
|
||||
sort: ['os'],
|
||||
width: 180,
|
||||
},
|
||||
{
|
||||
name: 'resources',
|
||||
labelKey: 'harvester.addons.vmMigration.selectVms.columns.resources',
|
||||
value: 'resources',
|
||||
sort: false,
|
||||
width: 140,
|
||||
},
|
||||
{
|
||||
name: 'powerState',
|
||||
labelKey: 'harvester.addons.vmMigration.selectVms.columns.powerState',
|
||||
value: 'powerState',
|
||||
sort: ['powerState'],
|
||||
width: 130,
|
||||
},
|
||||
{
|
||||
name: 'network',
|
||||
@@ -129,7 +126,6 @@ const headers = [
|
||||
value: 'network',
|
||||
sort: ['network'],
|
||||
subLabel: t('harvester.addons.vmMigration.generic.identifier'),
|
||||
width: 200,
|
||||
},
|
||||
{
|
||||
name: 'datastore',
|
||||
@@ -137,7 +133,6 @@ const headers = [
|
||||
value: 'datastore',
|
||||
sort: ['datastore'],
|
||||
subLabel: t('harvester.addons.vmMigration.generic.identifier'),
|
||||
width: 200,
|
||||
},
|
||||
];
|
||||
|
||||
|
||||
@@ -73,9 +73,7 @@ const FEATURE_FLAGS = {
|
||||
'supportFilesystem',
|
||||
'disableResourcePooling',
|
||||
'expandOnlineEncryptedVolume',
|
||||
'longhornV2HugepageSettings',
|
||||
'staticIPForVM',
|
||||
'fsFreezeDeadline',
|
||||
'longhornV2HugepageSettings'
|
||||
],
|
||||
};
|
||||
|
||||
|
||||
@@ -1378,7 +1378,7 @@ export function init($plugin, store) {
|
||||
virtualType({
|
||||
name: HCI.FORKLIFT_NETWORK_MAP,
|
||||
labelKey: 'harvester.addons.vmMigration.labels.networkMap',
|
||||
group: 'vmMigration::Configurations',
|
||||
group: 'vmMigration::Advanced',
|
||||
namespaced: true,
|
||||
route: {
|
||||
name: `${ PRODUCT_NAME }-c-cluster-resource`,
|
||||
@@ -1405,7 +1405,7 @@ export function init($plugin, store) {
|
||||
virtualType({
|
||||
name: HCI.FORKLIFT_STORAGE_MAP,
|
||||
labelKey: 'harvester.addons.vmMigration.labels.storageMap',
|
||||
group: 'vmMigration::Configurations',
|
||||
group: 'vmMigration::Advanced',
|
||||
namespaced: true,
|
||||
route: {
|
||||
name: `${ PRODUCT_NAME }-c-cluster-resource`,
|
||||
@@ -1433,7 +1433,7 @@ export function init($plugin, store) {
|
||||
virtualType({
|
||||
name: HCI.FORKLIFT_PLAN,
|
||||
labelKey: 'harvester.addons.vmMigration.labels.plan',
|
||||
group: 'vmMigration::Configurations',
|
||||
group: 'vmMigration::Advanced',
|
||||
namespaced: true,
|
||||
route: {
|
||||
name: `${ PRODUCT_NAME }-c-cluster-resource`,
|
||||
@@ -1459,7 +1459,7 @@ export function init($plugin, store) {
|
||||
virtualType({
|
||||
name: HCI.FORKLIFT_MIGRATION,
|
||||
labelKey: 'harvester.addons.vmMigration.labels.migration',
|
||||
group: 'vmMigration::Configurations',
|
||||
group: 'vmMigration::Advanced',
|
||||
namespaced: true,
|
||||
route: {
|
||||
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
|
||||
// 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,
|
||||
@@ -1500,7 +1495,7 @@ export function init($plugin, store) {
|
||||
registerAddonSideNav(store, PRODUCT_NAME, {
|
||||
addonName: ADD_ONS.FORKLIFT_OPERATOR,
|
||||
resourceType: HCI.ADD_ONS,
|
||||
navGroup: 'vmMigration::Configurations',
|
||||
navGroup: 'vmMigration::Advanced',
|
||||
types: [
|
||||
HCI.FORKLIFT_NETWORK_MAP,
|
||||
HCI.FORKLIFT_STORAGE_MAP,
|
||||
|
||||
@@ -16,7 +16,6 @@ export const HCI = {
|
||||
CREATOR: 'harvesterhci.io/creator',
|
||||
OS: 'harvesterhci.io/os',
|
||||
GOLDEN_IMAGE: 'harvesterhci.io/goldenImage',
|
||||
CLUSTER_NETWORK: 'network.harvesterhci.io/clusternetwork',
|
||||
NETWORK_TYPE: 'network.harvesterhci.io/type',
|
||||
VM_NAME: 'harvesterhci.io/vmName',
|
||||
VM_NAME_PREFIX: 'harvesterhci.io/vmNamePrefix',
|
||||
@@ -81,10 +80,8 @@ export const HCI = {
|
||||
VOLUME_MODE_ACCESS_MODES: 'cdi.harvesterhci.io/storageProfileVolumeModeAccessModes',
|
||||
VOLUME_SNAPSHOT_CLASS: 'cdi.harvesterhci.io/storageProfileVolumeSnapshotClass',
|
||||
MAC_ADDRESS: 'harvesterhci.io/mac-address',
|
||||
STATIC_IP: 'static-ip.harvesterhci.io',
|
||||
NODE_UPGRADE_PAUSE_MAP: 'harvesterhci.io/node-upgrade-pause-map',
|
||||
CDI_POPULATOR_KIND: 'cdi.kubevirt.io/storage.populator.kind',
|
||||
CNI_NETWORKS: 'k8s.v1.cni.cncf.io/networks',
|
||||
WINDOWS_SYSPREP: 'harvesterhci.io/windows-sysprep',
|
||||
SKIP_MIG_CONFIGURATION: 'harvesterhci.io/skip-mig-configuration',
|
||||
};
|
||||
|
||||
@@ -286,7 +286,7 @@ export const FORKLIFT_PLAN_VM_COUNT = {
|
||||
labelKey: 'harvester.tableHeaders.vmMigrationPlanVmCount',
|
||||
value: 'spec.vms.length',
|
||||
sort: 'spec.vms.length',
|
||||
align: 'center',
|
||||
align: 'left',
|
||||
};
|
||||
|
||||
// Plan reference column in forklift.konveyor.io.migration list page
|
||||
|
||||
@@ -7,7 +7,6 @@ import { MiniMap } from '@vue-flow/minimap';
|
||||
import { allHash } from '@shell/utils/promise';
|
||||
import { NETWORK_ATTACHMENT } from '@shell/config/types';
|
||||
import Checkbox from '@components/Form/Checkbox/Checkbox.vue';
|
||||
import { HCI as HCI_ANNOTATIONS } from '@pkg/harvester/config/labels-annotations';
|
||||
import { HCI } from '../types';
|
||||
import { NETWORK_TYPE } from '../config/types';
|
||||
|
||||
@@ -455,10 +454,10 @@ export default {
|
||||
const overlayName = nad?.parseConfig?.name || nad?.metadata?.name;
|
||||
|
||||
const clusterNetwork =
|
||||
nad?.metadata?.labels?.[HCI_ANNOTATIONS.CLUSTER_NETWORK] || 'mgmt';
|
||||
nad?.metadata?.labels?.[HCI.CLUSTER_NETWORK] || 'mgmt';
|
||||
|
||||
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 }`;
|
||||
|
||||
nodes.push({
|
||||
|
||||
@@ -1,133 +0,0 @@
|
||||
<script>
|
||||
import { mapGetters } from 'vuex';
|
||||
import { Card } from '@components/Card';
|
||||
import AsyncButton from '@shell/components/AsyncButton';
|
||||
import { Checkbox } from '@components/Form/Checkbox';
|
||||
import { escapeHtml } from '@shell/utils/string';
|
||||
import { HCI as HCI_ANNOTATIONS } from '@pkg/harvester/config/labels-annotations';
|
||||
|
||||
export default {
|
||||
name: 'HarvesterEnableSriovGpuDevice',
|
||||
|
||||
emits: ['close'],
|
||||
|
||||
components: {
|
||||
AsyncButton,
|
||||
Card,
|
||||
Checkbox,
|
||||
},
|
||||
|
||||
props: {
|
||||
resources: {
|
||||
type: Array,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
|
||||
data() {
|
||||
return { skipMigConfiguration: this.resources[0]?.metadata?.annotations?.[HCI_ANNOTATIONS.SKIP_MIG_CONFIGURATION] === 'true' };
|
||||
},
|
||||
|
||||
computed: { ...mapGetters({ t: 'i18n/t' }) },
|
||||
|
||||
methods: {
|
||||
close() {
|
||||
this.$emit('close');
|
||||
},
|
||||
|
||||
async save(buttonCb) {
|
||||
const actionResource = this.resources[0];
|
||||
const prevEnabled = actionResource.spec.enabled;
|
||||
const prevAnnotation = actionResource.metadata.annotations?.[HCI_ANNOTATIONS.SKIP_MIG_CONFIGURATION];
|
||||
|
||||
try {
|
||||
if (this.skipMigConfiguration) {
|
||||
if (!actionResource.metadata.annotations) {
|
||||
actionResource.metadata.annotations = {};
|
||||
}
|
||||
actionResource.metadata.annotations[HCI_ANNOTATIONS.SKIP_MIG_CONFIGURATION] = 'true';
|
||||
} else {
|
||||
if (actionResource.metadata.annotations) {
|
||||
delete actionResource.metadata.annotations[HCI_ANNOTATIONS.SKIP_MIG_CONFIGURATION];
|
||||
}
|
||||
}
|
||||
|
||||
actionResource.spec.enabled = true;
|
||||
await actionResource.save();
|
||||
buttonCb(true);
|
||||
this.close();
|
||||
} catch (err) {
|
||||
actionResource.spec.enabled = prevEnabled;
|
||||
if (prevAnnotation !== undefined) {
|
||||
actionResource.metadata.annotations[HCI_ANNOTATIONS.SKIP_MIG_CONFIGURATION] = prevAnnotation;
|
||||
} else if (actionResource.metadata.annotations) {
|
||||
delete actionResource.metadata.annotations[HCI_ANNOTATIONS.SKIP_MIG_CONFIGURATION];
|
||||
}
|
||||
|
||||
this.$store.dispatch('growl/fromError', {
|
||||
title: this.t('generic.notification.title.error', { name: escapeHtml(actionResource.metadata.name) }),
|
||||
err,
|
||||
}, { root: true });
|
||||
buttonCb(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Card :show-highlight-border="false">
|
||||
<template #title>
|
||||
<h4
|
||||
v-clean-html="t('harvester.sriovgpu.enable.title')"
|
||||
class="text-default-text"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<template #body>
|
||||
<div class="body">
|
||||
<Checkbox
|
||||
v-model:value="skipMigConfiguration"
|
||||
:label="t('harvester.sriovgpu.enable.skipMigConfiguration')"
|
||||
/>
|
||||
<p class="note mt-10">
|
||||
{{ t('harvester.sriovgpu.enable.note') }}
|
||||
</p>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<template #actions>
|
||||
<div class="buttons actions">
|
||||
<button
|
||||
class="btn role-secondary mr-10"
|
||||
@click="close"
|
||||
>
|
||||
{{ t('generic.cancel') }}
|
||||
</button>
|
||||
|
||||
<AsyncButton
|
||||
mode="enable"
|
||||
@click="save"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
</Card>
|
||||
</template>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.actions {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.buttons {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.note {
|
||||
font-size: 12px;
|
||||
color: var(--muted);
|
||||
line-height: 1.5;
|
||||
}
|
||||
</style>
|
||||
@@ -5,8 +5,6 @@ import { Card } from '@components/Card';
|
||||
import { Banner } from '@components/Banner';
|
||||
import AsyncButton from '@shell/components/AsyncButton';
|
||||
import { LabeledInput } from '@components/Form/LabeledInput';
|
||||
import LabeledSelect from '@shell/components/form/LabeledSelect';
|
||||
import { DEFAULT_FS_FREEZE_DEADLINE, getFsFreezeDeadlineOptions } from '../utils/backup';
|
||||
|
||||
export default {
|
||||
name: 'HarvesterBackupModal',
|
||||
@@ -17,7 +15,6 @@ export default {
|
||||
AsyncButton,
|
||||
Card,
|
||||
LabeledInput,
|
||||
LabeledSelect,
|
||||
Banner
|
||||
},
|
||||
|
||||
@@ -30,9 +27,8 @@ export default {
|
||||
|
||||
data() {
|
||||
return {
|
||||
backUpName: '',
|
||||
errors: [],
|
||||
fsFreezeDeadline: DEFAULT_FS_FREEZE_DEADLINE
|
||||
backUpName: '',
|
||||
errors: []
|
||||
};
|
||||
},
|
||||
|
||||
@@ -41,22 +37,12 @@ export default {
|
||||
|
||||
actionResource() {
|
||||
return this.resources[0];
|
||||
},
|
||||
|
||||
fsFreezeDeadlineEnabled() {
|
||||
return this.$store.getters['harvester-common/getFeatureEnabled']('fsFreezeDeadline');
|
||||
},
|
||||
|
||||
fsFreezeDeadlineOptions() {
|
||||
return getFsFreezeDeadlineOptions(this.t);
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
close() {
|
||||
this.backUpName = '';
|
||||
this.fsFreezeDeadline = DEFAULT_FS_FREEZE_DEADLINE;
|
||||
this.errors = [];
|
||||
this.$emit('close');
|
||||
},
|
||||
|
||||
@@ -65,7 +51,7 @@ export default {
|
||||
try {
|
||||
const res = await this.actionResource.doAction(
|
||||
'backup',
|
||||
{ name: this.backUpName, fsFreezeDeadline: this.fsFreezeDeadline },
|
||||
{ name: this.backUpName },
|
||||
{},
|
||||
false
|
||||
);
|
||||
@@ -114,18 +100,9 @@ export default {
|
||||
<template #body>
|
||||
<LabeledInput
|
||||
v-model:value="backUpName"
|
||||
class="mt-20"
|
||||
:label="t('generic.name')"
|
||||
required
|
||||
/>
|
||||
<LabeledSelect
|
||||
v-if="fsFreezeDeadlineEnabled"
|
||||
v-model:value="fsFreezeDeadline"
|
||||
class="mt-20"
|
||||
:options="fsFreezeDeadlineOptions"
|
||||
:label="t('harvester.modal.backup.fileSystemFreezeDeadline.label')"
|
||||
required
|
||||
/>
|
||||
<Banner
|
||||
v-for="(err, i) in errors"
|
||||
:key="i"
|
||||
|
||||
@@ -5,10 +5,8 @@ import { Card } from '@components/Card';
|
||||
import { Banner } from '@components/Banner';
|
||||
import AsyncButton from '@shell/components/AsyncButton';
|
||||
import { LabeledInput } from '@components/Form/LabeledInput';
|
||||
import LabeledSelect from '@shell/components/form/LabeledSelect';
|
||||
import { HCI } from '../types';
|
||||
import { BACKUP_TYPE } from '../config/types';
|
||||
import { DEFAULT_FS_FREEZE_DEADLINE, getFsFreezeDeadlineOptions } from '../utils/backup';
|
||||
|
||||
export default {
|
||||
name: 'HarvesterVMSnapshotDialog',
|
||||
@@ -19,7 +17,6 @@ export default {
|
||||
AsyncButton,
|
||||
Card,
|
||||
LabeledInput,
|
||||
LabeledSelect,
|
||||
Banner
|
||||
},
|
||||
|
||||
@@ -34,8 +31,7 @@ export default {
|
||||
return {
|
||||
snapshotName: '',
|
||||
snapshotNamespace: '',
|
||||
errors: [],
|
||||
fsFreezeDeadline: DEFAULT_FS_FREEZE_DEADLINE
|
||||
errors: []
|
||||
};
|
||||
},
|
||||
|
||||
@@ -44,23 +40,13 @@ export default {
|
||||
|
||||
actionResource() {
|
||||
return this.resources[0];
|
||||
},
|
||||
|
||||
fsFreezeDeadlineEnabled() {
|
||||
return this.$store.getters['harvester-common/getFeatureEnabled']('fsFreezeDeadline');
|
||||
},
|
||||
|
||||
fsFreezeDeadlineOptions() {
|
||||
return getFsFreezeDeadlineOptions(this.t);
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
close() {
|
||||
this.fsFreezeDeadline = DEFAULT_FS_FREEZE_DEADLINE;
|
||||
this.snapshotNamespace = '';
|
||||
this.snapshotName = '';
|
||||
this.errors = [];
|
||||
this.$emit('close');
|
||||
},
|
||||
|
||||
@@ -74,8 +60,7 @@ export default {
|
||||
ownerReferences: this.getOwnerReferencesFromVM(this.actionResource)
|
||||
},
|
||||
spec: {
|
||||
fsFreezeDeadline: this.fsFreezeDeadline,
|
||||
source: {
|
||||
source: {
|
||||
apiGroup: 'kubevirt.io',
|
||||
kind: 'VirtualMachine',
|
||||
name: this.actionResource.metadata.name
|
||||
@@ -147,14 +132,6 @@ export default {
|
||||
:label="t('generic.name')"
|
||||
required
|
||||
/>
|
||||
<LabeledSelect
|
||||
v-if="fsFreezeDeadlineEnabled"
|
||||
v-model:value="fsFreezeDeadline"
|
||||
class="mt-20"
|
||||
:options="fsFreezeDeadlineOptions"
|
||||
:label="t('harvester.modal.vmSnapshot.fileSystemFreezeDeadline.label')"
|
||||
required
|
||||
/>
|
||||
<Banner
|
||||
v-for="(err, i) in errors"
|
||||
:key="i"
|
||||
|
||||
@@ -468,15 +468,10 @@ export default {
|
||||
const size = formatSi(sizeBytes, { increment: 1024, suffix: UNIT_SUFFIX });
|
||||
const parentDevice = d.status?.deviceStatus?.parentDevice;
|
||||
const isChildAdded = this.newDisks.find((newDisk) => newDisk.blockDevice?.status?.deviceStatus?.parentDevice === devPath);
|
||||
const mountPoint = d.status?.deviceStatus?.fileSystem?.mountPoint;
|
||||
const name = d.displayName;
|
||||
|
||||
let label = `${ name } (Type: ${ deviceType }, Size: ${ size })`;
|
||||
|
||||
if (mountPoint) {
|
||||
label = `${ label } - ${ this.t('harvester.host.disk.mounted') }`;
|
||||
}
|
||||
|
||||
if (parentDevice) {
|
||||
label = `- ${ label }`;
|
||||
}
|
||||
@@ -486,7 +481,7 @@ export default {
|
||||
value: d.id,
|
||||
action: this.addDisk,
|
||||
kind: !parentDevice ? 'group' : '',
|
||||
disabled: !!isChildAdded || !!mountPoint,
|
||||
disabled: !!isChildAdded,
|
||||
group: parentDevice || devPath,
|
||||
isParent: !!parentDevice,
|
||||
};
|
||||
|
||||
@@ -133,10 +133,6 @@ export default {
|
||||
}];
|
||||
|
||||
return this.isMasquerade ? masquerade : other;
|
||||
},
|
||||
|
||||
staticIPForVMEnabled() {
|
||||
return this.$store.getters['harvester-common/getFeatureEnabled']('staticIPForVM');
|
||||
}
|
||||
},
|
||||
|
||||
@@ -154,7 +150,6 @@ export default {
|
||||
isSingle(neu) {
|
||||
if (!neu) {
|
||||
this.value['macAddress'] = '';
|
||||
this.value['staticIp'] = '';
|
||||
this.update();
|
||||
}
|
||||
}
|
||||
@@ -168,7 +163,6 @@ export default {
|
||||
if (neu === MANAGEMENT_NETWORK) {
|
||||
this.value.isPod = true;
|
||||
this.value.macAddress = '';
|
||||
this.value.staticIp = '';
|
||||
} else {
|
||||
this.value.isPod = false;
|
||||
}
|
||||
@@ -295,30 +289,9 @@ export default {
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div
|
||||
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 class="row">
|
||||
<div
|
||||
v-if="showAdvanced"
|
||||
data-testid="input-hen-macAddress"
|
||||
class="col span-6"
|
||||
>
|
||||
|
||||
@@ -93,9 +93,6 @@ export default {
|
||||
|
||||
const hostname = this.value.spec.template.spec.hostname || '';
|
||||
|
||||
// Display name can contain arbitrary strings. There is no XSS risk because the value is
|
||||
// rendered via Vue's {{ }} interpolation which auto-escapes HTML; v-html is never used for
|
||||
// this field. See harvester/harvester#10423 for details.
|
||||
const customizeDisplayName = !!(this.value.metadata?.annotations?.[HCI_ANNOTATIONS.VM_DISPLAY_NAME]);
|
||||
|
||||
return {
|
||||
@@ -487,20 +484,6 @@ export default {
|
||||
await value.save();
|
||||
await this.applyHooks(AFTER_SAVE_HOOKS);
|
||||
} catch (e) {
|
||||
// Reset the generated secret name(s) so a retried create (e.g. after correcting an
|
||||
// invalid/duplicate VM name) always regenerates them from the current name instead of
|
||||
// reusing names derived from this failed attempt. Only do this for create: in edit mode
|
||||
// secretName/sysprep.secretName may reference an existing secret loaded from the VM,
|
||||
// which must not be discarded. See harvester/harvester#11174.
|
||||
if (this.isCreate) {
|
||||
this.secretName = '';
|
||||
this.secretNamePrefixUsed = '';
|
||||
if (this.sysprepSecretNamePrefixUsed !== '') {
|
||||
this.sysprep.secretName = '';
|
||||
this.sysprepSecretNamePrefixUsed = '';
|
||||
}
|
||||
}
|
||||
|
||||
this.errors.push(...exceptionToErrorsArray(e));
|
||||
buttonCb(false);
|
||||
}
|
||||
|
||||
@@ -283,9 +283,9 @@ export default {
|
||||
v-model:value.number="vlanID"
|
||||
type="number"
|
||||
required
|
||||
:min="1"
|
||||
:min="2"
|
||||
:max="4094"
|
||||
placeholder="e.g. 1 ~ 4094"
|
||||
placeholder="e.g. 2 ~ 4094"
|
||||
:label="t('harvester.hostNetworkConfig.vlanID.label')"
|
||||
:mode="mode"
|
||||
/>
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
<script>
|
||||
import PercentageBar from '@shell/components/PercentageBar';
|
||||
import ConsumptionGauge from '@shell/components/ConsumptionGauge';
|
||||
import { METRIC, NODE } from '@shell/config/types';
|
||||
import { parseSi } from '@shell/utils/units';
|
||||
|
||||
export default {
|
||||
name: 'HarvesterCpuUsed',
|
||||
components: { PercentageBar },
|
||||
components: { ConsumptionGauge },
|
||||
|
||||
props: {
|
||||
value: {
|
||||
@@ -74,89 +74,54 @@ export default {
|
||||
return 0;
|
||||
}
|
||||
},
|
||||
|
||||
reservedPercentage() {
|
||||
return this.cpuTotal ? (this.reserved * 100) / this.cpuTotal : 0;
|
||||
},
|
||||
|
||||
usedPercentage() {
|
||||
return this.cpuTotal ? (this.used * 100) / this.cpuTotal : 0;
|
||||
},
|
||||
|
||||
reservedAmountTemplateValues() {
|
||||
return {
|
||||
used: this.numberFormatter(this.reserved || 0),
|
||||
total: this.numberFormatter(this.cpuTotal || 0),
|
||||
unit: ` ${ this.cpuUnits }`,
|
||||
};
|
||||
},
|
||||
|
||||
usedAmountTemplateValues() {
|
||||
return {
|
||||
used: this.numberFormatter(this.used || 0),
|
||||
total: this.numberFormatter(this.cpuTotal || 0),
|
||||
unit: ` ${ this.cpuUnits }`,
|
||||
};
|
||||
},
|
||||
},
|
||||
|
||||
methods: {
|
||||
numberFormatter(value) {
|
||||
return Number.isInteger(value) ? value : value.toFixed(2);
|
||||
},
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<div class="consumption-gauge">
|
||||
<div class="numbers">
|
||||
<span class="mr-5">
|
||||
<ConsumptionGauge
|
||||
:capacity="cpuTotal"
|
||||
:used="reserved"
|
||||
:units="cpuUnits"
|
||||
:resource-name="resourceName"
|
||||
>
|
||||
<template #title="{amountTemplateValues, formattedPercentage}">
|
||||
<span>
|
||||
{{ t('harvester.formatters.hardwareResourceGauge.reserved') }}
|
||||
</span>
|
||||
<span class="precent-data">
|
||||
{{ t('node.detail.glance.consumptionGauge.amount', reservedAmountTemplateValues) }}
|
||||
{{ t('node.detail.glance.consumptionGauge.amount', amountTemplateValues) }}
|
||||
<span class="ml-10 percentage">/ {{ formattedPercentage }}
|
||||
</span>
|
||||
</span>
|
||||
</div>
|
||||
<div class="mt-10">
|
||||
<PercentageBar
|
||||
:model-value="reservedPercentage"
|
||||
show-percentage
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</ConsumptionGauge>
|
||||
<div
|
||||
v-if="showUsed"
|
||||
class="consumption-gauge mt-10"
|
||||
class="mt-10"
|
||||
>
|
||||
<div class="numbers">
|
||||
<span>
|
||||
{{ t('harvester.formatters.hardwareResourceGauge.used') }}
|
||||
</span>
|
||||
<span class="precent-data">
|
||||
{{ t('node.detail.glance.consumptionGauge.amount', usedAmountTemplateValues) }}
|
||||
</span>
|
||||
</div>
|
||||
<div class="mt-10">
|
||||
<PercentageBar
|
||||
:model-value="usedPercentage"
|
||||
show-percentage
|
||||
/>
|
||||
</div>
|
||||
<ConsumptionGauge
|
||||
:capacity="cpuTotal"
|
||||
:used="used"
|
||||
:units="cpuUnits"
|
||||
>
|
||||
<template #title="{amountTemplateValues, formattedPercentage}">
|
||||
<span>
|
||||
{{ t('harvester.formatters.hardwareResourceGauge.used') }}
|
||||
</span>
|
||||
<span class="precent-data">
|
||||
{{ t('node.detail.glance.consumptionGauge.amount', amountTemplateValues) }}
|
||||
<span class="ml-10 percentage">/ {{ formattedPercentage }}
|
||||
</span>
|
||||
</span>
|
||||
</template>
|
||||
</ConsumptionGauge>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.consumption-gauge {
|
||||
.numbers {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
}
|
||||
}
|
||||
|
||||
.precent-data {
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
@@ -36,10 +36,6 @@ export default {
|
||||
|
||||
computed: {
|
||||
ips() {
|
||||
if (this.staticAnnotationIP.length) {
|
||||
return this.staticAnnotationIP;
|
||||
}
|
||||
|
||||
if (this.vmiIp.length) {
|
||||
return [...this.vmiIp, ...this.networkAnnotationIP]
|
||||
.filter(Boolean)
|
||||
@@ -49,24 +45,6 @@ export default {
|
||||
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() {
|
||||
const annotationIp = get(this.row, `metadata.annotations."${ HCI_ANNOTATIONS.CUSTOM_IP }"`);
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
<script>
|
||||
import PercentageBar from '@shell/components/PercentageBar';
|
||||
import ConsumptionGauge from '@shell/components/ConsumptionGauge';
|
||||
import { METRIC, NODE } from '@shell/config/types';
|
||||
import { formatSi, exponentNeeded, UNITS, parseSi } from '@shell/utils/units';
|
||||
import { UNIT_SUFFIX } from '../utils/unit';
|
||||
export default {
|
||||
name: 'HarvesterMemoryUsed',
|
||||
components: { PercentageBar },
|
||||
components: { ConsumptionGauge },
|
||||
|
||||
props: {
|
||||
value: {
|
||||
@@ -76,30 +76,6 @@ export default {
|
||||
return 0;
|
||||
}
|
||||
},
|
||||
|
||||
reservedPercentage() {
|
||||
return this.memoryTotal ? (this.reserved * 100) / this.memoryTotal : 0;
|
||||
},
|
||||
|
||||
usedPercentage() {
|
||||
return this.memoryTotal ? (this.used * 100) / this.memoryTotal : 0;
|
||||
},
|
||||
|
||||
reservedAmountTemplateValues() {
|
||||
return {
|
||||
used: this.memoryFormatter(this.reserved || 0),
|
||||
total: this.memoryFormatter(this.memoryTotal || 0),
|
||||
unit: ` ${ this.memoryUnits }`,
|
||||
};
|
||||
},
|
||||
|
||||
usedAmountTemplateValues() {
|
||||
return {
|
||||
used: this.memoryFormatter(this.used || 0),
|
||||
total: this.memoryFormatter(this.memoryTotal || 0),
|
||||
unit: ` ${ this.memoryUnits }`,
|
||||
};
|
||||
},
|
||||
},
|
||||
|
||||
methods: {
|
||||
@@ -120,53 +96,50 @@ export default {
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<div class="consumption-gauge">
|
||||
<div class="numbers">
|
||||
<span class="mr-10">
|
||||
<ConsumptionGauge
|
||||
:capacity="memoryTotal"
|
||||
:used="reserved"
|
||||
:units="memoryUnits"
|
||||
:number-formatter="memoryFormatter"
|
||||
:resource-name="resourceName"
|
||||
>
|
||||
<template #title="{amountTemplateValues, formattedPercentage}">
|
||||
<span>
|
||||
{{ t('harvester.formatters.hardwareResourceGauge.reserved') }}
|
||||
</span>
|
||||
<span class="precent-data">
|
||||
{{ t('node.detail.glance.consumptionGauge.amount', reservedAmountTemplateValues) }}
|
||||
{{ t('node.detail.glance.consumptionGauge.amount', amountTemplateValues) }}
|
||||
<span class="ml-10 percentage">/ {{ formattedPercentage }}
|
||||
</span>
|
||||
</span>
|
||||
</div>
|
||||
<div class="mt-10">
|
||||
<PercentageBar
|
||||
:model-value="reservedPercentage"
|
||||
show-percentage
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</ConsumptionGauge>
|
||||
<div
|
||||
v-if="showUsed"
|
||||
class="consumption-gauge mt-10"
|
||||
class="mt-10"
|
||||
>
|
||||
<div class="numbers">
|
||||
<span>
|
||||
{{ t('harvester.formatters.hardwareResourceGauge.used') }}
|
||||
</span>
|
||||
<span class="precent-data">
|
||||
{{ t('node.detail.glance.consumptionGauge.amount', usedAmountTemplateValues) }}
|
||||
</span>
|
||||
</div>
|
||||
<div class="mt-10">
|
||||
<PercentageBar
|
||||
:model-value="usedPercentage"
|
||||
show-percentage
|
||||
/>
|
||||
</div>
|
||||
<ConsumptionGauge
|
||||
:capacity="memoryTotal"
|
||||
:used="used"
|
||||
:units="memoryUnits"
|
||||
:number-formatter="memoryFormatter"
|
||||
>
|
||||
<template #title="{amountTemplateValues, formattedPercentage}">
|
||||
<span>
|
||||
{{ t('harvester.formatters.hardwareResourceGauge.used') }}
|
||||
</span>
|
||||
<span class="precent-data">
|
||||
{{ t('node.detail.glance.consumptionGauge.amount', amountTemplateValues) }}
|
||||
<span class="ml-10 percentage">/ {{ formattedPercentage }}
|
||||
</span>
|
||||
</span>
|
||||
</template>
|
||||
</ConsumptionGauge>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.consumption-gauge {
|
||||
.numbers {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
}
|
||||
}
|
||||
|
||||
.precent-data {
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
<script>
|
||||
import PercentageBar from '@shell/components/PercentageBar';
|
||||
import ConsumptionGauge from '@shell/components/ConsumptionGauge';
|
||||
import { LONGHORN } from '@shell/config/types';
|
||||
import { formatSi, exponentNeeded, UNITS } from '@shell/utils/units';
|
||||
import { UNIT_SUFFIX } from '../utils/unit';
|
||||
|
||||
export default {
|
||||
name: 'HarvesterStorageUsed',
|
||||
components: { PercentageBar },
|
||||
components: { ConsumptionGauge },
|
||||
|
||||
props: {
|
||||
value: {
|
||||
@@ -120,14 +120,6 @@ export default {
|
||||
unit: this.allocatedUnits,
|
||||
};
|
||||
},
|
||||
|
||||
usedPercentage() {
|
||||
return this.storageStats.maximum ? (this.storageStats.used * 100) / this.storageStats.maximum : 0;
|
||||
},
|
||||
|
||||
allocatedPercentage() {
|
||||
return this.storageStats.total ? (this.storageStats.scheduled * 100) / this.storageStats.total : 0;
|
||||
},
|
||||
},
|
||||
|
||||
methods: {
|
||||
@@ -152,54 +144,53 @@ export default {
|
||||
<div>
|
||||
<div
|
||||
v-if="showAllocated"
|
||||
class="consumption-gauge"
|
||||
>
|
||||
<div class="numbers">
|
||||
<span class="mr-10">
|
||||
{{ t('harvester.dashboard.hardwareResourceGauge.allocated') }}
|
||||
</span>
|
||||
<span class="precent-data">
|
||||
{{ t('node.detail.glance.consumptionGauge.amount', allocatedAmountTemplateValues) }}
|
||||
</span>
|
||||
</div>
|
||||
<div class="mt-10">
|
||||
<PercentageBar
|
||||
:model-value="allocatedPercentage"
|
||||
show-percentage
|
||||
/>
|
||||
</div>
|
||||
<ConsumptionGauge
|
||||
:capacity="storageStats.total"
|
||||
:used="storageStats.scheduled"
|
||||
:units="allocatedUnits"
|
||||
:number-formatter="formatter"
|
||||
:resource-name="resourceName"
|
||||
>
|
||||
<template #title="{formattedPercentage}">
|
||||
<span>
|
||||
{{ t('harvester.dashboard.hardwareResourceGauge.allocated') }}
|
||||
</span>
|
||||
<span class="precent-data">
|
||||
{{ t('node.detail.glance.consumptionGauge.amount', allocatedAmountTemplateValues) }}
|
||||
<span class="ml-10 percentage">
|
||||
/ {{ formattedPercentage }}
|
||||
</span>
|
||||
</span>
|
||||
</template>
|
||||
</ConsumptionGauge>
|
||||
</div>
|
||||
<div
|
||||
class="consumption-gauge"
|
||||
:class="{ 'mt-10': showAllocated }"
|
||||
<ConsumptionGauge
|
||||
:capacity="storageStats.maximum"
|
||||
:used="storageStats.used"
|
||||
:units="usedUnits"
|
||||
:number-formatter="formatter"
|
||||
:resource-name="showAllocated ? '' : resourceName"
|
||||
:class="{
|
||||
'mt-10': showAllocated,
|
||||
}"
|
||||
>
|
||||
<div class="numbers">
|
||||
<template #title="{formattedPercentage}">
|
||||
<span>
|
||||
{{ t('node.detail.glance.consumptionGauge.used') }}
|
||||
</span>
|
||||
<span class="precent-data">
|
||||
{{ t('node.detail.glance.consumptionGauge.amount', usedAmountTemplateValues) }}
|
||||
<span class="ml-10 percentage">
|
||||
/ {{ formattedPercentage }}
|
||||
</span>
|
||||
</span>
|
||||
</div>
|
||||
<div class="mt-10">
|
||||
<PercentageBar
|
||||
:model-value="usedPercentage"
|
||||
show-percentage
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</ConsumptionGauge>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.consumption-gauge {
|
||||
.numbers {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
}
|
||||
}
|
||||
|
||||
.precent-data {
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
@@ -13,15 +13,6 @@ generic:
|
||||
basic: Basic
|
||||
loading: Loading...
|
||||
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:
|
||||
serverVersion: 'Current version: <code>{serverVersion}</code>'
|
||||
@@ -36,8 +27,7 @@ nav:
|
||||
Logging: Logging
|
||||
'Monitoring and Logging': Monitoring and Logging
|
||||
vmimport: Virtual Machine Imports
|
||||
vmMigration: Virtual Machine Migration
|
||||
Configurations: Configurations
|
||||
vmMigration: VM Migration
|
||||
|
||||
resourceTable:
|
||||
groupBy:
|
||||
@@ -93,8 +83,6 @@ harvester:
|
||||
backup:
|
||||
success: 'Backup { backUpName } has been initiated.'
|
||||
addBackup: Add Backup
|
||||
fileSystemFreezeDeadline:
|
||||
label: 'File System Freeze Deadline'
|
||||
quota:
|
||||
editVMQuota: Edit VM Quota
|
||||
editQuota: Edit Quota
|
||||
@@ -234,8 +222,6 @@ harvester:
|
||||
title: Take Virtual Machine Snapshot
|
||||
name: Name
|
||||
success: 'Take virtual machine Snapshot { name } successfully.'
|
||||
fileSystemFreezeDeadline:
|
||||
label: 'File System Freeze Deadline'
|
||||
restart:
|
||||
title: Restart Virtual Machine
|
||||
tip: Restart the virtual machine for configuration changes to take effect.
|
||||
@@ -331,8 +317,7 @@ harvester:
|
||||
message: Message
|
||||
phase: Phase
|
||||
attachedVM: Attached Virtual Machine
|
||||
cpuManager: CPU<br>Manager
|
||||
diskState: Disk
|
||||
cpuManager: CPU Manager
|
||||
routeConnectivityTooltip: Connectivity between the VM network and the management network, which the Harvester nodes are connected to.
|
||||
fingerprint: Fingerprint
|
||||
value: Value
|
||||
@@ -380,7 +365,7 @@ harvester:
|
||||
vmMigrationMapSourceProvider: Source Provider
|
||||
vmMigrationMapDestProvider: Destination Provider
|
||||
vmMigrationPlanTargetNs: Target Namespace
|
||||
vmMigrationPlanVmCount: VM Count
|
||||
vmMigrationPlanVmCount: VMs
|
||||
vmMigrationMigrationPlan: Plan
|
||||
tab:
|
||||
volume: Volumes
|
||||
@@ -406,7 +391,6 @@ harvester:
|
||||
network: Network
|
||||
model: Model
|
||||
macAddress: MAC address
|
||||
staticIp: Static IP
|
||||
port: Port
|
||||
protocol: Protocol
|
||||
remove: Remove
|
||||
@@ -488,6 +472,7 @@ harvester:
|
||||
volume:
|
||||
upperType: Volume name
|
||||
lowerType: volume name
|
||||
needAtLeastOneBootable: 'At least one bootable volume is required!'
|
||||
image:
|
||||
ruleTip: 'The URL you have entered ends in an extension that we do not support. We only accept image files that end in .img, .iso, .qcow, .qcow2, .raw.'
|
||||
ruleFileTip: 'The file you have chosen ends in an extension that we do not support. We only accept image files that end in .img, .iso, .qcow, .qcow2, .raw.'
|
||||
@@ -641,7 +626,6 @@ harvester:
|
||||
notification:
|
||||
success: 'Update host "{name}" storage configurations successfully.'
|
||||
error: Host has unready or unschedulable disks.
|
||||
mounted: Already Mounted
|
||||
fileSystem:
|
||||
info: Current file system is {system}, You can format it manually.
|
||||
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.
|
||||
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."
|
||||
staticIpTip: "Static IP that will be stored to annotation static-ip.harvesterhci.io/{nic_name}."
|
||||
volumeUpdate: 'Set volume { name } successfully'
|
||||
type: Type
|
||||
size: Size
|
||||
@@ -1099,8 +1082,6 @@ harvester:
|
||||
downloadLog: Download Log
|
||||
logStatus: Log Download Status
|
||||
dismissMessage: Dismiss it
|
||||
upgradeAvailable: Upgrade Available
|
||||
upgradeUnavailable: Upgrade Unavailable
|
||||
upgradeInfo:
|
||||
warning: WARNING
|
||||
doc: Read the <a href="{url}" target="_blank">documentation</a> before starting the upgrade process. Ensure that you complete procedures that are relevant to your environment and the version you are upgrading to.
|
||||
@@ -1838,7 +1819,6 @@ harvester:
|
||||
unknown: Unknown
|
||||
identifier: Identifier
|
||||
podNetwork: Pod Network
|
||||
ignored: Ignored
|
||||
usedBy: "Used by:"
|
||||
vlan: "VLAN {id}"
|
||||
vCpu: "{count} vCPU"
|
||||
@@ -1859,7 +1839,7 @@ harvester:
|
||||
connectionFailed: Connection failed
|
||||
providerNotReady: Provider not ready
|
||||
labels:
|
||||
dashboard: Migration Overview
|
||||
dashboard: Migrations
|
||||
provider: Providers
|
||||
networkMap: Network Maps
|
||||
storageMap: Storage Maps
|
||||
@@ -1941,8 +1921,8 @@ harvester:
|
||||
network: Network
|
||||
datastore: Datastore
|
||||
dashboard:
|
||||
title: Virtual Machine Migration Overview
|
||||
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."
|
||||
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.
|
||||
createPlan: Create Migration
|
||||
tableTitle: Migrations
|
||||
columns:
|
||||
@@ -1950,16 +1930,14 @@ harvester:
|
||||
plan: Migration Plan
|
||||
progress: Progress
|
||||
mappings: Mappings
|
||||
duration: Duration
|
||||
progress:
|
||||
failed: Failed
|
||||
migration: Migration
|
||||
initializingMigration: Initializing migration
|
||||
finishedSuccessfully: Finished Successfully
|
||||
step: "Step {index}"
|
||||
vmCount: "{count, plural, one {# VM} other {# VMs}}"
|
||||
vmCount: "{count} VMs"
|
||||
vmId: "id: {id}"
|
||||
checkMigratedVm: Click to check migrated VM details
|
||||
configureMappings:
|
||||
title: Set Mappings
|
||||
description: Map VMware networks and datastores to Harvester and Longhorn target resources
|
||||
@@ -1972,8 +1950,8 @@ harvester:
|
||||
placeholder: Choose a Harvester network
|
||||
template: Use existing network mapping as template
|
||||
options:
|
||||
podNetworking: Management Network
|
||||
ignored: Ignored (No NIC will be created)
|
||||
podNetworking: Pod Networking
|
||||
ignored: Ignored
|
||||
storageMapping:
|
||||
title: Storage Mapping
|
||||
description: Map VMware datastores to Harvester storage classes
|
||||
@@ -1990,8 +1968,7 @@ harvester:
|
||||
memory: Memory
|
||||
storage: Storage
|
||||
source: Source
|
||||
targetNamespace: Namespace
|
||||
targetNamespacePlaceholder: "Select target namespace"
|
||||
targetNamespace: Target Namespace
|
||||
migrationMode: Migration Mode
|
||||
coldMigration: Cold Migration
|
||||
virtualMachines: Virtual Machines
|
||||
@@ -2008,8 +1985,6 @@ harvester:
|
||||
start: Start
|
||||
restart: Restart
|
||||
stop: Stop
|
||||
deleteDialog:
|
||||
warning: Deleting this migration plan will also delete the following related resources
|
||||
|
||||
vmImport:
|
||||
titles:
|
||||
@@ -2259,12 +2234,6 @@ harvester:
|
||||
prefix: The nvidia-driver-toolkit add-on is not enabled, click
|
||||
middle: here
|
||||
suffix: to enable it to manage your SR-IOV GPU devices.
|
||||
enable:
|
||||
title: Enable SR-IOV GPU Device
|
||||
skipMigConfiguration: Use timesliced mode (skip MIG configuration)
|
||||
note: If unchecked, MIG mode will be attempted by default. If MIG mode is not supported or fails to initialize, it will fall back to timesliced mode. The actual mode depends on whether the GPU supports MIG.
|
||||
timeslicedBadge: timesliced mode
|
||||
timesliced: Timesliced
|
||||
|
||||
migconfiguration:
|
||||
label: vGPU MIG Configurations
|
||||
|
||||
@@ -86,13 +86,6 @@ export default {
|
||||
value: 'spec.address',
|
||||
sort: ['spec.address']
|
||||
},
|
||||
{
|
||||
name: 'timesliced',
|
||||
labelKey: 'harvester.sriovgpu.timesliced',
|
||||
value: 'isTimesliced',
|
||||
formatter: 'Checked',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
name: 'vfAddresses',
|
||||
label: 'VF Addresses',
|
||||
|
||||
@@ -53,6 +53,7 @@ export default {
|
||||
|
||||
devices() {
|
||||
const inStore = this.$store.getters['currentProduct'].inStore;
|
||||
|
||||
const data = this.$store.getters[`${ inStore }/all`](HCI.USB_DEVICE) || [];
|
||||
|
||||
data.forEach((row) => {
|
||||
|
||||
@@ -84,7 +84,7 @@ export default {
|
||||
},
|
||||
{
|
||||
...NAME,
|
||||
width: 150,
|
||||
width: 130,
|
||||
},
|
||||
{
|
||||
name: 'host-ip',
|
||||
@@ -136,14 +136,14 @@ export default {
|
||||
value: 'id',
|
||||
formatter: 'HarvesterCPUPinning',
|
||||
formatterOpts: { rows: this.rows },
|
||||
width: 75,
|
||||
width: 150,
|
||||
align: 'center',
|
||||
});
|
||||
}
|
||||
if (this.hasLonghornSchema) {
|
||||
out.push({
|
||||
name: 'diskState',
|
||||
labelKey: 'harvester.tableHeaders.diskState',
|
||||
labelKey: 'tableHeaders.diskState',
|
||||
value: 'diskState',
|
||||
formatter: 'HarvesterDiskState',
|
||||
width: 130,
|
||||
@@ -156,6 +156,7 @@ export default {
|
||||
name: 'console',
|
||||
label: ' ',
|
||||
align: 'right',
|
||||
width: 80,
|
||||
});
|
||||
|
||||
return out;
|
||||
@@ -238,8 +239,6 @@ export default {
|
||||
v-if="!row.consoleUrl"
|
||||
:href="consoleDocLink"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
class="console-info"
|
||||
><i class="icon icon-info" /></a>
|
||||
</div>
|
||||
</template>
|
||||
@@ -250,13 +249,5 @@ export default {
|
||||
<style lang="scss" scoped>
|
||||
.console-button {
|
||||
display: flex;
|
||||
position: relative;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
|
||||
.console-info {
|
||||
position: absolute;
|
||||
top: -8px;
|
||||
right: -3px;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -59,7 +59,7 @@ export default {
|
||||
|
||||
const configs = this.$store.getters[`${ inStore }/all`](HCI.VLAN_CONFIG);
|
||||
|
||||
return configs.filter((config) => config.spec?.clusterNetwork !== 'mgmt');
|
||||
return configs;
|
||||
},
|
||||
|
||||
vlanConfigSchema() {
|
||||
@@ -121,22 +121,6 @@ export default {
|
||||
|
||||
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: {
|
||||
@@ -240,29 +224,6 @@ export default {
|
||||
</button>
|
||||
</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
|
||||
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 lang="scss">
|
||||
|
||||
@@ -162,12 +162,6 @@ export default {
|
||||
machineType: '',
|
||||
machineTypes: [],
|
||||
secretName: '',
|
||||
// Tracks the name prefix that `secretName` was generated from, so it can be
|
||||
// regenerated if the VM name changes (e.g. after a failed create attempt is retried
|
||||
// with a different name). See harvester/harvester#11174.
|
||||
secretNamePrefixUsed: '',
|
||||
// Same purpose as secretNamePrefixUsed, but for the Windows sysprep secret name.
|
||||
sysprepSecretNamePrefixUsed: '',
|
||||
secretRef: null,
|
||||
showAdvanced: false,
|
||||
deleteAgent: true,
|
||||
@@ -636,8 +630,6 @@ export default {
|
||||
|
||||
const networks = vm.spec.template.spec.networks || [];
|
||||
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 network = networks.find( (N) => I.name === N.name);
|
||||
@@ -654,7 +646,6 @@ export default {
|
||||
newCreateId: (fromTemplate || init) ? randomStr(10) : false,
|
||||
model: I.model,
|
||||
networkName: isPod ? MANAGEMENT_NETWORK : network?.multus?.networkName,
|
||||
staticIp: annotations[`${ staticIpPrefix }${ I.name }`] || '',
|
||||
};
|
||||
});
|
||||
|
||||
@@ -756,8 +747,6 @@ export default {
|
||||
|
||||
const vm = this.resourceType === HCI.VM ? this.value : this.value.spec.vm;
|
||||
|
||||
this.syncStaticIpAnnotations(vm);
|
||||
|
||||
// parse reserved memory
|
||||
if (!this.reservedMemory) {
|
||||
delete vm.metadata.annotations[HCI_ANNOTATIONS.VM_RESERVED_MEMORY];
|
||||
@@ -779,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() {
|
||||
if (this.cpuMemoryHotplugEnabled) {
|
||||
// set CPU
|
||||
@@ -872,30 +837,18 @@ export default {
|
||||
}
|
||||
});
|
||||
|
||||
// Regenerate the cloud-init secret name whenever it hasn't been generated yet, or the VM
|
||||
// name has changed since it was last generated (e.g. a previous create attempt failed with
|
||||
// an invalid/duplicate name and the user corrected it). Without this, a stale secret name
|
||||
// derived from a rejected attempt gets reused for the VM that's actually created.
|
||||
// See harvester/harvester#11174.
|
||||
if (this.needNewSecret || !this.secretName || (this.isCreate && this.secretNamePrefixUsed !== this.secretNamePrefix)) {
|
||||
if (this.needNewSecret || !this.secretName) {
|
||||
this.secretName = this.generateSecretName(this.secretNamePrefix);
|
||||
this.secretNamePrefixUsed = this.secretNamePrefix;
|
||||
}
|
||||
|
||||
if (!disks.find((D) => D.name === 'sysprep') && this.isWindows) {
|
||||
const hasSysprepContent = !!this.sysprep.xmlContent?.trim?.();
|
||||
|
||||
// If we have content but no secret name, it's a new secret that needs a name. Also
|
||||
// regenerate when creating a VM if the name prefix has changed since it was last
|
||||
// generated.
|
||||
const sysprepNeedsNewSecretName = !this.sysprep.secretName?.trim?.() ||
|
||||
(this.isCreate && this.sysprepSecretNamePrefixUsed !== '' && this.sysprepSecretNamePrefixUsed !== this.secretNamePrefix);
|
||||
|
||||
if (hasSysprepContent && sysprepNeedsNewSecretName) {
|
||||
// If we have content but no secret name, it's a new secret that needs a name.
|
||||
if (hasSysprepContent && !this.sysprep.secretName?.trim?.()) {
|
||||
const prefix = this.secretNamePrefix ? `${ this.secretNamePrefix }-windows-sysprep` : 'windows-sysprep';
|
||||
|
||||
this.sysprep.secretName = `${ this.value.metadata.namespace }/${ this.generateSecretName(prefix) }`;
|
||||
this.sysprepSecretNamePrefixUsed = this.secretNamePrefix;
|
||||
}
|
||||
|
||||
// Preserve/attach sysprep whenever a secret is selected/known.
|
||||
@@ -914,7 +867,7 @@ export default {
|
||||
}
|
||||
}
|
||||
|
||||
if (!disks.find( (D) => D.name === 'cloudinitdisk') && (this.userData || this.networkScript)) {
|
||||
if (!disks.find( (D) => D.name === 'cloudinitdisk') && (this.userData || this.networkData)) {
|
||||
if (!this.isWindows) {
|
||||
disks.push({
|
||||
name: 'cloudinitdisk',
|
||||
@@ -1806,18 +1759,7 @@ export default {
|
||||
const specDevice = specDeviceMap.get(device.name);
|
||||
|
||||
if (specDevice) {
|
||||
const merged = { ...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 { ...specDevice, ...device };
|
||||
}
|
||||
|
||||
return device;
|
||||
@@ -1865,15 +1807,6 @@ export default {
|
||||
},
|
||||
|
||||
watch: {
|
||||
networkRows: {
|
||||
handler() {
|
||||
const vm = this.resourceType === HCI.VM ? this.value : this.value?.spec?.vm;
|
||||
|
||||
this.syncStaticIpAnnotations(vm);
|
||||
},
|
||||
deep: true
|
||||
},
|
||||
|
||||
diskRows: {
|
||||
handler(neu, old) {
|
||||
if (Array.isArray(neu)) {
|
||||
|
||||
@@ -69,15 +69,16 @@ export default class SRIOVDevice extends SteveModel {
|
||||
return this.spec.enabled && this.status?.vfAddresses?.length > 0 && this.status?.vGPUDevices?.length > 0;
|
||||
}
|
||||
|
||||
get isTimesliced() {
|
||||
return this.metadata?.annotations?.[HCI_ANNOTATIONS.SKIP_MIG_CONFIGURATION] === 'true';
|
||||
}
|
||||
|
||||
enableDevice() {
|
||||
this.$dispatch('promptModal', {
|
||||
resources: [this],
|
||||
component: 'EnableSriovGpuDevice'
|
||||
});
|
||||
async enableDevice() {
|
||||
try {
|
||||
this.spec.enabled = true;
|
||||
await this.save();
|
||||
} catch (err) {
|
||||
this.$dispatch('growl/fromError', {
|
||||
title: this.t('generic.notification.title.error', { name: escapeHtml(this.metadata.name) }),
|
||||
err,
|
||||
}, { root: true });
|
||||
}
|
||||
}
|
||||
|
||||
async disableDevice() {
|
||||
|
||||
@@ -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() {
|
||||
const conditions = this.status?.conditions || [];
|
||||
|
||||
@@ -46,10 +35,6 @@ export default class ForkliftPlan extends HarvesterResource {
|
||||
}
|
||||
|
||||
get stateDescription() {
|
||||
if (this.metadata?.deletionTimestamp) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const messages = [];
|
||||
const conditions = this.status?.conditions || [];
|
||||
|
||||
@@ -71,7 +56,7 @@ export default class ForkliftPlan extends HarvesterResource {
|
||||
get stateObj() {
|
||||
return {
|
||||
error: this.planFailed || this.planCritical,
|
||||
transitioning: this.isMigrating || this.isPendingMigrationStart || !!this.metadata?.deletionTimestamp,
|
||||
transitioning: this.isMigrating,
|
||||
message: this.stateDescription,
|
||||
};
|
||||
}
|
||||
@@ -82,14 +67,6 @@ export default class ForkliftPlan extends HarvesterResource {
|
||||
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() {
|
||||
const history = this.status?.migration?.history || [];
|
||||
|
||||
@@ -110,10 +87,6 @@ export default class ForkliftPlan extends HarvesterResource {
|
||||
}
|
||||
|
||||
get stateDisplay() {
|
||||
if (this.metadata?.deletionTimestamp) {
|
||||
return 'Terminating';
|
||||
}
|
||||
|
||||
if (this.planFailed) {
|
||||
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');
|
||||
}
|
||||
|
||||
if (this.isPendingMigrationStart) {
|
||||
return this.t('harvester.addons.vmMigration.plan.states.inProgress');
|
||||
}
|
||||
|
||||
return this.t('harvester.addons.vmMigration.plan.states.active');
|
||||
}
|
||||
|
||||
get stateBackground() {
|
||||
if (this.metadata?.deletionTimestamp) {
|
||||
return 'bg-info';
|
||||
}
|
||||
|
||||
if (this.planFailed) {
|
||||
return 'bg-error';
|
||||
}
|
||||
@@ -158,10 +123,6 @@ export default class ForkliftPlan extends HarvesterResource {
|
||||
return 'bg-info';
|
||||
}
|
||||
|
||||
if (this.isPendingMigrationStart) {
|
||||
return 'bg-info';
|
||||
}
|
||||
|
||||
return 'bg-success';
|
||||
}
|
||||
|
||||
@@ -283,4 +244,15 @@ export default class ForkliftPlan extends HarvesterResource {
|
||||
async deletePlan() {
|
||||
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",
|
||||
"description": "Rancher UI Extension for Harvester",
|
||||
"version": "1.9.0-rc3",
|
||||
"version": "1.9.0-dev",
|
||||
"private": false,
|
||||
"rancher": {
|
||||
"annotations": {
|
||||
"catalog.cattle.io/display-name": "Harvester",
|
||||
"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"
|
||||
}
|
||||
},
|
||||
|
||||
@@ -11,8 +11,6 @@ import { SCHEMA } from '@shell/config/types';
|
||||
import { useI18n } from '@shell/composables/useI18n';
|
||||
import { HCI } from '../../../../types';
|
||||
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 { STATE, NAME as NAME_COL, AGE } from '@shell/config/table-headers';
|
||||
|
||||
@@ -37,88 +35,6 @@ const inStore = computed(() => store.getters['currentProduct'].inStore);
|
||||
const allPlans = computed(() => store.getters[`${ inStore.value }/all`](HCI.FORKLIFT_PLAN));
|
||||
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 allVMs = computed(() => store.getters[`${ inStore.value }/all`](HCI.VM));
|
||||
|
||||
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) {
|
||||
return { display: null, seconds: -1 };
|
||||
}
|
||||
|
||||
const startMs = new Date(started).getTime();
|
||||
const endMs = completed ? new Date(completed).getTime() : Date.now();
|
||||
|
||||
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(() => {
|
||||
return allPlans.value.map((plan) => {
|
||||
@@ -130,8 +46,8 @@ const rows = computed(() => {
|
||||
const netMap = allNetworkMaps.value.find((m) => m.metadata.name === netMapName && m.metadata.namespace === netMapNs);
|
||||
const storMap = allStorageMaps.value.find((m) => m.metadata.name === storMapName && m.metadata.namespace === storMapNs);
|
||||
|
||||
plan.networkEntries = (netMap?.spec?.map || []).map((e) => `${ e.source?.id || 'Ignored' } → ${ e.destination?.type === 'pod' ? t('harvester.addons.vmMigration.configureMappings.networkMapping.options.podNetworking') : (e.destination?.name || 'Ignored') }`);
|
||||
plan.storageEntries = (storMap?.spec?.map || []).map((e) => `${ e.source?.id || 'Ignored' } → ${ e.destination?.storageClass || 'Ignored' }`);
|
||||
plan.networkEntries = (netMap?.spec?.map || []).map((e) => `${ e.source?.id || '-' } → ${ e.destination?.type === 'pod' ? t('harvester.addons.vmMigration.generic.podNetwork') : (e.destination?.name || '-') }`);
|
||||
plan.storageEntries = (storMap?.spec?.map || []).map((e) => `${ e.source?.id || '-' } → ${ e.destination?.storageClass || '-' }`);
|
||||
|
||||
plan.vmIdsDisplay = (plan.spec?.vms || []).map((vm) => vm.id || vm.name || '').filter(Boolean).join(', ') || '-';
|
||||
|
||||
@@ -184,56 +100,30 @@ const rows = computed(() => {
|
||||
errorMsg = `${ currentStep || t('harvester.addons.vmMigration.dashboard.progress.migration') }: ${ t('harvester.addons.vmMigration.dashboard.progress.failed') }`;
|
||||
}
|
||||
|
||||
const vmNamespace = vm.namespace || plan.spec?.targetNamespace || plan.metadata?.namespace;
|
||||
const routeParams = currentRouter().currentRoute?.value?.params || {};
|
||||
const product = routeParams.product || store.getters['productId'];
|
||||
const cluster = routeParams.cluster || store.getters['clusterId'];
|
||||
const vmNameCandidates = [vm.targetName, vm.name, vm.id].filter(Boolean);
|
||||
const targetVm = allVMs.value.find((item) => vmNameCandidates.includes(item.metadata?.name) && (!vmNamespace || item.metadata?.namespace === vmNamespace));
|
||||
const canNavigateToVm = overallProgress >= 100 && !errorMsg && !plan.planFailed && !plan.planCanceled && !!targetVm && !!product && !!cluster;
|
||||
const vmDetailLocation = canNavigateToVm ? {
|
||||
name: `${ PRODUCT_NAME }-c-cluster-resource-namespace-id`,
|
||||
params: {
|
||||
product,
|
||||
cluster,
|
||||
resource: HCI.VM,
|
||||
namespace: targetVm.metadata.namespace,
|
||||
id: targetVm.metadata.name,
|
||||
}
|
||||
} : null;
|
||||
|
||||
return {
|
||||
vmName: vm.name || vm.id || t('harvester.addons.vmMigration.generic.unknown'),
|
||||
vmId: vm.id || '',
|
||||
progress: overallProgress,
|
||||
vmName: vm.name || vm.id || t('harvester.addons.vmMigration.generic.unknown'),
|
||||
vmId: vm.id || '',
|
||||
progress: overallProgress,
|
||||
currentStep,
|
||||
pipelineTooltip: formatPipelineTooltip(pipeline),
|
||||
errorMsg,
|
||||
canceled: plan.planCanceled,
|
||||
vmDetailLocation,
|
||||
canceled: plan.planCanceled,
|
||||
};
|
||||
});
|
||||
|
||||
// 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) {
|
||||
plan.vmProgress = plan.spec.vms.map((vm) => ({
|
||||
vmName: vm.name || vm.id || t('harvester.addons.vmMigration.generic.unknown'),
|
||||
vmId: vm.id || '',
|
||||
progress: 0,
|
||||
currentStep: t('harvester.addons.vmMigration.dashboard.progress.initializingMigration'),
|
||||
pipelineTooltip: formatPipelineTooltip([]),
|
||||
errorMsg: '',
|
||||
canceled: false,
|
||||
vmName: vm.name || vm.id || t('harvester.addons.vmMigration.generic.unknown'),
|
||||
vmId: vm.id || '',
|
||||
progress: 0,
|
||||
currentStep: t('harvester.addons.vmMigration.dashboard.progress.initializingMigration'),
|
||||
errorMsg: '',
|
||||
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;
|
||||
|
||||
const durationResult = formatDuration(plan.status?.migration?.started, plan.status?.migration?.completed);
|
||||
|
||||
plan.duration = durationResult.display;
|
||||
plan.durationSeconds = durationResult.seconds;
|
||||
|
||||
return plan;
|
||||
});
|
||||
});
|
||||
@@ -257,63 +147,22 @@ const headers = [
|
||||
name: 'progress',
|
||||
labelKey: 'harvester.addons.vmMigration.dashboard.columns.progress',
|
||||
value: 'progress',
|
||||
width: 450,
|
||||
width: 500,
|
||||
},
|
||||
{
|
||||
name: 'mappings',
|
||||
labelKey: 'harvester.addons.vmMigration.dashboard.columns.mappings',
|
||||
},
|
||||
{
|
||||
name: 'duration',
|
||||
labelKey: 'harvester.addons.vmMigration.dashboard.columns.duration',
|
||||
value: 'duration',
|
||||
sort: 'durationSeconds',
|
||||
width: 90,
|
||||
},
|
||||
{ ...AGE },
|
||||
];
|
||||
|
||||
const init = async() => {
|
||||
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([
|
||||
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_STORAGE_MAP }),
|
||||
]);
|
||||
|
||||
// VMs are only needed to conditionally show the post-migration VM-detail
|
||||
// link, so load them separately and non-fatally: a failure here (or the
|
||||
// cost of findAll on large clusters) should not block plans/maps from
|
||||
// rendering.
|
||||
try {
|
||||
await store.dispatch(`${ inStore.value }/findAll`, { type: HCI.VM });
|
||||
} catch (e) {
|
||||
// Intentionally ignored: the dashboard still works without the VM list,
|
||||
// the migrated VM-detail link simply won't be shown.
|
||||
}
|
||||
} catch (e) {
|
||||
errors.value = [e?.message || t('harvester.addons.vmMigration.errors.failedLoadPlans')];
|
||||
} finally {
|
||||
@@ -340,10 +189,9 @@ init();
|
||||
>
|
||||
<template #subHeader>
|
||||
<div class="mmt-5">
|
||||
<p
|
||||
v-clean-html="t('harvester.addons.vmMigration.dashboard.description')"
|
||||
class="text-muted"
|
||||
></p>
|
||||
<p class="text-muted">
|
||||
{{ t('harvester.addons.vmMigration.dashboard.description') }}
|
||||
</p>
|
||||
</div>
|
||||
</template>
|
||||
<template #createButton>
|
||||
@@ -365,19 +213,14 @@ init();
|
||||
:search="false"
|
||||
key-field="_key"
|
||||
>
|
||||
<template #header-left>
|
||||
<h3 class="table-title m-0">
|
||||
{{ t('harvester.addons.vmMigration.dashboard.tableTitle') }}
|
||||
</h3>
|
||||
</template>
|
||||
<template #cell:name="{ row }">
|
||||
<div class="plan-name-cell">
|
||||
<router-link
|
||||
v-if="row.detailLocation"
|
||||
:to="row.detailLocation"
|
||||
class="plan-name"
|
||||
>
|
||||
{{ row.metadata.name }}
|
||||
</router-link>
|
||||
<div
|
||||
v-else
|
||||
class="plan-name"
|
||||
>
|
||||
<div class="plan-name">
|
||||
{{ row.metadata.name }}
|
||||
</div>
|
||||
</div>
|
||||
@@ -397,31 +240,17 @@ init();
|
||||
>
|
||||
<div class="vm-progress-header">
|
||||
<div class="vm-name-block">
|
||||
<span class="vm-name">
|
||||
{{ vm.vmName }}
|
||||
<router-link
|
||||
v-if="vm.vmDetailLocation"
|
||||
v-clean-tooltip="t('harvester.addons.vmMigration.dashboard.progress.checkMigratedVm')"
|
||||
:to="vm.vmDetailLocation"
|
||||
class="vm-detail-link"
|
||||
>
|
||||
<i class="icon icon-external-link" />
|
||||
</router-link>
|
||||
</span>
|
||||
<span class="vm-name">{{ vm.vmName }}</span>
|
||||
<span class="text-muted vm-id">{{ t('harvester.addons.vmMigration.dashboard.progress.vmId', { id: vm.vmId }) }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="vm-pct-block">
|
||||
<div
|
||||
v-clean-tooltip="{ content: vm.pipelineTooltip, html: true }"
|
||||
<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"
|
||||
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>
|
||||
</div>
|
||||
<div
|
||||
@@ -458,13 +287,6 @@ init();
|
||||
:storage-entries="row.storageEntries"
|
||||
/>
|
||||
</template>
|
||||
<template #cell:duration="{ row }">
|
||||
<span v-if="row.duration">{{ row.duration }}</span>
|
||||
<span
|
||||
v-else
|
||||
class="text-muted"
|
||||
>—</span>
|
||||
</template>
|
||||
</ResourceTable>
|
||||
</div>
|
||||
</template>
|
||||
@@ -498,14 +320,6 @@ init();
|
||||
|
||||
.vm-name {
|
||||
font-size: 14px;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 4px;
|
||||
}
|
||||
|
||||
.vm-detail-link {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.vm-name-block {
|
||||
|
||||
@@ -9,7 +9,6 @@ import ConfigureMappingsStep from '@pkg/harvester/components/vm-migration/Config
|
||||
import ReviewMigrationStep from '@pkg/harvester/components/vm-migration/ReviewMigrationStep.vue';
|
||||
import { PRODUCT_NAME } from '@pkg/harvester/config/harvester';
|
||||
import { currentRouter } from '@pkg/harvester/utils/router';
|
||||
import { exceptionToErrorsArray, stringify } from '@shell/utils/error';
|
||||
|
||||
const store = useStore();
|
||||
const { t } = useI18n(store);
|
||||
@@ -56,7 +55,7 @@ const stepData = reactive({
|
||||
networkEntries: [],
|
||||
storageEntries: [],
|
||||
},
|
||||
review: { planName: '', targetNamespace: '' },
|
||||
review: { planName: '' },
|
||||
});
|
||||
|
||||
const steps = reactive([
|
||||
@@ -221,13 +220,7 @@ const onFinish = async(buttonCb) => {
|
||||
buttonCb(true);
|
||||
currentRouter().push(migrationListLocation);
|
||||
} catch (err) {
|
||||
errors.value = exceptionToErrorsArray(err).map((e) => {
|
||||
if (typeof e === 'string') {
|
||||
return e;
|
||||
}
|
||||
|
||||
return stringify(e);
|
||||
});
|
||||
errors.value = [err instanceof Error ? err.message : String(err)];
|
||||
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.navGroup - The group name in the side nav.
|
||||
* @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, {
|
||||
addonName, resourceType, navGroup, types, requireSchema = true
|
||||
addonName, resourceType, navGroup, types
|
||||
}) {
|
||||
if (typeof window === 'undefined') {
|
||||
return;
|
||||
@@ -59,7 +57,7 @@ export function registerAddonSideNav(store, productName, {
|
||||
|
||||
// Adds or removes the resource IDs from the product visibility whitelist.
|
||||
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
|
||||
// no longer accessible (e.g. partial permission changes like types=[A,B] where B is dropped).
|
||||
|
||||
@@ -69,11 +69,17 @@ export function vmDisks(spec, getters, errors, validatorArgs, displayKey, value)
|
||||
validName(getters, errors, D.name, diskNames, prefix, type, lowerType, upperType);
|
||||
});
|
||||
|
||||
let hasBootableVolume = false;
|
||||
|
||||
_volumes.forEach((V, idx) => {
|
||||
const { type, typeValue } = getVolumeType(getters, V, _volumeClaimTemplates, value);
|
||||
|
||||
const prefix = V.name || idx + 1;
|
||||
|
||||
if ([SOURCE_TYPE.IMAGE, SOURCE_TYPE.ATTACH_VOLUME, SOURCE_TYPE.CONTAINER].includes(type)) {
|
||||
hasBootableVolume = true;
|
||||
}
|
||||
|
||||
if (type === SOURCE_TYPE.NEW || type === SOURCE_TYPE.IMAGE) {
|
||||
if (!/([1-9]|[1-9][0-9]+)[a-zA-Z]+/.test(typeValue?.spec?.resources?.requests?.storage)) {
|
||||
const key = getters['i18n/t']('harvester.fields.size');
|
||||
@@ -130,6 +136,13 @@ export function vmDisks(spec, getters, errors, validatorArgs, displayKey, value)
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* At least one bootable volume must be provided. (Verify only when create.)
|
||||
*/
|
||||
if (!hasBootableVolume && !value.links) {
|
||||
errors.push(getters['i18n/t']('harvester.validation.vm.volume.needAtLeastOneBootable'));
|
||||
}
|
||||
|
||||
return errors;
|
||||
}
|
||||
|
||||
|
||||
@@ -7,11 +7,7 @@ if (process.argv.length < 3) {
|
||||
}
|
||||
|
||||
const prTitle = process.argv[2];
|
||||
|
||||
// Parse the conventional-commit prefix `type(scope)!:`, keeping only the type
|
||||
// and dropping an optional scope and breaking-change marker.
|
||||
const prefixMatch = prTitle.match(/^\s*([a-zA-Z]+)(?:\([^)]*\))?!?:/);
|
||||
const prLabel = prefixMatch ? prefixMatch[1].toLowerCase() : '';
|
||||
const prLabel = prTitle.split(':')[0].trim();
|
||||
|
||||
const config = await load({ extends: ["./commitlint.config.js"] });
|
||||
const commitPrefix = config?.rules?.['type-enum']?.[2] || [];
|
||||
|
||||
@@ -2846,10 +2846,10 @@
|
||||
dependencies:
|
||||
"@types/node" "*"
|
||||
|
||||
"@types/node@*", "@types/node@25.3.3", "@types/node@25.9.5":
|
||||
version "25.9.5"
|
||||
resolved "https://registry.yarnpkg.com/@types/node/-/node-25.9.5.tgz#0fefc09e6e82e94cde291bacf43522e989eb01a4"
|
||||
integrity sha512-OScDchr2fwuUmWdf4kZ9h7PcJiYDVInhJizG/biAq3cAvqwYktuy/TYGGdZNMtNTFUP7rnb0NU4TUdm82kt4Rg==
|
||||
"@types/node@*", "@types/node@25.3.3", "@types/node@25.9.4":
|
||||
version "25.9.4"
|
||||
resolved "https://registry.yarnpkg.com/@types/node/-/node-25.9.4.tgz#18b63c47f88c1fbbed9d55ea2b66ffd494a47001"
|
||||
integrity sha512-dszCsrKb5U7ZsVZBWiHFklTloVl0mSEnWH/iZXfZUlI4rzCUnsvGmgqfuVRHL54ugE7/wRuxEIXRa2iMZ+BG6g==
|
||||
dependencies:
|
||||
undici-types ">=7.24.0 <7.24.7"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user