mirror of
https://github.com/harvester/harvester-ui-extension.git
synced 2026-11-15 05:16:16 +08:00
feat: align the storage performance options with the Rancher machine pool form (#1212)
* feat: align the storage performance options with the Rancher machine pool form
Show the storage performance profile on every volume instead of behind a
collapsible toggle, and move the VM-wide options to a plain Storage
Performance section in the Advanced Options tab. Put the Native I/O tip in
a live region so screen readers announce the cache mode change, use an
integer input for the I/O thread count, and use the same copy as the
Rancher form.
Skip the view-only backup row in the image and container volumes when it
has nothing to show, so it no longer adds an empty gap above the profile.
Signed-off-by: Marcelo Fukumoto <marcelo.fukumoto@suse.com>
* fix: announce the storage performance warnings and name the virtio requirement
- Put the bus tip and the Filesystem warning in an always-rendered status
region. They appear above the field being changed, so screen readers need
them announced.
- Say in the bus tip that a dedicated I/O thread needs the virtio bus, because
KubeVirt rejects it on any other bus.
- Mark I/O Thread Count as required while editing, like the Rancher form.
Signed-off-by: Marcelo Fukumoto <marcelo.fukumoto@suse.com>
* fix: state only the dedicated I/O thread requirement in the bus tip
Neither the Harvester docs nor KubeVirt tie cache mode or I/O mode to the bus,
so stop saying that those options work best on virtio.
Signed-off-by: Marcelo Fukumoto <marcelo.fukumoto@suse.com>
---------
Signed-off-by: Marcelo Fukumoto <marcelo.fukumoto@suse.com>
(cherry picked from commit 12c28c08fa)
# Conflicts:
# pkg/harvester/edit/kubevirt.io.virtualmachine/VirtualMachineVolume/DiskPerformanceOptions.vue
# pkg/harvester/edit/kubevirt.io.virtualmachine/VirtualMachineVolume/VMPerformanceOptions.vue
# pkg/harvester/edit/kubevirt.io.virtualmachine/VirtualMachineVolume/__tests__/DiskPerformanceOptions.test.ts
# pkg/harvester/edit/kubevirt.io.virtualmachine/VirtualMachineVolume/__tests__/VMPerformanceOptions.test.js
This commit is contained in:
+66
-70
@@ -1,5 +1,4 @@
|
||||
<script>
|
||||
import InfoBox from '@shell/components/InfoBox';
|
||||
import LabeledSelect from '@shell/components/form/LabeledSelect';
|
||||
import { LabeledInput } from '@components/Form/LabeledInput';
|
||||
import { Checkbox } from '@components/Form/Checkbox';
|
||||
@@ -11,7 +10,7 @@ export default {
|
||||
name: 'VMPerformanceOptions',
|
||||
|
||||
components: {
|
||||
InfoBox, LabeledSelect, LabeledInput, Checkbox, Banner
|
||||
LabeledSelect, LabeledInput, Checkbox, Banner
|
||||
},
|
||||
|
||||
emits: ['update:blockMultiQueue', 'update:ioThreadsPolicy', 'update:ioThreadCount'],
|
||||
@@ -50,12 +49,6 @@ export default {
|
||||
},
|
||||
},
|
||||
|
||||
data() {
|
||||
// These are specialist tuning options, so keep the panel collapsed unless the
|
||||
// VM already has something configured.
|
||||
return { expanded: !!(this.blockMultiQueue || this.ioThreadsPolicy) };
|
||||
},
|
||||
|
||||
computed: {
|
||||
isView() {
|
||||
return this.mode === _VIEW;
|
||||
@@ -87,31 +80,18 @@ export default {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<InfoBox
|
||||
<div
|
||||
v-if="storagePerformanceEnabled && (!isView || blockMultiQueue || !!ioThreadsPolicy)"
|
||||
class="vm-perf mt-10"
|
||||
class="vm-perf"
|
||||
>
|
||||
<button
|
||||
v-if="!isView"
|
||||
type="button"
|
||||
class="btn btn-sm role-link expand-toggle"
|
||||
:aria-expanded="expanded"
|
||||
:aria-label="expanded ? t('harvester.virtualMachine.volume.diskPerformance.collapse') : t('harvester.virtualMachine.volume.diskPerformance.expand')"
|
||||
@click.prevent="expanded = !expanded"
|
||||
>
|
||||
<i
|
||||
class="icon"
|
||||
:class="expanded ? 'icon-chevron-down' : 'icon-chevron-right'"
|
||||
/>
|
||||
{{ t('harvester.virtualMachine.volume.diskPerformance.title') }}
|
||||
</button>
|
||||
<h3
|
||||
v-else
|
||||
class="mb-5"
|
||||
>
|
||||
<h3>
|
||||
{{ t('harvester.virtualMachine.volume.diskPerformance.title') }}
|
||||
</h3>
|
||||
<p class="text-muted mb-10">
|
||||
{{ t('harvester.virtualMachine.volume.diskPerformance.description') }}
|
||||
</p>
|
||||
|
||||
<<<<<<< HEAD
|
||||
<template v-if="expanded || isView">
|
||||
<p class="text-muted mb-15 mt-10">
|
||||
{{ t('harvester.virtualMachine.volume.diskPerformance.description') }}
|
||||
@@ -136,38 +116,42 @@ export default {
|
||||
v-if="!hasVirtioDisk && !isView"
|
||||
color="info"
|
||||
:label="t('harvester.virtualMachine.volume.diskPerformance.blockMultiQueue.noVirtioTip')"
|
||||
=======
|
||||
<div
|
||||
class="mb-10"
|
||||
data-testid="input-vm-block-multi-queue"
|
||||
>
|
||||
<Checkbox
|
||||
:value="blockMultiQueue"
|
||||
:label="t('harvester.virtualMachine.volume.diskPerformance.blockMultiQueue.label')"
|
||||
:tooltip="t('harvester.virtualMachine.volume.diskPerformance.blockMultiQueue.tip')"
|
||||
:mode="mode"
|
||||
:disabled="!hasVirtioDisk"
|
||||
@update:value="$emit('update:blockMultiQueue', $event)"
|
||||
>>>>>>> 12c28c0 (feat: align the storage performance options with the Rancher machine pool form (#1212))
|
||||
/>
|
||||
</div>
|
||||
<Banner
|
||||
v-if="!hasVirtioDisk && !isView"
|
||||
color="info"
|
||||
label-key="harvester.virtualMachine.volume.diskPerformance.blockMultiQueue.noVirtioTip"
|
||||
/>
|
||||
|
||||
<div class="row mb-10">
|
||||
<div
|
||||
class="col span-6"
|
||||
data-testid="input-vm-iothreads-policy"
|
||||
>
|
||||
<LabeledSelect
|
||||
:value="ioThreadsPolicy"
|
||||
:label="t('harvester.virtualMachine.volume.diskPerformance.ioThreadsPolicy.label')"
|
||||
:tooltip="t('harvester.virtualMachine.volume.diskPerformance.ioThreadsPolicy.tip')"
|
||||
:options="ioThreadsPolicyOptions"
|
||||
:mode="mode"
|
||||
@update:value="$emit('update:ioThreadsPolicy', $event)"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
v-if="ioThreadsPolicy === 'supplementalPool'"
|
||||
class="col span-6"
|
||||
data-testid="input-vm-iothread-count"
|
||||
>
|
||||
<LabeledInput
|
||||
type="number"
|
||||
min="1"
|
||||
:value="ioThreadCount"
|
||||
:label="t('harvester.virtualMachine.volume.diskPerformance.ioThreadCount.label')"
|
||||
:tooltip="t('harvester.virtualMachine.volume.diskPerformance.ioThreadCount.tip')"
|
||||
:mode="mode"
|
||||
@update:value="$emit('update:ioThreadCount', Number($event))"
|
||||
/>
|
||||
</div>
|
||||
<div class="row mb-20">
|
||||
<div
|
||||
class="col span-6"
|
||||
data-testid="input-vm-iothreads-policy"
|
||||
>
|
||||
<LabeledSelect
|
||||
:value="ioThreadsPolicy"
|
||||
:label="t('harvester.virtualMachine.volume.diskPerformance.ioThreadsPolicy.label')"
|
||||
:tooltip="t('harvester.virtualMachine.volume.diskPerformance.ioThreadsPolicy.tip')"
|
||||
:options="ioThreadsPolicyOptions"
|
||||
:mode="mode"
|
||||
@update:value="$emit('update:ioThreadsPolicy', $event)"
|
||||
/>
|
||||
</div>
|
||||
<<<<<<< HEAD
|
||||
<Banner
|
||||
v-if="hasDedicatedIothread && !ioThreadsPolicy"
|
||||
color="info"
|
||||
@@ -175,17 +159,29 @@ export default {
|
||||
/>
|
||||
</template>
|
||||
</InfoBox>
|
||||
=======
|
||||
<div
|
||||
v-if="ioThreadsPolicy === 'supplementalPool'"
|
||||
class="col span-6"
|
||||
data-testid="input-vm-iothread-count"
|
||||
>
|
||||
<LabeledInput
|
||||
type="integer"
|
||||
min="1"
|
||||
:required="!isView"
|
||||
:value="ioThreadCount"
|
||||
:label="t('harvester.virtualMachine.volume.diskPerformance.ioThreadCount.label')"
|
||||
:tooltip="t('harvester.virtualMachine.volume.diskPerformance.ioThreadCount.tip')"
|
||||
:mode="mode"
|
||||
@update:value="$emit('update:ioThreadCount', Number($event))"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<Banner
|
||||
v-if="hasDedicatedIothread && !ioThreadsPolicy"
|
||||
color="info"
|
||||
label-key="harvester.virtualMachine.volume.diskPerformance.ioThreadsPolicy.autoEnabledTip"
|
||||
/>
|
||||
</div>
|
||||
>>>>>>> 12c28c0 (feat: align the storage performance options with the Rancher machine pool form (#1212))
|
||||
</template>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.vm-perf {
|
||||
.expand-toggle {
|
||||
padding: 0;
|
||||
font-weight: 600;
|
||||
|
||||
.icon {
|
||||
margin-right: 4px;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user