feat(xo6/site): add new VM button and connect pool to site tree actions (#10047)

This commit is contained in:
amouillard-vates
2026-07-15 11:45:19 +02:00
committed by GitHub
parent 2bee8c279d
commit 8b78ab985d
6 changed files with 128 additions and 0 deletions

View File

@@ -0,0 +1,9 @@
<template>
<SiteNewVmButton />
<SiteConnectPoolButton />
</template>
<script setup lang="ts">
import SiteConnectPoolButton from '@/modules/site/components/actions/connect-pool/SiteConnectPoolButton.vue'
import SiteNewVmButton from '@/modules/site/components/actions/new-vm/SiteNewVmButton.vue'
</script>

View File

@@ -0,0 +1,16 @@
<template>
<MenuItem icon="action:connect" class="typo-body-bold-small" @click="goToConnectPool()">
{{ t('action:connect-pool') }}
</MenuItem>
</template>
<script lang="ts" setup>
import MenuItem from '@core/components/menu/MenuItem.vue'
import { useI18n } from 'vue-i18n'
import { useRouter } from 'vue-router'
const { t } = useI18n()
const router = useRouter()
const goToConnectPool = () => router.push({ name: '/pool/connect' })
</script>

View File

@@ -0,0 +1,16 @@
<template>
<MenuItem icon="action:add" class="typo-body-bold-small" @click="goToNewVm()">
{{ t('new-vm') }}
</MenuItem>
</template>
<script lang="ts" setup>
import MenuItem from '@core/components/menu/MenuItem.vue'
import { useI18n } from 'vue-i18n'
import { useRouter } from 'vue-router'
const { t } = useI18n()
const router = useRouter()
const goToNewVm = () => router.push({ name: '/vm/new' })
</script>

View File

@@ -10,15 +10,34 @@
variant="secondary"
size="small"
/>
<MenuList placement="bottom-start">
<template #trigger="{ open, isOpen }">
<UiButtonIcon
v-tooltip="{
placement: 'top',
content: t('quick-actions'),
}"
accent="brand"
icon="action:more-actions"
size="small"
:selected="isOpen"
@click="open($event)"
/>
</template>
<SiteTreeActions />
</MenuList>
</template>
</UiTreeItemLabel>
</VtsTreeItem>
</template>
<script lang="ts" setup>
import SiteTreeActions from '@/modules/site/components/actions/SiteTreeActions.vue'
import type { SiteBranch } from '@/modules/treeview/types/tree.type.ts'
import { useXoVmCollection } from '@/modules/vm/remote-resources/use-xo-vm-collection.ts'
import MenuList from '@core/components/menu/MenuList.vue'
import VtsTreeItem from '@core/components/tree/VtsTreeItem.vue'
import UiButtonIcon from '@core/components/ui/button-icon/UiButtonIcon.vue'
import UiCounter from '@core/components/ui/counter/UiCounter.vue'
import UiTreeItemLabel from '@core/components/ui/tree-item-label/UiTreeItemLabel.vue'
import { vTooltip } from '@core/directives/tooltip.directive.ts'

View File

@@ -129,6 +129,41 @@ declare module 'vue-router/auto-routes' {
{ id: ParamValue<false> },
| never
>,
'/dev/': RouteRecordInfo<
'/dev/',
'/dev',
Record<never, never>,
Record<never, never>,
| never
>,
'/dev/colors': RouteRecordInfo<
'/dev/colors',
'/dev/colors',
Record<never, never>,
Record<never, never>,
| never
>,
'/dev/icons/': RouteRecordInfo<
'/dev/icons/',
'/dev/icons',
Record<never, never>,
Record<never, never>,
| never
>,
'/dev/icons/[name]': RouteRecordInfo<
'/dev/icons/[name]',
'/dev/icons/:name',
{ name: ParamValue<true> },
{ name: ParamValue<false> },
| never
>,
'/dev/token': RouteRecordInfo<
'/dev/token',
'/dev/token',
Record<never, never>,
Record<never, never>,
| never
>,
'/host/[id]': RouteRecordInfo<
'/host/[id]',
'/host/:id',
@@ -538,6 +573,36 @@ declare module 'vue-router/auto-routes' {
views:
| never
}
'src/pages/dev/index.vue': {
routes:
| '/dev/'
views:
| never
}
'src/pages/dev/colors.vue': {
routes:
| '/dev/colors'
views:
| never
}
'src/pages/dev/icons/index.vue': {
routes:
| '/dev/icons/'
views:
| never
}
'src/pages/dev/icons/[name].vue': {
routes:
| '/dev/icons/[name]'
views:
| never
}
'src/pages/dev/token.vue': {
routes:
| '/dev/token'
views:
| never
}
'src/pages/host/[id].vue': {
routes:
| '/host/[id]'

View File

@@ -19,6 +19,8 @@
- [REST API] `PATCH /rest/v0/vdis/{id}` to update a VDI's name, description and size (PR [#9945](https://github.com/vatesfr/xen-orchestra/pull/9945))
- [Pool] XO now reconnects to a surviving pool member when the master becomes unreachable (e.g. HA promoted a new master after the old one died), instead of staying stuck on the dead master, including after an XO restart (PR [#10016](https://github.com/vatesfr/xen-orchestra/pull/10016))
- [XO6/VIF] Add possibility to create VIF from network tab in VM page (PR [#9677](https://github.com/vatesfr/xen-orchestra/pull/9677))
- [vm stats] Reduce the memory consumption of the rrd stats (PR [#10039](https://github.com/vatesfr/xen-orchestra/pull/10039))
- [XO6/Site] Add "New VM" and "Connect pool" actions to the site infrastructure tree (PR [#10047](https://github.com/vatesfr/xen-orchestra/pull/10047))
### Bug fixes
@@ -45,6 +47,7 @@
<!--packages-start-->
- @vates/types minor
- @xen-orchestra/backup-archive patch
- @xen-orchestra/rest-api minor
- @xen-orchestra/web minor
- @xen-orchestra/web-core minor