Skip to content

feat(lite): add ability to forget a PIF from the network table - #10239

Open
amouillard-vates wants to merge 15 commits into
masterfrom
xo6-lite/network-delete-pif
Open

amouillard-vates wants to merge 15 commits into
masterfrom
xo6-lite/network-delete-pif

Conversation

@amouillard-vates

@amouillard-vates amouillard-vates commented Aug 6, 2026 •

Copy link
Copy Markdown
Collaborator

Description

Adds ability to forget a PIF from the host > network > PIFs table / sidepanel on xo-lite
("delete" has been renamed "forget")

Capture d’écran 2026-08-12 à 10 51 29 Capture d’écran 2026-08-12 à 10 51 37 Capture d’écran 2026-09-30 à 14 56 26 Capture d’écran 2026-09-30 à 14 56 27

Checklist

  • Commit
    • Title follows commit conventions
    • Reference the relevant issue (Fixes #007, See xoa-support#42, See https://...)
    • If bug fix, add Introduced by
  • Changelog
    • If visible by XOA users, add changelog entry
    • Update "Packages to release" in CHANGELOG.unreleased.md
  • PR
    • If UI changes, add screenshots
    • If not finished or not tested, open as Draft

Review process

If you are an external contributor, you can skip this part. Simply create the pull request, and we'll get back to you as soon as possible.

This 2-passes review process aims to:

  • develop skills of junior reviewers
  • limit the workload for senior reviewers
  • limit the number of unnecessary changes by the author
  1. The author creates a PR.
  2. Review process:
    1. The author assigns the junior reviewer.
    2. The junior reviewer conducts their review:
      • Resolves their comments if they are addressed.
      • Adds comments if necessary or approves the PR.
    3. The junior reviewer assigns the senior reviewer.
    4. The senior reviewer conducts their review:
      • If there are no unresolved comments on the PR → merge.
      • Otherwise, we continue with 3.
  3. The author responds to comments and/or makes corrections, and we go back to 2.

Notes:

  1. The author can request a review at any time, even if the PR is still a Draft.
  2. In theory, there should not be more than one reviewer at a time.
  3. The author should not make any changes:
    • When a reviewer is assigned.
    • Between the junior and senior reviews.
  4. If the PR relates to a change in the openAPI specification, a member of the DevOps team must also participate in the review.

Comment thread @xen-orchestra/lite/src/libs/xen-api/operations/pif-operations.ts Outdated
Comment thread @xen-orchestra/lite/src/components/host/network/HostPifSidePanel.vue Outdated
Comment thread @xen-orchestra/lite/src/components/host/network/HostPifSidePanel.vue Outdated
Comment thread @xen-orchestra/lite/src/components/host/network/HostPifSidePanel.vue Outdated
Comment thread @xen-orchestra/lite/src/jobs/args.ts Outdated
Comment thread @xen-orchestra/lite/src/jobs/pif-forget.job.ts Outdated
Comment thread @xen-orchestra/lite/src/jobs/pif-forget.job.ts Outdated
Comment thread @xen-orchestra/lite/src/libs/xen-api/operations/pif-operations.ts Outdated
Comment thread @xen-orchestra/lite/src/jobs/pif-forget.job.ts Outdated
Comment thread @xen-orchestra/web-core/lib/components/modal/VtsForgetModal.vue
@@ -0,0 +1,11 @@
import { useOverlay } from '@core/packages/overlay/use-overlay.ts'

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same remark as for the modal

Comment thread @xen-orchestra/web-core/lib/locales/en.json Outdated
Comment thread @xen-orchestra/lite/src/components/host/network/HostPifsTable.vue
Comment thread @xen-orchestra/web-core/lib/locales/fr.json Outdated
Comment thread @xen-orchestra/lite/CHANGELOG.md Outdated
Comment thread @xen-orchestra/lite/CHANGELOG.md
Comment thread @xen-orchestra/lite/src/components/host/network/HostPifsTable.vue Outdated
Comment thread @xen-orchestra/lite/src/components/host/network/HostPifsTable.vue Outdated
@MarieGarde
MarieGarde requested a review from Elise-FZI August 10, 2026 07:20
Comment thread @xen-orchestra/lite/src/components/host/network/HostPifsTable.vue Outdated
@Elise-FZI
Elise-FZI removed their request for review August 19, 2026 08:32

@MathieuRA MathieuRA left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is something strange about your screenshot.
In the table, it shows "status: disconnected," but in the side panel, it shows a "connected" status.

I have only reviewed the pif-operation.ts, so, that maybe a normal behavior, but at first glance, it looks like a bug.

forget: (pifs: MaybeArray<XenApiPif>) =>
Promise.all(
toArray(pifs).map(async pif => {
if (pif.VLAN_master_of !== 'OpaqueRef:NULL') {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use OPAQUE_REF.EMPTY from vates/types/common.mts instead

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The table status column was cut in the screenshot but is displaying "Disconnected from physical device", which is the physical interface status in the sidepanel. Both statuses are combined in one column.

@MarieGarde

Copy link
Copy Markdown
Collaborator

Remember to explain in the PR description why the card says "delete PIF" while the PR uses "forget PIF" throughout.

@@ -0,0 +1,48 @@
<template>
<UiModal accent="warning" icon="status:warning-picto" @confirm="emit('confirm')" @dismiss="emit('cancel')">

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<UiModal accent="warning" icon="status:warning-picto" @confirm="emit('confirm')" @dismiss="emit('cancel')">
<UiModal accent="danger" icon="status:warning-picto" @confirm="emit('confirm')" @dismiss="emit('cancel')">

Since the button is red? I'm not sure we're keeping that logic.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can

@MarieGarde

Copy link
Copy Markdown
Collaborator

Add in changelog unreleased :

  • @xen-orchestra/web minor
  • @xen-orchestra/web-core minor

@@ -0,0 +1,52 @@
import type { XenApiPif } from '@/libs/xen-api/xen-api.types.ts'

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

File name : use-pif-forget.composable.ts

To stay consistent with the project's conventions (cf. use-vif-connection.composable, use-sr-delete.composable)

import type { MaybeRefOrGetter } from 'vue'
import { useI18n } from 'vue-i18n'

export function usePifForgetModal(rawPifs: MaybeRefOrGetter<XenApiPif[]>) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
export function usePifForgetModal(rawPifs: MaybeRefOrGetter<XenApiPif[]>) {
export function usePifForget(rawPifs: MaybeRefOrGetter<XenApiPif[]>) {

@amouillard-vates amouillard-vates changed the title feat(lite): add ability to delete a PIF from the network table feat(lite): add ability to forget a PIF from the network table Sep 1, 2026
@MarieGarde
MarieGarde requested a review from OlivierFL September 2, 2026 13:01
@J0ris-K
J0ris-K requested review from J0ris-K and removed request for OlivierFL September 30, 2026 12:40
@amouillard-vates
amouillard-vates force-pushed the xo6-lite/network-delete-pif branch from 0660861 to f2dd6c2 Compare September 30, 2026 12:51

const { run, canRun, isRunning, errorMessage } = usePifForgetJob(pifs)

const { open: openForgetModal } = useOverlay({

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const { open: openForgetModal } = useOverlay({
const { open } = useOverlay({

},
})

function openModal() {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
function openModal() {
function forgetPifs() {

function openModal() {
const count = pifs.value.length

return openForgetModal({

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return openForgetModal({
return open({


const selectedPifId = useRouteQuery('id')

const { run, canRun, isRunning, errorMessage } = usePifForgetJob(pifs)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const { run, canRun, isRunning, errorMessage } = usePifForgetJob(pifs)
const {
run: runForget,
canRun: canForgetPifs,
isRunning: isForgettingPifs,
errorMessage: forgetPifsErrorMessage,
} = usePifForgetJob(pifs)

events: {
onConfirm: async () => {
try {
await run()

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
await run()
await runForget()

Comment thread @xen-orchestra/web-core/lib/components/modal/VtsForgetModal.vue
"confirm-cancel?": "Êtes-vous sûr de vouloir annuler ?",
"confirm-delete": "Vous êtes sur le point de supprimer {name}",
"confirm-disconnect": "Vous êtes sur le point de déconnecter {0}",
"confirm-forget": "Vous êtes sur le point d'oublier {0}",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"confirm-forget": "Vous êtes sur le point d'oublier {0}",
"confirm-forget": "Vous êtes sur le point d'oublier {name}",

"confirm-cancel?": "Are you sure you want to cancel?",
"confirm-delete": "You're about to delete {name}",
"confirm-disconnect": "You're about to disconnect {0}",
"confirm-forget": "You're about to forget {0}",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"confirm-forget": "You're about to forget {0}",
"confirm-forget": "You're about to forget {name}",

Comment on lines +5 to +8
:busy="isForgettingPif"
:disabled="!canForgetPif"
:tooltip="!canForgetPif && forgetPifErrorMessage"
@click="openPifForgetModal()"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
:busy="isForgettingPif"
:disabled="!canForgetPif"
:tooltip="!canForgetPif && forgetPifErrorMessage"
@click="openPifForgetModal()"
:busy="isForgettingPifs"
:disabled="!canForgetPifs"
:tooltip="!canForgetPifs && forgetPifsErrorMessage"
@click="forgetPifs()"

Comment thread @xen-orchestra/web-core/lib/components/modal/VtsForgetModal.vue
@J0ris-K

J0ris-K commented Oct 1, 2026

Copy link
Copy Markdown
Collaborator

You can change screenshots too

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants