mirror of
https://github.com/harvester/harvester-ui-extension.git
synced 2026-10-01 03:36:04 +08:00
Compare commits
16
Commits
v1.9.0-rc2
...
v1.9.0-rc3
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8815c70361 | ||
|
|
eb4c0504c8 | ||
|
|
82e7b0da19 | ||
|
|
92f34fa64f | ||
|
|
6039f21320 | ||
|
|
3cbaf97399 | ||
|
|
bcde1744e1 | ||
|
|
e991c9bcc8 | ||
|
|
6e709bc00f | ||
|
|
20d40860ce | ||
|
|
1496c17f3d | ||
|
|
e99e4ef34f | ||
|
|
73e022172b | ||
|
|
7e86c9fae0 | ||
|
|
b4b49222c3 | ||
|
|
b937a2147b |
@@ -1,14 +1,19 @@
|
||||
<!-- 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 Checklists
|
||||
|
||||
### PR Checklist
|
||||
<!-- Check Yes if there is backend PR related to this UI PR, tag the backend owner's Github account -->
|
||||
- Are backend engineers aware of UI changes ?
|
||||
- [ ] Yes, the backend owner is:
|
||||
- [ ] Yes, the backend owner is @
|
||||
- [ ] No, frontend-only.
|
||||
|
||||
### Related Issue #
|
||||
<!-- Define findings related to the feature or bug issue. -->
|
||||
<!-- Link the issue as harvester/harvester#<issue_number> -->
|
||||
harvester/harvester#<issue_number>
|
||||
|
||||
### Test screenshot or video
|
||||
|
||||
### Test screenshot or video (Required)
|
||||
<!-- Attach screenshot or video of the changes and eventual comparison if you find it necessary -->
|
||||
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
> This `./AGENTS.md` file is generated by running `yarn agents:generate`.
|
||||
> 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.
|
||||
|
||||
|
||||
# Project Overview
|
||||
@@ -28,9 +28,7 @@ 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.
|
||||
@@ -130,8 +128,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.
|
||||
- Place source tag above template above style.
|
||||
- style tag should contain `lang='scss' scoped`.
|
||||
- Order the Single File Component blocks as `<script>`, then `<template>`, then `<style>`.
|
||||
- The `<style>` tag should include `lang="scss" scoped`.
|
||||
- `Linting`: Follow the ESLint configuration in the root.
|
||||
|
||||
- **File Structure:**
|
||||
@@ -163,24 +161,26 @@ To get started, follow the `Development Setup` section.
|
||||
|
||||
## Harvester UI Extension Development Guide
|
||||
|
||||
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.
|
||||
### 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
|
||||
|
||||
2. Implementation Steps for New Features
|
||||
To add a feature in a new release, follow these steps:
|
||||
|
||||
Register: Add a unique [Feature Name] to the corresponding release array in the configuration.
|
||||
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:
|
||||
|
||||
Check: Use the following getter to verify if the feature is enabled for the current version:
|
||||
```js
|
||||
computed: {
|
||||
newFeatureEnabled() {
|
||||
return this.$store.getters['harvester-common/getFeatureEnabled']('[Feature Name]');
|
||||
},
|
||||
},
|
||||
```
|
||||
|
||||
```
|
||||
computed: {
|
||||
newFeatureEnabled() {
|
||||
return this.$store.getters['harvester-common/getFeatureEnabled']('[Feature Name]');
|
||||
},
|
||||
},
|
||||
```
|
||||
Render: Use the result of the check to conditionally render the UI components.
|
||||
3. **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>[optional scope]: <description>
|
||||
<type>: <description>
|
||||
|
||||
[optional body]
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ For Harvester UI extension installation instructions, please refer to the page *
|
||||
|
||||
## Development Setup
|
||||
|
||||
Ensure **Node.js v20 or later** is installed for development and debugging.
|
||||
Ensure **Node.js v24 or later** is installed for development and debugging.
|
||||
|
||||
### Standalone Mode
|
||||
|
||||
|
||||
@@ -32,6 +32,7 @@ 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,9 +6,7 @@
|
||||
- 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.
|
||||
- Place source tag above template above style.
|
||||
- style tag should contain `lang='scss' scoped`.
|
||||
- Order the Single File Component blocks as `<script>`, then `<template>`, then `<style>`.
|
||||
- The `<style>` tag should include `lang="scss" scoped`.
|
||||
- `Linting`: Follow the ESLint configuration in the root.
|
||||
|
||||
- **File Structure:**
|
||||
@@ -49,22 +49,24 @@ To get started, follow the `Development Setup` section.
|
||||
|
||||
## Harvester UI Extension Development Guide
|
||||
|
||||
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.
|
||||
### 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
|
||||
|
||||
2. Implementation Steps for New Features
|
||||
To add a feature in a new release, follow these steps:
|
||||
|
||||
Register: Add a unique [Feature Name] to the corresponding release array in the configuration.
|
||||
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:
|
||||
|
||||
Check: Use the following getter to verify if the feature is enabled for the current version:
|
||||
```js
|
||||
computed: {
|
||||
newFeatureEnabled() {
|
||||
return this.$store.getters['harvester-common/getFeatureEnabled']('[Feature Name]');
|
||||
},
|
||||
},
|
||||
```
|
||||
|
||||
```
|
||||
computed: {
|
||||
newFeatureEnabled() {
|
||||
return this.$store.getters['harvester-common/getFeatureEnabled']('[Feature Name]');
|
||||
},
|
||||
},
|
||||
```
|
||||
Render: Use the result of the check to conditionally render the UI components.
|
||||
3. **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>[optional scope]: <description>
|
||||
<type>: <description>
|
||||
|
||||
[optional body]
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
> This `./AGENTS.md` file is generated by running `yarn agents:generate`.
|
||||
> 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.
|
||||
|
||||
|
||||
# Project Overview
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "harvester-ui-extension",
|
||||
"version": "1.9.0-rc2",
|
||||
"version": "1.9.0-rc3",
|
||||
"private": false,
|
||||
"engines": {
|
||||
"node": ">=24.0.0"
|
||||
@@ -21,7 +21,7 @@
|
||||
"yaml": "^2.5.1"
|
||||
},
|
||||
"resolutions": {
|
||||
"@types/node": "25.9.4",
|
||||
"@types/node": "25.9.5",
|
||||
"cronstrue": "2.59.0",
|
||||
"d3-color": "3.1.0",
|
||||
"ejs": "3.1.10",
|
||||
|
||||
@@ -55,8 +55,12 @@ 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);
|
||||
},
|
||||
@@ -154,14 +158,23 @@ export default {
|
||||
:cluster="currentCluster.nameDisplay"
|
||||
/>
|
||||
</h1>
|
||||
<button
|
||||
v-if="versionOptions.length && !isUpgradeInProgress"
|
||||
type="button"
|
||||
class="btn bg-warning btn-sm"
|
||||
@click="open"
|
||||
<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"
|
||||
>
|
||||
<t k="harvester.upgradePage.upgrade" />
|
||||
</button>
|
||||
<button
|
||||
:disabled="!canUpgrade"
|
||||
type="button"
|
||||
class="btn bg-warning btn-sm"
|
||||
@click="open"
|
||||
>
|
||||
<t k="harvester.upgradePage.upgrade" />
|
||||
</button>
|
||||
</span>
|
||||
</header>
|
||||
|
||||
<ModalWithCard
|
||||
@@ -296,6 +309,18 @@ 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;
|
||||
|
||||
@@ -5,8 +5,10 @@ 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 {
|
||||
@@ -30,20 +32,41 @@ 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 NAMESPACE = FORKLIFT_NAMESPACE;
|
||||
const TARGET_NAMESPACE = 'default';
|
||||
const NS = FORKLIFT_NAMESPACE;
|
||||
|
||||
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(() => {
|
||||
@@ -103,13 +126,13 @@ const startMigrationAction = async() => {
|
||||
apiVersion: FORKLIFT_API_VERSION,
|
||||
kind: 'Provider',
|
||||
name: props.providerName,
|
||||
namespace: NAMESPACE,
|
||||
namespace: NS,
|
||||
},
|
||||
destination: {
|
||||
apiVersion: FORKLIFT_API_VERSION,
|
||||
kind: 'Provider',
|
||||
name: 'host',
|
||||
namespace: NAMESPACE,
|
||||
namespace: NS,
|
||||
},
|
||||
};
|
||||
|
||||
@@ -118,15 +141,15 @@ const startMigrationAction = async() => {
|
||||
|
||||
const networkMap = await store.dispatch(`${ inStore }/create`, {
|
||||
type: HCI.FORKLIFT_NETWORK_MAP,
|
||||
metadata: { name: networkMapName, namespace: NAMESPACE },
|
||||
spec: { map: buildNetworkMapEntries(props.mappingEntries?.networkEntries || [], NAMESPACE), provider: providerRef },
|
||||
metadata: { name: networkMapName, namespace: NS },
|
||||
spec: { map: buildNetworkMapEntries(props.mappingEntries?.networkEntries || [], NS), provider: providerRef },
|
||||
});
|
||||
|
||||
await networkMap.save();
|
||||
|
||||
const storageMap = await store.dispatch(`${ inStore }/create`, {
|
||||
type: HCI.FORKLIFT_STORAGE_MAP,
|
||||
metadata: { name: storageMapName, namespace: NAMESPACE },
|
||||
metadata: { name: storageMapName, namespace: NS },
|
||||
spec: { map: buildStorageMapEntries(props.mappingEntries?.storageEntries || []), provider: providerRef },
|
||||
});
|
||||
|
||||
@@ -134,7 +157,7 @@ const startMigrationAction = async() => {
|
||||
|
||||
const plan = await store.dispatch(`${ inStore }/create`, {
|
||||
type: HCI.FORKLIFT_PLAN,
|
||||
metadata: { name: planName.value, namespace: NAMESPACE },
|
||||
metadata: { name: planName.value, namespace: NS },
|
||||
spec: {
|
||||
provider: providerRef,
|
||||
map: {
|
||||
@@ -142,16 +165,16 @@ const startMigrationAction = async() => {
|
||||
apiVersion: FORKLIFT_API_VERSION,
|
||||
kind: 'NetworkMap',
|
||||
name: networkMapName,
|
||||
namespace: NAMESPACE,
|
||||
namespace: NS,
|
||||
},
|
||||
storage: {
|
||||
apiVersion: FORKLIFT_API_VERSION,
|
||||
kind: 'StorageMap',
|
||||
name: storageMapName,
|
||||
namespace: NAMESPACE,
|
||||
namespace: NS,
|
||||
},
|
||||
},
|
||||
targetNamespace: TARGET_NAMESPACE,
|
||||
targetNamespace: targetNamespace.value,
|
||||
vms: vms.value.map((vm) => ({ id: vm.id, name: vm.name || vm.id })),
|
||||
warm: false,
|
||||
},
|
||||
@@ -177,9 +200,19 @@ const startMigrationAction = async() => {
|
||||
await plan.startMigration();
|
||||
};
|
||||
|
||||
const init = () => {
|
||||
const init = async() => {
|
||||
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,
|
||||
@@ -216,9 +249,18 @@ defineExpose({ startMigration: startMigrationAction });
|
||||
<h3 class="section-title m-0">
|
||||
{{ t('harvester.addons.vmMigration.reviewMigration.migrationDetails') }}
|
||||
</h3>
|
||||
<div class="span-9">
|
||||
<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
|
||||
/>
|
||||
<LabeledInput
|
||||
v-model:value="planName"
|
||||
class="name-input"
|
||||
:label="t('harvester.addons.vmMigration.reviewMigration.planName')"
|
||||
:placeholder="t('harvester.addons.vmMigration.reviewMigration.planNamePlaceholder')"
|
||||
required
|
||||
@@ -244,7 +286,7 @@ defineExpose({ startMigration: startMigrationAction });
|
||||
<span class="detail-label">{{ t('harvester.addons.vmMigration.reviewMigration.targetNamespace') }}</span>
|
||||
</div>
|
||||
<div class="detail-item">
|
||||
<span class="detail-value">{{ TARGET_NAMESPACE }}</span>
|
||||
<span class="detail-value">{{ targetNamespace }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="detail-column">
|
||||
@@ -301,7 +343,7 @@ defineExpose({ startMigration: startMigrationAction });
|
||||
</span>
|
||||
</div>
|
||||
<MappingsCell
|
||||
:network-entries="vm.networkMappings.map(m => `${m.source} → ${m.target}`)"
|
||||
:network-entries="vm.networkMappings.map(m => `${m.source} → ${formatNetworkTarget(m.target)}`)"
|
||||
:storage-entries="vm.storageMappings.map(m => `${m.source} → ${m.target}`)"
|
||||
/>
|
||||
</div>
|
||||
@@ -347,6 +389,22 @@ 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;
|
||||
|
||||
@@ -86,4 +86,5 @@ export const HCI = {
|
||||
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: 'left',
|
||||
align: 'center',
|
||||
};
|
||||
|
||||
// Plan reference column in forklift.konveyor.io.migration list page
|
||||
|
||||
@@ -0,0 +1,133 @@
|
||||
<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>
|
||||
@@ -93,6 +93,9 @@ 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 {
|
||||
@@ -484,6 +487,20 @@ 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);
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
<script>
|
||||
import ConsumptionGauge from '@shell/components/ConsumptionGauge';
|
||||
import PercentageBar from '@shell/components/PercentageBar';
|
||||
import { METRIC, NODE } from '@shell/config/types';
|
||||
import { parseSi } from '@shell/utils/units';
|
||||
|
||||
export default {
|
||||
name: 'HarvesterCpuUsed',
|
||||
components: { ConsumptionGauge },
|
||||
components: { PercentageBar },
|
||||
|
||||
props: {
|
||||
value: {
|
||||
@@ -74,54 +74,89 @@ 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>
|
||||
<ConsumptionGauge
|
||||
:capacity="cpuTotal"
|
||||
:used="reserved"
|
||||
:units="cpuUnits"
|
||||
:resource-name="resourceName"
|
||||
>
|
||||
<template #title="{amountTemplateValues, formattedPercentage}">
|
||||
<span>
|
||||
<div class="consumption-gauge">
|
||||
<div class="numbers">
|
||||
<span class="mr-5">
|
||||
{{ t('harvester.formatters.hardwareResourceGauge.reserved') }}
|
||||
</span>
|
||||
<span class="precent-data">
|
||||
{{ t('node.detail.glance.consumptionGauge.amount', amountTemplateValues) }}
|
||||
<span class="ml-10 percentage">/ {{ formattedPercentage }}
|
||||
</span>
|
||||
{{ t('node.detail.glance.consumptionGauge.amount', reservedAmountTemplateValues) }}
|
||||
</span>
|
||||
</template>
|
||||
</ConsumptionGauge>
|
||||
</div>
|
||||
<div class="mt-10">
|
||||
<PercentageBar
|
||||
:model-value="reservedPercentage"
|
||||
show-percentage
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
v-if="showUsed"
|
||||
class="mt-10"
|
||||
class="consumption-gauge mt-10"
|
||||
>
|
||||
<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 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>
|
||||
</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,11 +1,11 @@
|
||||
<script>
|
||||
import ConsumptionGauge from '@shell/components/ConsumptionGauge';
|
||||
import PercentageBar from '@shell/components/PercentageBar';
|
||||
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: { ConsumptionGauge },
|
||||
components: { PercentageBar },
|
||||
|
||||
props: {
|
||||
value: {
|
||||
@@ -76,6 +76,30 @@ 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: {
|
||||
@@ -96,50 +120,53 @@ export default {
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<ConsumptionGauge
|
||||
:capacity="memoryTotal"
|
||||
:used="reserved"
|
||||
:units="memoryUnits"
|
||||
:number-formatter="memoryFormatter"
|
||||
:resource-name="resourceName"
|
||||
>
|
||||
<template #title="{amountTemplateValues, formattedPercentage}">
|
||||
<span>
|
||||
<div class="consumption-gauge">
|
||||
<div class="numbers">
|
||||
<span class="mr-10">
|
||||
{{ t('harvester.formatters.hardwareResourceGauge.reserved') }}
|
||||
</span>
|
||||
<span class="precent-data">
|
||||
{{ t('node.detail.glance.consumptionGauge.amount', amountTemplateValues) }}
|
||||
<span class="ml-10 percentage">/ {{ formattedPercentage }}
|
||||
</span>
|
||||
{{ t('node.detail.glance.consumptionGauge.amount', reservedAmountTemplateValues) }}
|
||||
</span>
|
||||
</template>
|
||||
</ConsumptionGauge>
|
||||
</div>
|
||||
<div class="mt-10">
|
||||
<PercentageBar
|
||||
:model-value="reservedPercentage"
|
||||
show-percentage
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
v-if="showUsed"
|
||||
class="mt-10"
|
||||
class="consumption-gauge mt-10"
|
||||
>
|
||||
<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 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>
|
||||
</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 ConsumptionGauge from '@shell/components/ConsumptionGauge';
|
||||
import PercentageBar from '@shell/components/PercentageBar';
|
||||
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: { ConsumptionGauge },
|
||||
components: { PercentageBar },
|
||||
|
||||
props: {
|
||||
value: {
|
||||
@@ -120,6 +120,14 @@ 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: {
|
||||
@@ -144,53 +152,54 @@ export default {
|
||||
<div>
|
||||
<div
|
||||
v-if="showAllocated"
|
||||
class="consumption-gauge"
|
||||
>
|
||||
<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 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>
|
||||
</div>
|
||||
<ConsumptionGauge
|
||||
:capacity="storageStats.maximum"
|
||||
:used="storageStats.used"
|
||||
:units="usedUnits"
|
||||
:number-formatter="formatter"
|
||||
:resource-name="showAllocated ? '' : resourceName"
|
||||
:class="{
|
||||
'mt-10': showAllocated,
|
||||
}"
|
||||
<div
|
||||
class="consumption-gauge"
|
||||
:class="{ 'mt-10': showAllocated }"
|
||||
>
|
||||
<template #title="{formattedPercentage}">
|
||||
<div class="numbers">
|
||||
<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>
|
||||
</template>
|
||||
</ConsumptionGauge>
|
||||
</div>
|
||||
<div class="mt-10">
|
||||
<PercentageBar
|
||||
:model-value="usedPercentage"
|
||||
show-percentage
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.consumption-gauge {
|
||||
.numbers {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
}
|
||||
}
|
||||
|
||||
.precent-data {
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
@@ -331,7 +331,8 @@ harvester:
|
||||
message: Message
|
||||
phase: Phase
|
||||
attachedVM: Attached Virtual Machine
|
||||
cpuManager: CPU Manager
|
||||
cpuManager: CPU<br>Manager
|
||||
diskState: Disk
|
||||
routeConnectivityTooltip: Connectivity between the VM network and the management network, which the Harvester nodes are connected to.
|
||||
fingerprint: Fingerprint
|
||||
value: Value
|
||||
@@ -487,7 +488,6 @@ 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.'
|
||||
@@ -1099,6 +1099,8 @@ 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.
|
||||
@@ -1836,6 +1838,7 @@ harvester:
|
||||
unknown: Unknown
|
||||
identifier: Identifier
|
||||
podNetwork: Pod Network
|
||||
ignored: Ignored
|
||||
usedBy: "Used by:"
|
||||
vlan: "VLAN {id}"
|
||||
vCpu: "{count} vCPU"
|
||||
@@ -1954,8 +1957,9 @@ harvester:
|
||||
initializingMigration: Initializing migration
|
||||
finishedSuccessfully: Finished Successfully
|
||||
step: "Step {index}"
|
||||
vmCount: "{count} VMs"
|
||||
vmCount: "{count, plural, one {# VM} other {# 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
|
||||
@@ -1969,7 +1973,7 @@ harvester:
|
||||
template: Use existing network mapping as template
|
||||
options:
|
||||
podNetworking: Management Network
|
||||
ignored: Ignored
|
||||
ignored: Ignored (No NIC will be created)
|
||||
storageMapping:
|
||||
title: Storage Mapping
|
||||
description: Map VMware datastores to Harvester storage classes
|
||||
@@ -1986,7 +1990,8 @@ harvester:
|
||||
memory: Memory
|
||||
storage: Storage
|
||||
source: Source
|
||||
targetNamespace: Target Namespace
|
||||
targetNamespace: Namespace
|
||||
targetNamespacePlaceholder: "Select target namespace"
|
||||
migrationMode: Migration Mode
|
||||
coldMigration: Cold Migration
|
||||
virtualMachines: Virtual Machines
|
||||
@@ -2254,6 +2259,12 @@ 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,6 +86,13 @@ 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',
|
||||
|
||||
@@ -84,7 +84,7 @@ export default {
|
||||
},
|
||||
{
|
||||
...NAME,
|
||||
width: 130,
|
||||
width: 150,
|
||||
},
|
||||
{
|
||||
name: 'host-ip',
|
||||
@@ -136,14 +136,14 @@ export default {
|
||||
value: 'id',
|
||||
formatter: 'HarvesterCPUPinning',
|
||||
formatterOpts: { rows: this.rows },
|
||||
width: 150,
|
||||
width: 75,
|
||||
align: 'center',
|
||||
});
|
||||
}
|
||||
if (this.hasLonghornSchema) {
|
||||
out.push({
|
||||
name: 'diskState',
|
||||
labelKey: 'tableHeaders.diskState',
|
||||
labelKey: 'harvester.tableHeaders.diskState',
|
||||
value: 'diskState',
|
||||
formatter: 'HarvesterDiskState',
|
||||
width: 130,
|
||||
@@ -156,7 +156,6 @@ export default {
|
||||
name: 'console',
|
||||
label: ' ',
|
||||
align: 'right',
|
||||
width: 80,
|
||||
});
|
||||
|
||||
return out;
|
||||
@@ -239,6 +238,8 @@ export default {
|
||||
v-if="!row.consoleUrl"
|
||||
:href="consoleDocLink"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
class="console-info"
|
||||
><i class="icon icon-info" /></a>
|
||||
</div>
|
||||
</template>
|
||||
@@ -249,5 +250,13 @@ 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>
|
||||
|
||||
@@ -162,6 +162,12 @@ 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,
|
||||
@@ -866,18 +872,30 @@ export default {
|
||||
}
|
||||
});
|
||||
|
||||
if (this.needNewSecret || !this.secretName) {
|
||||
// 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)) {
|
||||
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.
|
||||
if (hasSysprepContent && !this.sysprep.secretName?.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) {
|
||||
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.
|
||||
@@ -896,7 +914,7 @@ export default {
|
||||
}
|
||||
}
|
||||
|
||||
if (!disks.find( (D) => D.name === 'cloudinitdisk') && (this.userData || this.networkData)) {
|
||||
if (!disks.find( (D) => D.name === 'cloudinitdisk') && (this.userData || this.networkScript)) {
|
||||
if (!this.isWindows) {
|
||||
disks.push({
|
||||
name: 'cloudinitdisk',
|
||||
|
||||
@@ -69,16 +69,15 @@ export default class SRIOVDevice extends SteveModel {
|
||||
return this.spec.enabled && this.status?.vfAddresses?.length > 0 && this.status?.vGPUDevices?.length > 0;
|
||||
}
|
||||
|
||||
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 });
|
||||
}
|
||||
get isTimesliced() {
|
||||
return this.metadata?.annotations?.[HCI_ANNOTATIONS.SKIP_MIG_CONFIGURATION] === 'true';
|
||||
}
|
||||
|
||||
enableDevice() {
|
||||
this.$dispatch('promptModal', {
|
||||
resources: [this],
|
||||
component: 'EnableSriovGpuDevice'
|
||||
});
|
||||
}
|
||||
|
||||
async disableDevice() {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "harvester",
|
||||
"description": "Rancher UI Extension for Harvester",
|
||||
"version": "1.9.0-rc2",
|
||||
"version": "1.9.0-rc3",
|
||||
"private": false,
|
||||
"rancher": {
|
||||
"annotations": {
|
||||
|
||||
@@ -37,6 +37,7 @@ 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('&', '&')
|
||||
@@ -98,12 +99,12 @@ const formatPipelineTooltip = (pipeline = []) => {
|
||||
};
|
||||
|
||||
const formatDuration = (started, completed) => {
|
||||
if (!started || !completed) {
|
||||
if (!started) {
|
||||
return { display: null, seconds: -1 };
|
||||
}
|
||||
|
||||
const startMs = new Date(started).getTime();
|
||||
const endMs = new Date(completed).getTime();
|
||||
const endMs = completed ? new Date(completed).getTime() : Date.now();
|
||||
|
||||
if (isNaN(startMs) || isNaN(endMs) || endMs < startMs) {
|
||||
return { display: null, seconds: -1 };
|
||||
@@ -129,8 +130,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 || '-' } → ${ 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.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.vmIdsDisplay = (plan.spec?.vms || []).map((vm) => vm.id || vm.name || '').filter(Boolean).join(', ') || '-';
|
||||
|
||||
@@ -183,6 +184,24 @@ 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 || '',
|
||||
@@ -191,6 +210,7 @@ const rows = computed(() => {
|
||||
pipelineTooltip: formatPipelineTooltip(pipeline),
|
||||
errorMsg,
|
||||
canceled: plan.planCanceled,
|
||||
vmDetailLocation,
|
||||
};
|
||||
});
|
||||
|
||||
@@ -248,7 +268,7 @@ const headers = [
|
||||
labelKey: 'harvester.addons.vmMigration.dashboard.columns.duration',
|
||||
value: 'duration',
|
||||
sort: 'durationSeconds',
|
||||
width: 120,
|
||||
width: 90,
|
||||
},
|
||||
{ ...AGE },
|
||||
];
|
||||
@@ -283,6 +303,17 @@ const init = async() => {
|
||||
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 {
|
||||
@@ -366,7 +397,17 @@ init();
|
||||
>
|
||||
<div class="vm-progress-header">
|
||||
<div class="vm-name-block">
|
||||
<span class="vm-name">{{ vm.vmName }}</span>
|
||||
<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="text-muted vm-id">{{ t('harvester.addons.vmMigration.dashboard.progress.vmId', { id: vm.vmId }) }}</span>
|
||||
</div>
|
||||
</div>
|
||||
@@ -457,6 +498,14 @@ 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 {
|
||||
|
||||
@@ -56,7 +56,7 @@ const stepData = reactive({
|
||||
networkEntries: [],
|
||||
storageEntries: [],
|
||||
},
|
||||
review: { planName: '' },
|
||||
review: { planName: '', targetNamespace: '' },
|
||||
});
|
||||
|
||||
const steps = reactive([
|
||||
|
||||
@@ -69,17 +69,11 @@ 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');
|
||||
@@ -136,13 +130,6 @@ 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,7 +7,11 @@ if (process.argv.length < 3) {
|
||||
}
|
||||
|
||||
const prTitle = process.argv[2];
|
||||
const prLabel = prTitle.split(':')[0].trim();
|
||||
|
||||
// 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 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.4":
|
||||
version "25.9.4"
|
||||
resolved "https://registry.yarnpkg.com/@types/node/-/node-25.9.4.tgz#18b63c47f88c1fbbed9d55ea2b66ffd494a47001"
|
||||
integrity sha512-dszCsrKb5U7ZsVZBWiHFklTloVl0mSEnWH/iZXfZUlI4rzCUnsvGmgqfuVRHL54ugE7/wRuxEIXRa2iMZ+BG6g==
|
||||
"@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==
|
||||
dependencies:
|
||||
undici-types ">=7.24.0 <7.24.7"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user