feat: add disable resource pooling checkbox on pcidevice page (#902)

Signed-off-by: Jack Yu <jack.yu@suse.com>
This commit is contained in:
Jack Yu 2026-06-05 11:18:14 +08:00 committed by GitHub
parent b4ea7c8f98
commit ae65037083
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 32 additions and 6 deletions

View File

@ -71,6 +71,7 @@ const FEATURE_FLAGS = {
'v1.8.1': [], 'v1.8.1': [],
'v1.9.0': [ 'v1.9.0': [
'supportFilesystem', 'supportFilesystem',
'disableResourcePooling',
], ],
}; };

View File

@ -1,6 +1,8 @@
<script> <script>
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
import { Banner } from '@components/Banner';
import { Card } from '@components/Card'; import { Card } from '@components/Card';
import { Checkbox } from '@components/Form/Checkbox';
import AsyncButton from '@shell/components/AsyncButton'; import AsyncButton from '@shell/components/AsyncButton';
import { escapeHtml } from '@shell/utils/string'; import { escapeHtml } from '@shell/utils/string';
import { HCI } from '../types'; import { HCI } from '../types';
@ -13,7 +15,9 @@ export default {
components: { components: {
AsyncButton, AsyncButton,
Banner,
Card, Card,
Checkbox,
}, },
props: { props: {
@ -24,10 +28,16 @@ export default {
}, },
data() { data() {
return {}; return { disableResourcePooling: false };
}, },
computed: { ...mapGetters({ t: 'i18n/t' }) }, computed: {
...mapGetters({ t: 'i18n/t' }),
disableResourcePoolingEnabled() {
return this.$store.getters['harvester-common/getFeatureEnabled']('disableResourcePooling');
},
},
methods: { methods: {
close() { close() {
@ -52,9 +62,10 @@ export default {
}] }]
}, },
spec: { spec: {
address: actionResource.status.address, address: actionResource.status.address,
nodeName: actionResource.status.nodeName, nodeName: actionResource.status.nodeName,
userName userName,
disableResourcePooling: this.disableResourcePooling,
} }
} ); } );
@ -85,7 +96,19 @@ export default {
</template> </template>
<template #body> <template #body>
{{ t('harvester.pci.enablePassthroughWarning') }} <p class="mb-20">
{{ t('harvester.pci.enablePassthroughWarning') }}
</p>
<template v-if="disableResourcePoolingEnabled">
<Checkbox
v-model:value="disableResourcePooling"
label-key="harvester.pci.disableResourcePooling"
/>
<Banner
color="info"
:label="t('harvester.pci.disableResourcePoolingDescription')"
/>
</template>
</template> </template>
<template #actions> <template #actions>

View File

@ -409,6 +409,8 @@ harvester:
suffix: to enable the add-on to successfully manage your PCI devices. suffix: to enable the add-on to successfully manage your PCI devices.
noPCIPermission: Please contact your system administrator to enable the PCI devices first. noPCIPermission: Please contact your system administrator to enable the PCI devices first.
enablePassthroughWarning: Please be careful not to use host-owned PCI devices (e.g., management and VLAN NICs). Incorrect device allocation may cause damage to your cluster, including node failure. enablePassthroughWarning: Please be careful not to use host-owned PCI devices (e.g., management and VLAN NICs). Incorrect device allocation may cause damage to your cluster, including node failure.
disableResourcePooling: Disable Resource Pooling
disableResourcePoolingDescription: Assigns this device a unique resource name so it can be pinned to a specific VM, instead of sharing the pool with other identical devices.
devices: devices:
matrixHostName: Host Name matrixHostName: Host Name