Compare commits

..

4 Commits

Author SHA1 Message Date
Thomas Moraine
f49398d5de docs(sdn-controller): use the Vates VMS subscription wording
XOA Premium is a legacy XOA tier. Use the same wording as the other
technical pages: on XOA, the plugin requires a Vates VMS subscription that
includes it.
2026-11-19 09:02:35 +01:00
Thomas Moraine
507b4477b5 docs(sdn-controller): replace the Networking category with SDN controller
Networking only contained the SDN controller pages, which put them one
level deeper than any other page of the docs. The SDN controller category
now sits directly under Management, and /category/networking redirects to
it.
2026-11-19 08:57:33 +01:00
Thomas Moraine
fc16175dbb Merge remote-tracking branch 'origin/master' into docs/sdn-controller-restructure
# Conflicts:
#	docs/docs/manage-your-infrastructure/networking/sdn_controller.md
2026-11-19 08:51:28 +01:00
Thomas Moraine
f3d12a9171 docs(sdn-controller): split the page into how it works, setup, traffic rules and advanced
- How it works: brings in the content of the two SDN devblogs, with their
  diagrams redrawn in the current Schema style. Describes the actual
  topology (a single star center, also across pools) and the preferred
  center option.
- Setup: requirements first (connectivity, VxLAN, encryption, MTU), then
  the plugin configuration, then the network creation.
- Traffic rules: only the default OpenFlow mode, available out of the box.
- Advanced: XAPI plugin mode (beta), xo-cli, migration script and OpenSSL 3
  certificate regeneration.

The old URL redirects to the setup page, and internal links are updated.
2026-11-19 08:47:01 +01:00
1223 changed files with 16271 additions and 56598 deletions

View File

@@ -59,33 +59,6 @@ module.exports = {
'n/no-unpublished-import': 'off',
},
},
// The XO 6 test files share their modules (no isolation): mocking or resetting a module from one file would leak
// into the others. See @xen-orchestra/web/docs/tests/mocking.md
{
files: ['@xen-orchestra/web/src/**/*.unit.test.ts'],
rules: {
'no-restricted-syntax': [
'error',
{
selector: "CallExpression[callee.object.name='vi'][callee.property.name=/^(mock|doMock|unmock|doUnmock)$/]",
message: 'Mock a module with `mockModule` from `@/test/spy-on-module.ts`, never `vi.mock`.',
},
{
selector: "CallExpression[callee.object.name='vi'][callee.property.name='resetModules']",
message: 'The test files share their modules: never reset them.',
},
{
selector: "CallExpression[callee.object.name='vi'][callee.property.name='hoisted']",
message: '`mockModule` is not hoisted: declare the stubs as plain constants.',
},
{
selector: "CallExpression[callee.object.name='vi'][callee.property.name='resetAllMocks']",
message:
'Reset the stubs with `resetStubs` from `@/test/reset-stubs.ts`: `vi.resetAllMocks()` also resets the module mocks.',
},
],
},
},
{
files: ['@xen-orchestra/{web-core,lite,web}/**/*.{vue,ts}'],
parser: 'vue-eslint-parser',

View File

@@ -14,7 +14,7 @@
"url": "https://vates.fr"
},
"license": "ISC",
"version": "0.1.7",
"version": "0.1.6",
"engines": {
"node": ">=8.10"
},
@@ -25,7 +25,7 @@
"dependencies": {
"@vates/multi-key-map": "^0.2.0",
"@xen-orchestra/async-map": "^0.1.5",
"@xen-orchestra/log": "^1.0.0",
"@xen-orchestra/log": "^0.7.2",
"ensure-array": "^1.0.0"
},
"devDependencies": {

View File

@@ -1,6 +1,6 @@
{
"name": "@vates/fuse-vhd",
"version": "2.1.4",
"version": "2.1.3",
"license": "ISC",
"private": false,
"homepage": "https://github.com/vatesfr/xen-orchestra/tree/master/@vates/fuse-vhd",
@@ -19,12 +19,12 @@
},
"main": "./index.mjs",
"dependencies": {
"@xen-orchestra/fs": "^4.11.0",
"@xen-orchestra/log": "^1.0.0",
"@xen-orchestra/fs": "^4.10.0",
"@xen-orchestra/log": "^0.7.2",
"fuse-native": "^2.2.6",
"lru-cache": "^7.14.0",
"promise-toolbox": "^0.21.0",
"vhd-lib": "^4.17.1"
"vhd-lib": "^4.17.0"
},
"bin": {
"xo-fuse-vhd": "./cli.mjs"

View File

@@ -1,6 +1,6 @@
{
"name": "@vates/iscsi",
"version": "0.4.1",
"version": "0.4.0",
"main": "dist/index.mjs",
"types": "dist/index.d.mts",
"bin": {
@@ -24,7 +24,7 @@
"@vates/async-each": "^1.0.3",
"@vates/read-chunk": "^1.2.1",
"@xen-orchestra/disk-transform": "^1.3.4",
"@xen-orchestra/log": "^1.0.0",
"@xen-orchestra/log": "^0.7.2",
"promise-toolbox": "^0.21.0"
},
"devDependencies": {

View File

@@ -1,6 +1,6 @@
import assert from 'node:assert'
import { spawn } from 'node:child_process'
import { pFromCallback, pTimeout } from 'promise-toolbox'
import { pFromCallback } from 'promise-toolbox'
import { createLogger } from '@xen-orchestra/log'
import AbstractNbdClient from './AbstractNbdClient.mjs'
@@ -9,9 +9,6 @@ const { warn } = createLogger('vates:nbd-client:stdio')
// only the tail is kept: it's the part describing why the server died
const STDERR_MAX_LENGTH = 4096
// how long a failed connection waits for the server to exit and its stderr to end
const CLOSE_TIMEOUT = 1e3
/**
* NBD client talking to a server through its standard streams, like
* `nbdkit -s` or `qemu-nbd` in `--fd` mode: the queries are written to the
@@ -31,7 +28,7 @@ export default class NbdStdioClient extends AbstractNbdClient {
#cwd
#env
/** @type {{ child: import('node:child_process').ChildProcess, closing: boolean, stderr: string, closed: Promise<unknown> }|undefined} */
/** @type {{ child: import('node:child_process').ChildProcess, closing: boolean, stderr: string }|undefined} */
#state
/**
@@ -71,36 +68,6 @@ export default class NbdStdioClient extends AbstractNbdClient {
return this.#state?.child.pid
}
/**
* A server dying before the handshake makes it fail with "stream has ended
* without data", and the exit handler, racing with the teardown, often
* reports nothing: what the server wrote on stderr is the only reason given,
* so it becomes the error.
*/
async connect() {
try {
return await super.connect()
} catch (error) {
const state = this.#state
const closed =
state !== undefined &&
(await pTimeout.call(state.closed, CLOSE_TIMEOUT).then(
() => true,
() => false
))
// exitCode is null when the process was killed, by us when it did not die by itself
if (closed && state.child.exitCode !== null && state.stderr !== '') {
const serverError = new Error(state.stderr.trim(), { cause: error })
serverError.code = 'NBD_SERVER_EXITED'
serverError.exitCode = state.child.exitCode
serverError.command = this.#command
serverError.stderr = state.stderr
throw serverError
}
throw error
}
}
async _openTransport() {
const child = spawn(this.#command, this.#args, {
cwd: this.#cwd,
@@ -108,13 +75,7 @@ export default class NbdStdioClient extends AbstractNbdClient {
// the protocol goes through stdin/stdout, stderr is only used for diagnostics
stdio: ['pipe', 'pipe', 'pipe'],
})
const state = {
child,
closing: false,
stderr: '',
// 'close' comes after the exit and the end of the standard streams: stderr is complete
closed: new Promise(resolve => child.once('close', resolve)),
}
const state = { child, closing: false, stderr: '' }
this.#state = state
child.stderr.setEncoding('utf8')

View File

@@ -1,19 +0,0 @@
import assert from 'node:assert/strict'
import { describe, it } from 'node:test'
import NbdStdioClient from './NbdStdioClient.mjs'
describe('NbdStdioClient', () => {
it('reports what the server wrote on stderr when it dies before the handshake', async () => {
// the end of stdout and the exit of the process come in either order: repeat
for (let i = 0; i < 20; i++) {
const client = new NbdStdioClient({ command: 'sh', args: ['-c', 'echo "the actual reason" >&2; exit 1'] })
await assert.rejects(client.connect(), {
code: 'NBD_SERVER_EXITED',
exitCode: 1,
message: 'the actual reason',
stderr: 'the actual reason\n',
})
}
})
})

View File

@@ -13,7 +13,7 @@
"url": "https://vates.fr"
},
"license": "ISC",
"version": "3.7.2",
"version": "3.7.0",
"engines": {
"node": ">=14.0"
},
@@ -23,9 +23,9 @@
"@vates/read-chunk": "^1.2.1",
"@xen-orchestra/async-map": "^0.1.5",
"@xen-orchestra/disk-transform": "^1.3.4",
"@xen-orchestra/log": "^1.0.0",
"@xen-orchestra/log": "^0.7.2",
"promise-toolbox": "^0.21.0",
"xen-api": "^6.0.0"
"xen-api": "^5.1.0"
},
"devDependencies": {
"tap": "^18.7.0",

View File

@@ -1,6 +1,6 @@
{
"name": "@vates/node-vsphere-soap",
"version": "2.2.1",
"version": "2.2.0",
"description": "interface to vSphere SOAP/WSDL from node for interfacing with vCenter or ESXi, forked from node-vsphere-soap",
"main": "lib/client.mjs",
"author": "reedog117",
@@ -11,7 +11,7 @@
},
"bugs": "https://github.com/vatesfr/xen-orchestra/issues",
"dependencies": {
"@xen-orchestra/log": "^1.0.0",
"@xen-orchestra/log": "^0.7.2",
"axios": "^1.15.0",
"soap": "^1.0.0",
"soap-cookie": "^0.10.1"

View File

@@ -13,7 +13,7 @@
"url": "https://vates.fr"
},
"license": "ISC",
"version": "0.2.0",
"version": "0.1.0",
"engines": {
"node": ">=8.10"
},

View File

@@ -19,7 +19,7 @@
"url": "https://vates.fr"
},
"license": "ISC",
"version": "0.2.0",
"version": "0.1.0",
"engines": {
"node": ">=18"
},

View File

@@ -1,7 +1,7 @@
{
"name": "@vates/types",
"private": false,
"version": "3.1.0",
"version": "2.5.0",
"main": "./dist/index.mjs",
"exports": {
".": {

View File

@@ -22,11 +22,6 @@ export const BACKUP_EXPRESSION_CONTEXT = {
tags: { type: 'string[]' },
power_state: { type: 'string' },
},
pool: {
name_label: { type: 'string' },
description: { type: 'string' },
tags: { type: 'string[]' },
},
chainLength: { type: 'number' },
} as const
@@ -38,8 +33,6 @@ export const BACKUP_SETTING_CONTEXT = {
vmFilter: ['vm', 'run'],
srs: ['sr', 'run'],
remotes: ['backupRepository', 'run'],
vms: ['vm', 'run'],
pools: ['pool', 'run'],
} as const
export type BACKUP_SETTING_CONTEXT = (typeof BACKUP_SETTING_CONTEXT)[keyof typeof BACKUP_SETTING_CONTEXT]

View File

@@ -759,10 +759,6 @@ export type TrafficRuleProtocol = (typeof TRAFFIC_RULE_PROTOCOLS)[number]
export const SDN_CONTROLLER_OF_RULES_KEY = 'xo:sdn-controller:of-rules'
export const SDN_CONTROLLER_OF_METHOD_KEY = 'xo:sdn-controller:of-method'
export const SDN_CONTROLLER_OF_FORMAT_KEY = 'xo:sdn-controller:of-format'
export const SDN_CONTROLLER_PRIVATE_NETWORK_UUID_KEY = 'xo:sdn-controller:private-network-uuid'
export const SDN_CONTROLLER_ENCRYPTED_KEY = 'xo:sdn-controller:encrypted'
export const SDN_CONTROLLER_ENCAPSULATION_KEY = 'xo:sdn-controller:encapsulation'
export const SDN_CONTROLLER_PREFERRED_CENTER_KEY = 'xo:sdn-controller:preferred-center'
export const TRAFFIC_RULE_PROTOCOLS = ['ARP', 'ICMP', 'IP', 'TCP', 'UDP'] as const
export const TRAFFIC_RULE_PROTOCOLS_WITH_PORT: readonly TrafficRuleProtocol[] = ['TCP', 'UDP']
@@ -822,16 +818,3 @@ export type RPU_RECOVERY_STEP_NAME = (typeof RPU_RECOVERY_STEP_NAMES)[number]
export const COMMON_TAG = {
NOBAK: 'xo:no-bak',
} as const
/**
* a package of the XO appliance with another version available
*
* Returned by `xoa-updater` as `upgradablePackages` at the end of an update check.
*/
export type XoaPackageUpdate = {
name: string
/** version which will be installed */
version: string
/** undefined: the package is not installed yet */
installedVersion?: string
}

View File

@@ -462,7 +462,6 @@ export interface Xapi {
stream: Readable | Buffer,
opts: { signal?: AbortSignal; format: SUPPORTED_VDI_FORMAT }
): Promise<void>
VDI_resize(vdiRef: XenApiVdi['$ref'], size: number): Promise<void>
VIF_create(
options: {
currently_attached?: boolean

View File

@@ -155,80 +155,26 @@ export type PoolRollingUpdateRecoveryError = {
}
export type PoolRollingUpdateRecoveryHost = {
/** `interrupted`: left in progress by a run that is over */
status: 'pending' | 'running' | 'interrupted' | 'succeeded' | 'failed' | 'not-needed'
status: 'pending' | 'running' | 'succeeded' | 'failed' | 'not-needed'
steps: Record<RPU_RECOVERY_STEP_NAME, PoolRollingUpdateRecoveryStep>
lastError: PoolRollingUpdateRecoveryError | null
}
/** a VM the last migrate back of the run could not bring to its original host */
export type PoolRollingUpdateRecoveryVmConflict = {
vmId: string
/** unknown for a VM deleted before the run could read it */
vmName?: string
/** UUID of the host the VM was running on before the run */
hostId: string
/** `stopped` and `deleted`: left to the operator; `migration-failed`: retried by a resume */
reason: 'stopped' | 'deleted' | 'migration-failed'
/** XAPI error of the last migration, `migration-failed` only */
message?: string
}
/** what an operator changed, since the run, on a setting the run left changed or on an object of the run */
export type PoolRollingUpdateRecoveryOperatorChange = {
/** `haHeartbeatSr`: a heartbeat SR needed to enable HA again no longer exists */
type: 'ha' | 'autoPowerOn' | 'wlb' | 'schedule' | 'haHeartbeatSr' | 'host' | 'vm'
/** pool, schedule, SR, host or VM UUID */
id: string
/** schedules enabled again only */
name?: string
/** `disabled` as the run left it, `present` for a heartbeat SR, a host or a VM */
expected: 'disabled' | 'present'
/** `missing` for a deleted schedule, heartbeat SR, host or VM */
observed: 'enabled' | 'missing'
}
/** hosts resumes added to the plan of the run: patches released since it started, or hosts new to the pool */
export type PoolRollingUpdateRecoveryPlanChange = {
/** the last resume which added hosts */
attempt: number
/** UUIDs of hosts the run did not plan to update, or had finished, added by any resume */
addedHostIds: string[]
}
export type PoolRollingUpdateRecoveryRun = {
runId: string
poolId: string
/** `awaiting-acceptance`: a resume found operator changes and waits for them to be accepted */
status:
| 'preparing'
| 'running'
| 'interrupted'
| 'resuming'
| 'failed'
| 'cleaning'
| 'succeeded'
| 'awaiting-acceptance'
status: 'preparing' | 'running' | 'interrupted' | 'resuming' | 'failed' | 'cleaning' | 'succeeded'
startedAt: string
updatedAt: string
finishedAt?: string
interruptedAt?: string
taskId?: string
variant?: 'xcp' | 'xs-cdn'
/** 1 for the first attempt, incremented by each resume of the run */
attempt?: number
/** whether a resume would be accepted: run failed, interrupted or awaiting the acceptance of operator changes */
resumable?: boolean
hostOrder?: string[]
hosts: Record<string, PoolRollingUpdateRecoveryHost>
lastError: PoolRollingUpdateRecoveryError | null
/** VM UUID -> UUID of the host it must be started on */
haltedPinnedVms: Record<string, string>
vmConflicts: PoolRollingUpdateRecoveryVmConflict[]
/** found by the last resume, the run stays `awaiting-acceptance` until they are accepted */
operatorChanges: PoolRollingUpdateRecoveryOperatorChange[]
/** absent when no resume changed the plan */
planChange?: PoolRollingUpdateRecoveryPlanChange
}
/** record unreadable or of an unknown schema version: recovery needs a human */
@@ -357,8 +303,6 @@ export type XoApp = EventEmitter & {
checkFeatureAuthorization(featureCode: FeatureCode): Promise<void>
/* whether this machine can run the tools of an import from VMware */
checkEsxiDependencies(): Promise<XoV2vStatus>
/* Throw if the proxy cannot be reached */
checkProxyHealth(id: XoProxy['id']): Promise<void>
/* validate, apply and persist the configuration of a plugin */
configurePlugin(id: string, configuration: unknown, mergeWithExisting?: boolean): Promise<void>
/* connect a server (XCP-ng/XenServer) */
@@ -472,7 +416,6 @@ export type XoApp = EventEmitter & {
getPlugin(id: XoPlugin['id']): Promise<XoPlugin>
getPlugins(): Promise<XoPlugin[]>
getProxy(id: XoProxy['id']): Promise<XoProxy>
getProxyApplianceUpdaterState(id: XoProxy['id']): Promise<{ level: string; message: string; state: string }>
getRemote(id: XoBackupRepository['id']): Promise<XoBackupRepository>
getAllRemotes(): Promise<XoBackupRepository[]>
removeRemote(id: XoBackupRepository['id']): Promise<void>
@@ -674,10 +617,6 @@ export type XoApp = EventEmitter & {
): Promise<void>
getRollingUpdateRecovery(poolId: XoPool['id']): Promise<PoolRollingUpdateRecovery | undefined>
finalizeRollingUpdate(pool: XoPool, opts?: { force?: boolean; parentTask?: VatesTask }): Promise<void>
resumeRollingPoolUpdate(
pool: XoPool,
opts?: { acceptOperatorChanges?: boolean; bypassBackupCheck?: boolean; parentTask?: VatesTask }
): Promise<void>
setVmResourceSet(vmId: XoVm['id'], resourceSetId: string | null, force?: boolean): Promise<void>
shareVmResourceSet(vmId: XoVm['id']): Promise<void>
removeUserFromGroup(userId: XoUser['id'], id: XoGroup['id']): Promise<void>

View File

@@ -579,9 +579,6 @@ export type XoBrowserMediaSession = {
export type XoProxy = {
id: Branded<'proxy'>
/**
* @deprecated no replacement for this field
*/
url: string
version?: string
name: string
@@ -646,7 +643,7 @@ export type XoVmBackupJob = BaseXoJob & {
proxy?: XoProxy['id']
mode: 'full' | 'delta'
remotes?: CMType.IdOr<XoBackupRepository['id']> | string
vms: CMType.IdOr<XoVm['id']> | Record<string, unknown> | string
vms: CMType.IdOr<XoVm['id']> | Record<string, unknown>
srs?: CMType.IdOr<XoSr['id']> | string
type: 'backup'
settings: {
@@ -663,7 +660,7 @@ export type XoMetadataBackupJobScheduleSettings = {
}
export type XoMetadataBackupJob = BaseXoJob & {
type: 'metadataBackup'
pools?: CMType.IdOr<XoPool['id']> | string
pools?: CMType.IdOr<XoPool['id']>
remotes: CMType.IdOr<XoBackupRepository['id']>
settings: {
''?: XoMetadataBackupJobGeneralSettings
@@ -696,7 +693,6 @@ export type XoMirrorBackupJob = BaseXoJob & {
sourceRemote: XoBackupRepository['id']
remotes: CMType.IdOr<XoBackupRepository['id']>
proxy?: XoProxy['id']
filter?: { vm: { uuid: { __or: XoVm['id'][] } } } | null
settings: {
'': XoMirrorBackupGeneralSettings
[scheduleId: XoSchedule['id']]: XoMirrorBackupScheduleSettings | undefined

View File

@@ -6,7 +6,7 @@
"main": "dist/index.mjs",
"name": "@xen-orchestra/acl",
"homepage": "https://github.com/vatesfr/xen-orchestra/tree/master/@xen-orchestra/acl",
"version": "1.9.0",
"version": "1.8.0",
"license": "AGPL-3.0-or-later",
"private": false,
"type": "module",
@@ -30,7 +30,7 @@
},
"devDependencies": {
"@eslint/js": "^9.19.0",
"@vates/types": "^3.1.0",
"@vates/types": "^2.5.0",
"rimraf": "^6.0.1",
"typescript": "~5.6",
"typescript-eslint": "^8.61.0"

View File

@@ -3,16 +3,7 @@ export default {
delete: true,
forget: true,
import: {
vdi: {
upload: true,
/**
* Warning: lets the holder make XO send a GET request to any HTTP(S) URL, including internal addresses
* reachable from the XO server (localhost, management network, etc.).
*
* Covered by `import:vdi`, `import` and `*`: only grant these to trusted users.
*/
url: true,
},
vdi: true,
vm: true,
},
'migrate-receive': true,

View File

@@ -38,10 +38,33 @@ export class Privilege<T extends SupportedResource> {
}
#matchAction<Resource extends SupportedResource = T>(action: SupportedActions<Resource>) {
// A privilege allows its own action and every action below it in the tree:
// e.g. `*`, `import`, `import:vdi` and `import:vdi:url` all allow `import:vdi:url`,
// but `import:vdi:upload` does not (it is a sibling, not a parent)
return this.#action === '*' || this.#action === action || action.startsWith(`${this.#action}:`)
// read:name_label - read:name_label
if (this.#action === action) {
return true
}
const [namespaceToMatch, actionToMatch] = action.split(':')
const [thisNamespace, thisAction] = this.#action.split(':')
if (thisNamespace === '*') {
return true
}
// update:vm - read:name_label
if (thisNamespace !== namespaceToMatch) {
return false
}
// read - read:name_label
if (thisAction === undefined) {
return true
}
// read:name_decription - read:name_label
if (thisAction !== actionToMatch) {
return false
}
throw new Error(`Unable to verify if ${this.#action} match ${action} `)
}
#matchSelector(object: object) {

View File

@@ -27,12 +27,6 @@ suite('Privilege.checkActionIsValid behavior', () => {
test('should work', () => {
assert.doesNotThrow(() => Privilege.checkActionIsValid('vm', 'read'))
})
test('should work with 3-level actions', () => {
assert.doesNotThrow(() => Privilege.checkActionIsValid('sr', 'import:vdi:url'))
// @ts-expect-error test invalid action
assert.throws(() => Privilege.checkActionIsValid('sr', 'import:vdi:foo'))
})
})
suite('Privilege.match behavior', () => {
@@ -65,22 +59,6 @@ suite('Privilege.match behavior', () => {
const cleanShutdownPrivilege = new Privilege({ action: 'shutdown:clean', resource: 'vm', effect: 'allow' })
assert.strictEqual(cleanShutdownPrivilege.match({ resource: 'vm', action: 'shutdown', object }), false)
})
test('Should match 3-level actions with any parent action', () => {
for (const action of ['*', 'import', 'import:vdi', 'import:vdi:url'] as const) {
const srPrivilege = new Privilege({ action, resource: 'sr', effect: 'allow' })
assert.strictEqual(srPrivilege.match({ resource: 'sr', action: 'import:vdi:url', object }), true, action)
}
})
test('Should not match 3-level actions with a sibling or a child action', () => {
const uploadPrivilege = new Privilege({ action: 'import:vdi:upload', resource: 'sr', effect: 'allow' })
assert.strictEqual(uploadPrivilege.match({ resource: 'sr', action: 'import:vdi:url', object }), false)
assert.strictEqual(uploadPrivilege.match({ resource: 'sr', action: 'import:vdi', object }), false)
const vmImportPrivilege = new Privilege({ action: 'import:vm', resource: 'sr', effect: 'allow' })
assert.strictEqual(vmImportPrivilege.match({ resource: 'sr', action: 'import:vdi:url', object }), false)
})
})
suite('ACL V2 behavior', async () => {
@@ -280,23 +258,6 @@ suite('ACL V2 behavior', async () => {
false
)
})
test('Should allow VDI upload but not URL import with import:vdi allowed and import:vdi:url denied', () => {
const sr = { id: 'sr-id' }
const userPrivileges = [
{ id: privilegeId, action: 'import:vdi', resource: 'sr', effect: 'allow', roleId },
{ id: privilegeId, action: 'import:vdi:url', resource: 'sr', effect: 'deny', roleId },
] satisfies TPrivilege<'sr'>[]
assert.strictEqual(
hasPrivilegeOn({ user, action: 'import:vdi:upload', resource: 'sr', objects: sr, userPrivileges }),
true
)
assert.strictEqual(
hasPrivilegeOn({ user, action: 'import:vdi:url', resource: 'sr', objects: sr, userPrivileges }),
false
)
})
})
suite('getMissingPrivileges behavior', () => {
@@ -414,12 +375,4 @@ suite('getActionStrings', () => {
assert.ok(actions.includes('shutdown:clean'))
assert.ok(actions.includes('shutdown:hard'))
})
test('3-level actions are included alongside their parents', () => {
const actions = getActionStrings('sr')
assert.ok(actions.includes('import'))
assert.ok(actions.includes('import:vdi'))
assert.ok(actions.includes('import:vdi:upload'))
assert.ok(actions.includes('import:vdi:url'))
})
})

View File

@@ -7,7 +7,7 @@
"type": "git",
"url": "https://github.com/vatesfr/xen-orchestra.git"
},
"version": "0.4.1",
"version": "0.4.0",
"engines": {
"node": ">=14"
},
@@ -17,7 +17,7 @@
},
"dependencies": {
"@vates/decorate-with": "^2.1.0",
"@xen-orchestra/log": "^1.0.0",
"@xen-orchestra/log": "^0.7.2",
"golike-defer": "^0.5.1",
"object-hash": "^2.0.1"
},

View File

@@ -1,7 +1,7 @@
{
"private": true,
"name": "@xen-orchestra/autopilot-docking",
"version": "0.1.0",
"version": "0.0.0",
"description": "Live ISO that prepares a VM imported from another hypervisor to boot on XCP-ng",
"homepage": "https://github.com/vatesfr/xen-orchestra/tree/master/@xen-orchestra/autopilot-docking",
"bugs": "https://github.com/vatesfr/xen-orchestra/issues",

View File

@@ -1,6 +1,6 @@
{
"name": "@xen-orchestra/backup-archive",
"version": "1.2.1",
"version": "1.2.0",
"description": "Helper to handle generic backup archives",
"license": "ISC",
"author": "",
@@ -21,18 +21,18 @@
"tar-stream": "^3.1.8",
"@types/tar-stream": "^3.1.4",
"tmp": "^0.2.1",
"@vates/types": "^3.1.0"
"@vates/types": "^2.5.0"
},
"dependencies": {
"@xen-orchestra/log": "^1.0.0",
"@xen-orchestra/fs": "^4.11.0",
"@xen-orchestra/log": "^0.7.1",
"@xen-orchestra/fs": "^4.10.0",
"@xen-orchestra/disk-transform": "^1.3.4",
"@vates/task": "0.7.0",
"golike-defer": "0.5.1",
"uuid": "^9.0.0",
"promise-toolbox": "^0.21.0",
"@vates/async-each": "^1.0.1",
"vhd-lib": "^4.17.1"
"vhd-lib": "^4.17.0"
},
"scripts": {
"build": "yarn run clean && tsc",

View File

@@ -8,8 +8,8 @@
"dependencies": {
"@vates/async-each": "^1.0.3",
"@xen-orchestra/async-map": "^0.1.5",
"@xen-orchestra/backups": "^1.0.1",
"@xen-orchestra/fs": "^4.11.0",
"@xen-orchestra/backups": "^0.78.0",
"@xen-orchestra/fs": "^4.10.0",
"filenamify": "^6.0.0",
"getopts": "^2.2.5",
"lodash": "^4.18.0",
@@ -28,7 +28,7 @@
"scripts": {
"postversion": "npm publish --access public"
},
"version": "1.1.19",
"version": "1.1.18",
"license": "AGPL-3.0-or-later",
"author": {
"name": "Vates SAS",

View File

@@ -9,7 +9,6 @@ const { warn } = createLogger('xo:backups:buildContext')
/**
* @typedef {import('@vates/types/xen-api').XenApiVm} XenApiVm
* @typedef {import('@vates/types/xo').XoSr} XoSr
* @typedef {import('@vates/types/xo').XoPool} XoPool
* @typedef {import('@vates/types/xo').XoBackupRepository} XoBackupRepository
*
* @typedef {object} RunContext
@@ -31,10 +30,6 @@ const { warn } = createLogger('xo:backups:buildContext')
* @typedef {object} BackupRepositoryContext
* @property {{name: string, type: string | undefined, tags: string[]}} backupRepository
* @property {RunContext} run
*
* @typedef {object} PoolContext
* @property {{name_label: string, description: string, tags: string[]}} pool
* @property {RunContext} run
*/
/**
@@ -114,19 +109,3 @@ export function buildBackupRepositoryContext(backupRepository, run) {
run,
}
}
/**
* @param {XoPool} pool
* @param {RunContext} run
* @returns {PoolContext}
*/
export function buildPoolContext(pool, run) {
return {
pool: {
name_label: pool.name_label,
description: pool.name_description,
tags: Array.isArray(pool.tags) ? pool.tags : [],
},
run,
}
}

View File

@@ -1,13 +1,7 @@
import { describe, it } from 'node:test'
import assert from 'node:assert/strict'
import {
buildRunContext,
buildVmContext,
buildSrContext,
buildBackupRepositoryContext,
buildPoolContext,
} from './_buildContext.mjs'
import { buildRunContext, buildVmContext, buildSrContext, buildBackupRepositoryContext } from './_buildContext.mjs'
import { BACKUP_EXPRESSION_CONTEXT } from '@vates/types/backup-expression-context'
describe('buildContext', () => {
@@ -150,39 +144,4 @@ describe('buildContext', () => {
Object.keys(BACKUP_EXPRESSION_CONTEXT.backupRepository).sort()
)
})
it('buildPoolContext', () => {
const pool1 = {
name_label: 'name_label',
name_description: 'description',
ignored: 'ignored',
}
const poolContext1 = buildPoolContext(pool1, runContext)
assert.deepEqual(poolContext1, {
pool: {
name_label: 'name_label',
description: 'description',
tags: [],
},
run: expectedRunContext,
})
assert.deepEqual(Object.keys(poolContext1.pool).sort(), Object.keys(BACKUP_EXPRESSION_CONTEXT.pool).sort())
const pool2 = {
name_label: 'name_label',
name_description: 'description',
tags: ['tag'],
ignored: 'ignored',
}
const poolContext2 = buildPoolContext(pool2, runContext)
assert.deepEqual(poolContext2, {
pool: {
name_label: 'name_label',
description: 'description',
tags: ['tag'],
},
run: expectedRunContext,
})
assert.deepEqual(Object.keys(poolContext2.pool).sort(), Object.keys(BACKUP_EXPRESSION_CONTEXT.pool).sort())
})
})

View File

@@ -83,7 +83,6 @@ const main = Disposable.wrap(async function* main(args) {
handler.unlink(taskFile).catch(error => warn('deleting task failure', { error }))
} catch (error) {
warn('failure handling task', { error })
if (error.code === 'ELOCKED') await new Promise(resolve => setTimeout(resolve, 5 * 60e3))
}
},
{ concurrency }

View File

@@ -8,7 +8,7 @@
"type": "git",
"url": "https://github.com/vatesfr/xen-orchestra.git"
},
"version": "1.0.1",
"version": "0.78.0",
"engines": {
"node": ">=22.19"
},
@@ -24,20 +24,20 @@
"@vates/cached-dns.lookup": "^1.0.0",
"@vates/compose": "^2.1.0",
"@vates/decorate-with": "^2.1.0",
"@vates/disposable": "^0.1.7",
"@vates/fuse-vhd": "^2.1.4",
"@vates/disposable": "^0.1.6",
"@vates/fuse-vhd": "^2.1.3",
"@vates/generator-toolbox": "^1.1.3",
"@vates/nbd-client": "^3.7.2",
"@vates/nbd-client": "^3.7.0",
"@vates/parse-duration": "^0.1.1",
"@vates/task": "^0.7.0",
"@vates/types": "^3.1.0",
"@vates/types": "^2.5.0",
"@xen-orchestra/async-map": "^0.1.5",
"@xen-orchestra/disk-transform": "^1.3.4",
"@xen-orchestra/fs": "^4.11.0",
"@xen-orchestra/log": "^1.0.0",
"@xen-orchestra/fs": "^4.10.0",
"@xen-orchestra/log": "^0.7.2",
"@xen-orchestra/qcow2": "^1.4.1",
"@xen-orchestra/template": "^0.1.1",
"@xen-orchestra/backup-archive": "^1.2.1",
"@xen-orchestra/backup-archive": "^1.2.0",
"app-conf": "^3.0.0",
"compare-versions": "^6.0.0",
"complex-matcher": "^1.1.1",
@@ -56,8 +56,8 @@
"tar": "^7.5.19",
"uuid": "^9.0.0",
"value-matcher": "^0.2.0",
"vhd-lib": "^4.17.1",
"xen-api": "^6.0.0",
"vhd-lib": "^4.17.0",
"xen-api": "^5.1.0",
"xo-common": "^0.11.0",
"xo-remote-parser": "^2.0.0",
"yazl": "^2.5.1"
@@ -70,7 +70,7 @@
"typescript": "^5.9.3"
},
"peerDependencies": {
"@xen-orchestra/xapi": "^10.0.0"
"@xen-orchestra/xapi": "^9.1.0"
},
"license": "AGPL-3.0-or-later",
"author": {

View File

@@ -1,7 +1,7 @@
{
"private": false,
"name": "@xen-orchestra/cr-seed-cli",
"version": "1.0.4",
"version": "1.0.3",
"homepage": "https://github.com/vatesfr/xen-orchestra/tree/master/@xen-orchestra/cr-seed-cli",
"bugs": "https://github.com/vatesfr/xen-orchestra/issues",
"repository": {
@@ -18,7 +18,7 @@
"preferGlobal": true,
"dependencies": {
"golike-defer": "^0.5.1",
"xen-api": "^6.0.0"
"xen-api": "^5.1.0"
},
"scripts": {
"postversion": "npm publish"

View File

@@ -1,7 +1,7 @@
{
"private": false,
"name": "@xen-orchestra/disk-cli",
"version": "2.2.6",
"version": "2.2.5",
"description": "CLI tool to inspect and manage disks in backup repositories",
"type": "module",
"bin": {
@@ -20,13 +20,13 @@
},
"dependencies": {
"@vates/async-each": "^1.0.3",
"@xen-orchestra/backups": "^1.0.1",
"@xen-orchestra/backup-archive": "^1.2.1",
"@xen-orchestra/backups": "^0.78.0",
"@xen-orchestra/backup-archive": "^1.2.0",
"@xen-orchestra/disk-transform": "^1.3.4",
"@xen-orchestra/fs": "^4.11.0",
"@xen-orchestra/fs": "^4.10.0",
"@xen-orchestra/qcow2": "^1.4.1",
"promise-toolbox": "^0.21.0",
"vhd-lib": "^4.17.1"
"vhd-lib": "^4.17.0"
},
"devDependencies": {
"@types/node": "^22.3.0",

View File

@@ -1,7 +1,7 @@
{
"private": false,
"name": "@xen-orchestra/fs",
"version": "4.11.0",
"version": "4.10.0",
"license": "AGPL-3.0-or-later",
"description": "The File System for Xen Orchestra backups.",
"homepage": "https://github.com/vatesfr/xen-orchestra/tree/master/@xen-orchestra/fs",
@@ -30,7 +30,7 @@
"@vates/coalesce-calls": "^0.1.0",
"@vates/decorate-with": "^2.1.0",
"@vates/read-chunk": "^1.2.1",
"@xen-orchestra/log": "^1.0.0",
"@xen-orchestra/log": "^0.7.2",
"bind-property-descriptor": "^2.0.0",
"decorator-synchronized": "^0.6.0",
"execa": "^5.0.0",

View File

@@ -16,14 +16,14 @@
"xo-immutable-remote": "./dist/protectRemotes.mjs"
},
"license": "AGPL-3.0-or-later",
"version": "3.0.10",
"version": "3.0.9",
"engines": {
"node": ">=20.0.0"
},
"dependencies": {
"@vates/async-each": "^1.0.3",
"@xen-orchestra/backups": "^1.0.1",
"@xen-orchestra/log": "^1.0.0",
"@xen-orchestra/backups": "^0.78.0",
"@xen-orchestra/log": "^0.7.2",
"app-conf": "^3.0.0",
"execa": "^5.0.0",
"ms": "^2.1.3"

View File

@@ -2,9 +2,6 @@
## **next**
- [VDIs] The used space of a VDI now includes its whole snapshot chain instead of only its last layer, which showed almost 0% for disks with snapshots. It is shown as a size, without usage bar or free space (PR [#10116](https://github.com/vatesfr/xen-orchestra/pull/10116))
- [Web-Core/UiCircleProgressBar] Add a brand accent and an option to hide the value (PR [#10849](https://github.com/vatesfr/xen-orchestra/pull/10849))
- [Tables] Cells fit on one line: long names are cut in the middle, extra tags go under "+N" and long texts end with "…" (PR [#10850](https://github.com/vatesfr/xen-orchestra/pull/10850))
- [Pages] The page header and tabs now stay in place on every page: dashboards, System tabs, consoles, tasks, settings and creation forms scroll under them instead of scrolling with them (PR [#10822](https://github.com/vatesfr/xen-orchestra/pull/10822))
- [VM/Host] Main actions (shutdown, reboot, start, resume, migrate, snapshot) are shown as buttons in the VM and host headers and move one by one into "More actions" when space runs out; "More actions" groups them under "Change state" and "Actions" sections, and VMs without guest tools get force shutdown and force reboot instead (PR [#10815](https://github.com/vatesfr/xen-orchestra/pull/10815))
- [Web-Core/UiButtonIcon] Update icon buttons design, with a counter replacing the notification dot (PR [#10799](https://github.com/vatesfr/xen-orchestra/pull/10799))
@@ -15,10 +12,6 @@
- [Web-Core/UiDropdownButton] Update dropdown buttons design (PR [#9850](https://github.com/vatesfr/xen-orchestra/pull/9850))
- [Tables] Tables are filtered as you type, half a second after the last keystroke, or right away with Enter; the "Search" button is removed (PR [#10797](https://github.com/vatesfr/xen-orchestra/pull/10797))
- [Side panels] Fix the double scrollbar when the side panel content is taller than the screen: the page header now stays in place, and the list and the side panel each scroll on their own. All scrollbars are now thin, like the side panel one (PR [#10807](https://github.com/vatesfr/xen-orchestra/pull/10807))
- [Mobile] Searchable dropdown lists no longer overflow the screen (PR [#10854](https://github.com/vatesfr/xen-orchestra/pull/10854))
- [New/VM] Fix the storage table overflowing horizontally, which hid part of the delete button (PR [#10851](https://github.com/vatesfr/xen-orchestra/pull/10851))
- [New/VM] Fix template disk settings being applied to every disk of the new VM: each disk now keeps its own name, description and SR (PR [#10898](https://github.com/vatesfr/xen-orchestra/pull/10898))
- [VM/System] Display the default 4 MiB video RAM for HVM VMs that don't define it, as XO 6 does (PR [#10901](https://github.com/vatesfr/xen-orchestra/pull/10901))
## **0.27.0** (2026-10-29)

View File

@@ -27,13 +27,13 @@
"@types/file-saver": "^2.0.7",
"@types/lodash-es": "^4.17.12",
"@types/node": "^18.19.80",
"@vates/types": "^3.1.0",
"@vates/types": "^2.5.0",
"@vitejs/plugin-vue": "^6.0.0",
"@vue/tsconfig": "^0.9.0",
"@vueuse/core": "^14.0.0",
"@vueuse/math": "^14.0.0",
"@vueuse/shared": "^14.0.0",
"@xen-orchestra/web-core": "^0.66.1",
"@xen-orchestra/web-core": "^0.65.0",
"complex-matcher": "^1.1.1",
"d3-time-format": "^4.1.0",
"decorator-synchronized": "^0.6.0",

View File

@@ -2,12 +2,12 @@
<div class="collection-filter-row">
<span class="or">{{ t('or') }}</span>
<div class="inputs">
<UiInput v-if="newFilter.isAdvanced" v-model="filterContent" accent="neutral" class="advanced-input" />
<UiInput v-if="newFilter.isAdvanced" v-model="filterContent" accent="brand" class="advanced-input" />
<template v-else>
<VtsSelect :id="builderPropertySelectId" accent="neutral" />
<VtsSelect v-if="hasComparisonSelect" :id="builderComparisonSelectId" accent="neutral" />
<VtsSelect v-if="currentFilter?.type === 'enum'" :id="builderValueSelectId" accent="neutral" />
<UiInput v-else-if="hasValueInput" v-model="newFilter.builder.value" accent="neutral" />
<VtsSelect :id="builderPropertySelectId" accent="brand" />
<VtsSelect v-if="hasComparisonSelect" :id="builderComparisonSelectId" accent="brand" />
<VtsSelect v-if="currentFilter?.type === 'enum'" :id="builderValueSelectId" accent="brand" />
<UiInput v-else-if="hasValueInput" v-model="newFilter.builder.value" accent="brand" />
</template>
</div>
<div class="buttons">

View File

@@ -42,7 +42,7 @@ const progress = computed(() => {
.progress-circle-fill {
animation: progress 1s ease-out forwards;
fill: none;
stroke: var(--color-success-data);
stroke: var(--color-success-item-base);
stroke-width: 1.2;
stroke-linecap: round;
stroke-dasharray: v-bind(progress), 100;

View File

@@ -1,5 +1,5 @@
<template>
<VtsSelect v-if="isSelectWidget(widget)" :id="selectId" accent="neutral" />
<VtsSelect v-if="isSelectWidget(widget)" :id="selectId" accent="brand" />
<UiRadioButtonGroup v-else-if="isRadioWidget(widget)" accent="brand" gap="wide">
<UiRadioButton
v-for="choice in widget.choices"

View File

@@ -1,7 +1,7 @@
<template>
<VtsInputGroup>
<UiInput v-model.number="sizeInput" accent="neutral" type="number" :max-decimals="3" />
<VtsSelect :id="prefixSelectId" accent="neutral" />
<UiInput v-model.number="sizeInput" accent="brand" type="number" :max-decimals="3" />
<VtsSelect :id="prefixSelectId" accent="brand" />
</VtsInputGroup>
</template>

View File

@@ -2,8 +2,8 @@
<UiModal accent="info" @dismiss="emit('cancel')" @confirm="handleSubmit()">
<template #content>
<div class="form-selects">
<VtsSelect :id="sortPropertySelectId" accent="neutral" />
<VtsSelect :id="isAscendingSelectId" accent="neutral" />
<VtsSelect :id="sortPropertySelectId" accent="brand" />
<VtsSelect :id="isAscendingSelectId" accent="brand" />
</div>
</template>

View File

@@ -7,7 +7,7 @@
@dismiss="emit('cancel')"
>
<template #content>
<UiTextarea v-model="editedJson" accent="neutral" class="modal-textarea" />
<UiTextarea v-model="editedJson" accent="brand" class="modal-textarea" />
<VtsOverlayButton variant="tertiary" @click="formatJson()">
{{ t('action:reformat') }}
</VtsOverlayButton>

View File

@@ -8,7 +8,7 @@
:label="t('select-compression')"
learn-more-url="https://xcp-ng.org/blog/2018/12/19/zstd-compression-for-xcp-ng/"
>
<VtsSelect :id="compressionSelectId" accent="neutral" />
<VtsSelect :id="compressionSelectId" accent="brand" />
</VtsInputWrapper>
</template>
<template #buttons>

View File

@@ -7,7 +7,7 @@
<template #content>
<div>
<VtsInputWrapper :label="t('select-destination-host')">
<VtsSelect :id="hostSelectId" accent="neutral" />
<VtsSelect :id="hostSelectId" accent="brand" />
</VtsInputWrapper>
</div>
</template>

View File

@@ -45,7 +45,6 @@ const emit = defineEmits<{
const { t } = useI18n()
const { HeadCells, BodyCells, colspan } = useNewVmNetworkColumns({
exclude: ['rank'],
body: ({ networkInterface, onRemove }: { networkInterface: NetworkInterface; onRemove: () => void }) => {
const { id: interfaceSelectId } = useFormSelect(networks, {
model: toRef(networkInterface, 'interface'),

View File

@@ -1,5 +1,5 @@
<template>
<VtsTable class="new-vm-sr-table" fixed>
<VtsTable>
<thead>
<tr>
<HeadCells />
@@ -49,7 +49,6 @@ const emit = defineEmits<{
const { t } = useI18n()
const { HeadCells, BodyCells, colspan } = useNewVmSrColumns({
exclude: ['rank'],
body: ({ vdi, onRemove }: { vdi: Vdi; onRemove?: () => void }) => {
const { id: srSelectId } = useFormSelect(() => srs, {
model: toRef(vdi, 'SR'),
@@ -77,9 +76,3 @@ const { HeadCells, BodyCells, colspan } = useNewVmSrColumns({
},
})
</script>
<style lang="postcss" scoped>
.new-vm-sr-table {
--vts-table-min-width: 80rem;
}
</style>

View File

@@ -68,11 +68,11 @@ const hasError = computed(() => hostStoreHasError.value || vmStoreHasError.value
<style lang="postcss" scoped>
.progress-item {
--progress-bar-height: 1.2rem;
--progress-bar-color: var(--color-brand-data);
--progress-bar-color: var(--color-brand-item-base);
--progress-bar-background-color: var(--color-neutral-background-disabled);
&.warning {
--progress-bar-color: var(--color-warning-data);
--progress-bar-color: var(--color-warning-item-base);
--footer-value-color: var(--color-warning-item-base);
}

View File

@@ -56,7 +56,7 @@ const inactive = computed(() => props.total - props.active)
width: 1.3rem;
height: 1.3rem;
border-radius: 0.65rem;
background-color: var(--color-success-data);
background-color: var(--color-success-item-base);
&.inactive {
background-color: var(--color-neutral-background-disabled);

View File

@@ -59,7 +59,7 @@ const useTaskColumns = defineColumns(() => {
const { t } = useI18n()
return {
name: useTextColumn({ headerLabel: t('name'), flexible: true }),
name: useTextColumn({ headerLabel: t('name') }),
host: useLinkColumn({ headerLabel: t('host') }),
progress: useProgressBarColumn({ headerLabel: t('progress') }),
started: useDateColumn({ headerLabel: t('started') }),

View File

@@ -143,7 +143,7 @@ const state = useTableState({
})
const { HeadCells, BodyCells } = useVmColumns({
exclude: ['actions', 'checkbox', 'lastBackupDate'],
exclude: ['actions', 'checkbox'],
body: (vm: XenApiVm) => {
const guestMetrics = computed(() => getGuestMetrics(vm.guest_metrics))
const vmMetrics = computed(() => getVmMetrics(vm.metrics))

View File

@@ -57,7 +57,6 @@
import type { XenApiVm } from '@/libs/xen-api/xen-api.types.ts'
import { getHostIcon } from '@/modules/host/utils/host.util.ts'
import { useVmUtils } from '@/modules/vm/composables/vm-utils.composable.ts'
import { getVmDomainType } from '@/modules/vm/utils/vm.util.ts'
import { useHostMetricsStore } from '@/stores/xen-api/host-metrics.store.ts'
import { usePoolStore } from '@/stores/xen-api/pool.store.ts'
import { useVmGuestMetricsStore } from '@/stores/xen-api/vm-guest-metrics.store.ts'
@@ -134,7 +133,16 @@ const ram = computed(() => formatSizeRaw(vm.memory_dynamic_max, 0))
const osVersion = computed(() => guestMetrics.value?.os_version.name)
const domainType = computed(() => getVmDomainType(vm))
const domainType = computed(() => {
if (
vm.domain_type !== undefined && // XS < 7.5
vm.domain_type !== 'unspecified' // detection failed
) {
return vm.domain_type
}
return vm.HVM_boot_policy === '' ? 'pv' : 'hvm'
})
const virtualizationType = computed(() =>
domainType.value === 'hvm' && guestMetrics.value?.PV_drivers_detected ? 'pvhvm' : domainType.value

View File

@@ -10,8 +10,8 @@
</template>
</VtsTabularKeyValueRow>
<VtsTabularKeyValueRow :label="t('video-ram')">
<template v-if="videoRam" #value>
{{ `${videoRam} ${t('bytes:mi')}` }}
<template v-if="vm.platform.videoram" #value>
{{ `${vm.platform.videoram} ${t('bytes:mi')}` }}
</template>
</VtsTabularKeyValueRow>
</VtsTabularKeyValueList>
@@ -20,18 +20,14 @@
<script setup lang="ts">
import type { XenApiVm } from '@/libs/xen-api/xen-api.types.ts'
import { getVmDomainType } from '@/modules/vm/utils/vm.util.ts'
import VtsStatus from '@core/components/status/VtsStatus.vue'
import VtsTabularKeyValueList from '@core/components/tabular-key-value-list/VtsTabularKeyValueList.vue'
import VtsTabularKeyValueRow from '@core/components/tabular-key-value-row/VtsTabularKeyValueRow.vue'
import UiCard from '@core/components/ui/card/UiCard.vue'
import UiTitle from '@core/components/ui/title/UiTitle.vue'
import { computed } from 'vue'
import { useI18n } from 'vue-i18n'
const { vm } = defineProps<{ vm: XenApiVm }>()
defineProps<{ vm: XenApiVm }>()
const { t } = useI18n()
const videoRam = computed(() => (getVmDomainType(vm) === 'hvm' ? Number(vm.platform.videoram ?? 4) : undefined))
</script>

View File

@@ -35,7 +35,6 @@
<script setup lang="ts">
import type { XenApiVm } from '@/libs/xen-api/xen-api.types.ts'
import { getVmDomainType } from '@/modules/vm/utils/vm.util.ts'
import { useHostStore } from '@/stores/xen-api/host.store.ts'
import { usePoolStore } from '@/stores/xen-api/pool.store.ts'
import { useVtpmStore } from '@/stores/xen-api/vtpm.store.ts'
@@ -56,7 +55,16 @@ const { pool } = usePoolStore().subscribe()
const { getByOpaqueRef: getHostOpaqueRef } = useHostStore().subscribe()
const { getByOpaqueRef: getVtpmOpaqueRef } = useVtpmStore().subscribe()
const virtualizationMode = computed(() => getVmDomainType(vm))
/**
* @see `packages/xo-server/src/xapi/utils.mjs`:57
**/
const virtualizationMode = computed(() =>
vm.domain_type !== undefined && vm.domain_type !== 'unspecified'
? vm.domain_type
: vm.HVM_boot_policy === ''
? 'pv'
: 'hvm'
)
const isNestedVirtualizationEnabled = computed(() => {
const poolMaster = pool.value !== undefined ? getHostOpaqueRef(pool.value.master) : undefined

View File

@@ -1,6 +1,6 @@
<template>
<VtsInputWrapper :label :message="error">
<VtsSelect :id accent="neutral" />
<VtsSelect :id accent="brand" />
</VtsInputWrapper>
</template>

View File

@@ -1,6 +1,6 @@
<template>
<VtsInputWrapper :label :message="error">
<UiInput v-model.trim="model" accent="neutral" :required :disabled />
<UiInput v-model.trim="model" accent="brand" :required :disabled />
</VtsInputWrapper>
</template>

View File

@@ -1,5 +1,5 @@
<template>
<UiTextarea v-model.trim="model" accent="neutral">
<UiTextarea v-model.trim="model" accent="brand">
{{ t('description') }}
</UiTextarea>
</template>

View File

@@ -24,7 +24,6 @@
<script lang="ts" setup>
import type { XenApiVbd, XenApiVdi } from '@/libs/xen-api/xen-api.types.ts'
import { getVdiFormat, getVdiIcon } from '@/modules/vdi/utils/vdi.util.ts'
import { useVdiStore } from '@/stores/xen-api/vdi.store.ts'
import VtsRow from '@core/components/table/VtsRow.vue'
import VtsTable from '@core/components/table/VtsTable.vue'
import UiQuerySearchBar from '@core/components/ui/query-search-bar/UiQuerySearchBar.vue'
@@ -44,7 +43,6 @@ const { vdis, vbds, busy, error } = defineProps<{
error?: boolean
}>()
const { t } = useI18n()
const { getChainPhysicalUsage } = useVdiStore().subscribe()
const selectedVdiId = useRouteQuery('id')
const { items: filteredVdis, searchBindings } = useSearchFilter(() => vdis)
const state = useTableState({
@@ -58,7 +56,6 @@ const { HeadCells, BodyCells } = useVdiColumns({
exclude: ['actions'],
body: (vdi: XenApiVdi) => {
const vdiVbds = computed(() => vbds.filter(vbd => vbd.VDI === vdi.$ref))
const usedSpace = computed(() => formatSizeRaw(getChainPhysicalUsage(vdi), 2))
const size = computed(() => formatSizeRaw(vdi.virtual_size, 2))
const format = computed(() => getVdiFormat(vdi.sm_config['image-format']))
return {
@@ -68,7 +65,7 @@ const { HeadCells, BodyCells } = useVdiColumns({
icon: getVdiIcon(vdiVbds.value),
}),
description: r => r(vdi.name_description),
usedSpace: r => r(usedSpace.value.value, usedSpace.value.prefix),
usedSpace: r => r(vdi.physical_utilisation, vdi.virtual_size),
size: r => r(size.value.value, size.value.prefix),
format: r => r(format.value),
selectItem: r => r(() => (selectedVdiId.value = vdi.uuid)),

View File

@@ -1,48 +1,12 @@
<template>
<UiPanelCard>
<UiPanelCardTitle size="medium" :label="t('space')" />
<VtsCardRowList>
<VtsCardRowKeyValue>
<template #key>{{ t('used-space') }}</template>
<template #value>{{ usedSpace }}</template>
<template v-if="chainPhysicalUsage > 0" #addons>
<VtsCopyButton :value="usedSpace" />
</template>
</VtsCardRowKeyValue>
<VtsCardRowKeyValue>
<template #key>{{ t('size') }}</template>
<template #value>{{ size }}</template>
<template v-if="vdi.virtual_size > 0" #addons>
<VtsCopyButton :value="size" />
</template>
</VtsCardRowKeyValue>
</VtsCardRowList>
</UiPanelCard>
<VtsSpaceCard :used="vdi.physical_utilisation" :total="vdi.virtual_size" :label="vdi.name_label" />
</template>
<script setup lang="ts">
import type { XenApiVdi } from '@/libs/xen-api/xen-api.types.ts'
import { useVdiStore } from '@/stores/xen-api/vdi.store.ts'
import VtsCardRowKeyValue from '@core/components/card/VtsCardRowKeyValue.vue'
import VtsCardRowList from '@core/components/card/VtsCardRowList.vue'
import VtsCopyButton from '@core/components/copy-button/VtsCopyButton.vue'
import UiPanelCard from '@core/components/ui/panel-card/UiPanelCard.vue'
import UiPanelCardTitle from '@core/components/ui/panel-card-title/UiPanelCardTitle.vue'
import { formatSize } from '@core/utils/size.util.ts'
import { computed } from 'vue'
import { useI18n } from 'vue-i18n'
import VtsSpaceCard from '@core/components/space-card/VtsSpaceCard.vue'
const { vdi } = defineProps<{
defineProps<{
vdi: XenApiVdi
}>()
const { t } = useI18n()
const { getChainPhysicalUsage } = useVdiStore().subscribe()
const chainPhysicalUsage = computed(() => getChainPhysicalUsage(vdi))
const usedSpace = computed(() => formatSize(chainPhysicalUsage.value, 2))
const size = computed(() => formatSize(vdi.virtual_size, 2))
</script>

View File

@@ -1,5 +1,5 @@
<template>
<UiTextarea v-model.trim="model" :accent="errorMessage !== undefined ? 'danger' : 'neutral'">
<UiTextarea v-model.trim="model" :accent="errorMessage !== undefined ? 'danger' : 'brand'">
{{ t('allowed-ips') }}
<template #info>{{ t('allowed-ips-example') }}</template>

View File

@@ -1,11 +1,6 @@
<template>
<VtsInputWrapper :label="t('mac-address')" :message="messages" wrap-message>
<UiInput
v-model.trim="model"
accent="neutral"
:required
:placeholder="required ? undefined : t('auto-generated')"
/>
<UiInput v-model.trim="model" accent="brand" :required :placeholder="required ? undefined : t('auto-generated')" />
</VtsInputWrapper>
</template>

View File

@@ -1,6 +1,6 @@
<template>
<VtsInputWrapper :label="t('network')" :message="error">
<VtsSelect :id accent="neutral">
<VtsSelect :id accent="brand">
<template v-if="slots.option" #default="slotProps">
<slot name="option" v-bind="slotProps" />
</template>

View File

@@ -1,6 +1,6 @@
<template>
<VtsInputWrapper :label="t('rate-limit')" :message="error">
<UiInput v-model.number="model" accent="neutral" type="number">
<UiInput v-model.number="model" accent="brand" type="number">
<template #right-icon>
<span class="unit typo-body-regular">{{ t('bytes:kbs') }}</span>
</template>

View File

@@ -43,20 +43,6 @@ export function areVmToolsDetected(guestMetrics: XenApiVmGuestMetrics | undefine
return managementAgentDetected && pvDriversDetected
}
/**
* @see `packages/xo-server/src/xapi/utils.mjs`:57
**/
export function getVmDomainType(vm: XenApiVm) {
if (
vm.domain_type !== undefined && // XS < 7.5
vm.domain_type !== 'unspecified' // detection failed
) {
return vm.domain_type
}
return vm.HVM_boot_policy === '' ? 'pv' : 'hvm'
}
export type VmPowerStateAction =
| 'start'
| 'pause'

View File

@@ -103,7 +103,7 @@
<VtsKeyValueList>
<VtsKeyValueRow>
<template #label>
<VtsSelect :id="localeSelectId" accent="neutral" />
<VtsSelect :id="localeSelectId" accent="brand" />
</template>
<template #value>
<UiLink size="medium" href="https://translate.vates.tech/engage/xen-orchestra/">

View File

@@ -10,7 +10,7 @@
<UiTitle>{{ t('template') }}</UiTitle>
<div class="template-container">
<VtsInputWrapper :label="t('action:pick-template')">
<VtsSelect :id="templateSelectId" accent="neutral" />
<VtsSelect :id="templateSelectId" accent="brand" />
</VtsInputWrapper>
</div>
<div v-if="vmState.new_vm_template" class="form-container">
@@ -30,7 +30,7 @@
{{ t('iso-dvd') }}
</UiRadioButton>
</UiRadioButtonGroup>
<VtsSelect v-if="vmState.installMode === 'ISO'" :id="vdiIsoSelectId" accent="neutral" />
<VtsSelect v-if="vmState.installMode === 'ISO'" :id="vdiIsoSelectId" accent="brand" />
</div>
<div v-else class="install-settings-container">
<UiRadioButtonGroup
@@ -45,7 +45,7 @@
{{ t('pxe') }}
</UiRadioButton>
</UiRadioButtonGroup>
<VtsSelect v-if="vmState.installMode === 'ISO'" :id="vdiIsoSelectId" accent="neutral" />
<VtsSelect v-if="vmState.installMode === 'ISO'" :id="vdiIsoSelectId" accent="brand" />
</div>
</div>
<!-- SYSTEM SECTION -->
@@ -54,11 +54,11 @@
<div class="system-container">
<div class="column">
<VtsInputWrapper :label="t('new-vm:name')">
<UiInput v-model.trim="vmState.name" accent="neutral" />
<UiInput v-model.trim="vmState.name" accent="brand" />
</VtsInputWrapper>
<VtsInputWrapper :label="t('tags')">
<!-- TODO Change input text into select when Thierry's component is available -->
<UiInput v-model.trim="vmState.tag" accent="neutral" @keydown.enter.prevent="addTag" />
<UiInput v-model.trim="vmState.tag" accent="brand" @keydown.enter.prevent="addTag" />
</VtsInputWrapper>
<div v-if="vmState.tags.length > 0" class="chips">
<UiChip v-for="(tag, index) in vmState.tags" :key="index" accent="info" @remove="removeTag(index)">
@@ -66,7 +66,7 @@
</UiChip>
</div>
<VtsInputWrapper :label="t('boot-firmware')">
<VtsSelect :id="bootFirmwareSelectId" accent="neutral" />
<VtsSelect :id="bootFirmwareSelectId" accent="brand" />
</VtsInputWrapper>
<div
v-if="vmState.boot_firmware !== 'uefi'"
@@ -93,11 +93,11 @@
</UiCheckboxGroup>
</div>
<div class="column">
<UiTextarea v-model="vmState.description" accent="neutral">
<UiTextarea v-model="vmState.description" accent="brand">
{{ t('new-vm:description') }}
</UiTextarea>
<VtsInputWrapper :label="t('affinity-host')">
<VtsSelect :id="affinityHostSelectId" accent="neutral" />
<VtsSelect :id="affinityHostSelectId" accent="brand" />
</VtsInputWrapper>
</div>
</div>
@@ -105,15 +105,15 @@
<UiTitle>{{ t('resource-management') }}</UiTitle>
<div class="resource-management-container">
<VtsInputWrapper :label="t('vcpus')">
<UiInput v-model.number="vmState.vCPU" type="number" accent="neutral" />
<UiInput v-model.number="vmState.vCPU" type="number" accent="brand" />
</VtsInputWrapper>
<!-- TODO remove (GB) when we can use new selector -->
<VtsInputWrapper :label="`${t('ram')} (GB)`">
<UiInput v-model.number="ramFormatted" type="number" accent="neutral" />
<UiInput v-model.number="ramFormatted" type="number" accent="brand" />
</VtsInputWrapper>
<VtsInputWrapper :label="t('topology')">
<div class="topology">
<VtsSelect :id="topologySelectId" accent="neutral" />
<VtsSelect :id="topologySelectId" accent="brand" />
</div>
</VtsInputWrapper>
</div>
@@ -512,7 +512,6 @@ const getExistingVdis = (template: XenApiVm) => {
acc.push({
id: vdi.$ref,
userdevice: vbd.userdevice,
name_label: vdi.name_label,
name_description: vdi.name_description,
size: bytesToGiB(vdi.virtual_size),
@@ -699,7 +698,6 @@ const _createVm = defer(async ($defer: Defer) => {
const vdiRef = await xapi.getField<XenApiVdi['$ref']>('VBD', vbdRef, 'VDI')
const type = await xapi.getField<VBD_TYPE>('VBD', vbdRef, 'type')
const bootable = await xapi.getField<boolean>('VBD', vbdRef, 'bootable')
const userdevice = await xapi.getField<XenApiVbd['userdevice']>('VBD', vbdRef, 'userdevice')
if (!hasBootableDisk) {
hasBootableDisk = bootable
@@ -709,49 +707,45 @@ const _createVm = defer(async ($defer: Defer) => {
continue
}
const vdi = existingVdis.find(vdi => vdi.userdevice === userdevice)
for (const vdi of existingVdis) {
const srRef = await xapi.getField<XenApiSr['$ref']>('VDI', vdiRef, 'SR')
const vbdRefs = await xapi.getField<XenApiVbd['$ref'][]>('VDI', vdiRef, 'VBDs')
if (vdi === undefined) {
continue
}
await xapi.vdi.setNameLabel(vdiRef, vdi.name_label)
await xapi.vdi.setNameDescription(vdiRef, vdi.name_description)
const srRef = await xapi.getField<XenApiSr['$ref']>('VDI', vdiRef, 'SR')
const vbdRefs = await xapi.getField<XenApiVbd['$ref'][]>('VDI', vdiRef, 'VBDs')
await xapi.vdi.setNameLabel(vdiRef, vdi.name_label)
await xapi.vdi.setNameDescription(vdiRef, vdi.name_description)
// EDIT SR: Migrate VDI or create new one
if (vdi.SR !== srRef) {
try {
await xapi.vdi.poolMigrate(vdiRef, vdi.SR)
} catch (error) {
if (!(error instanceof Error)) {
throw error
}
const { message } = error
if (
message !== 'NO_HOSTS_AVAILABLE' &&
message !== 'LICENCE_RESTRICTION' &&
message !== 'VDI_NEEDS_VM_FOR_MIGRATE'
) {
throw error
}
const newVdiRef = await xapi.vdi.copy(vdiRef, vdi.SR)
if (vbdRefs) {
for (const vbdRef of vbdRefs) {
const vbd = await xapi.getField<XenApiVbd>('VBD', vbdRef, 'record')
await xapi.vbd.delete(vbdRef)
await xapi.vbd.create({ ...vbd, vmRefs, vdiRef: newVdiRef[0] })
// EDIT SR: Migrate VDI or create new one
if (vdi.SR !== srRef) {
try {
await xapi.vdi.poolMigrate(vdiRef, vdi.SR)
} catch (error) {
if (!(error instanceof Error)) {
throw error
}
}
await xapi.vdi.delete(vdiRef)
const { message } = error
if (
message !== 'NO_HOSTS_AVAILABLE' &&
message !== 'LICENCE_RESTRICTION' &&
message !== 'VDI_NEEDS_VM_FOR_MIGRATE'
) {
throw error
}
const newVdiRef = await xapi.vdi.copy(vdiRef, vdi.SR)
if (vbdRefs) {
for (const vbdRef of vbdRefs) {
const vbd = await xapi.getField<XenApiVbd>('VBD', vbdRef, 'record')
await xapi.vbd.delete(vbdRef)
await xapi.vbd.create({ ...vbd, vmRefs, vdiRef: newVdiRef[0] })
}
}
await xapi.vdi.delete(vdiRef)
}
}
}
}

View File

@@ -62,12 +62,12 @@
<FormSection :label="t('configuration')">
<div class="row">
<VtsInputWrapper :label="t('storage')" :message="t('n-gb-required', { n: REQUIRED_GB })">
<VtsSelect :id="srSelectId" accent="neutral" />
<VtsSelect :id="srSelectId" accent="brand" />
</VtsInputWrapper>
</div>
<div class="row">
<VtsInputWrapper :label="t('network')">
<VtsSelect :id="networkSelectId" accent="neutral" />
<VtsSelect :id="networkSelectId" accent="brand" />
</VtsInputWrapper>
<VtsInputWrapper
:label="t('deploy-xoa-custom-ntp-servers')"

View File

@@ -492,13 +492,6 @@ declare module 'vue-router/auto-routes' {
Record<never, never>,
| never
>,
'/story/web-core/middle-ellipsis/vts-middle-ellipsis': RouteRecordInfo<
'/story/web-core/middle-ellipsis/vts-middle-ellipsis',
'/story/web-core/middle-ellipsis/vts-middle-ellipsis',
Record<never, never>,
Record<never, never>,
| never
>,
'/story/web-core/number-input/vts-number-input': RouteRecordInfo<
'/story/web-core/number-input/vts-number-input',
'/story/web-core/number-input/vts-number-input',
@@ -562,13 +555,6 @@ declare module 'vue-router/auto-routes' {
Record<never, never>,
| never
>,
'/story/web-core/select/vts-detailed-option': RouteRecordInfo<
'/story/web-core/select/vts-detailed-option',
'/story/web-core/select/vts-detailed-option',
Record<never, never>,
Record<never, never>,
| never
>,
'/story/web-core/select/vts-select': RouteRecordInfo<
'/story/web-core/select/vts-select',
'/story/web-core/select/vts-select',
@@ -632,20 +618,6 @@ declare module 'vue-router/auto-routes' {
Record<never, never>,
| never
>,
'/story/web-core/tag/vts-tag': RouteRecordInfo<
'/story/web-core/tag/vts-tag',
'/story/web-core/tag/vts-tag',
Record<never, never>,
Record<never, never>,
| never
>,
'/story/web-core/tag-select/vts-tag-select': RouteRecordInfo<
'/story/web-core/tag-select/vts-tag-select',
'/story/web-core/tag-select/vts-tag-select',
Record<never, never>,
Record<never, never>,
| never
>,
'/story/web-core/tags-input/vts-tags-input': RouteRecordInfo<
'/story/web-core/tags-input/vts-tags-input',
'/story/web-core/tags-input/vts-tags-input',
@@ -653,13 +625,6 @@ declare module 'vue-router/auto-routes' {
Record<never, never>,
| never
>,
'/story/web-core/task/vts-task-list': RouteRecordInfo<
'/story/web-core/task/vts-task-list',
'/story/web-core/task/vts-task-list',
Record<never, never>,
Record<never, never>,
| never
>,
'/story/web-core/tree/vts-tree-item': RouteRecordInfo<
'/story/web-core/tree/vts-tree-item',
'/story/web-core/tree/vts-tree-item',
@@ -891,13 +856,6 @@ declare module 'vue-router/auto-routes' {
Record<never, never>,
| never
>,
'/story/web-core/ui/group-subcategory/ui-group-subcategory': RouteRecordInfo<
'/story/web-core/ui/group-subcategory/ui-group-subcategory',
'/story/web-core/ui/group-subcategory/ui-group-subcategory',
Record<never, never>,
Record<never, never>,
| never
>,
'/story/web-core/ui/head-bar/ui-head-bar': RouteRecordInfo<
'/story/web-core/ui/head-bar/ui-head-bar',
'/story/web-core/ui/head-bar/ui-head-bar',
@@ -905,13 +863,6 @@ declare module 'vue-router/auto-routes' {
Record<never, never>,
| never
>,
'/story/web-core/ui/image-radio-button/ui-image-radio-button': RouteRecordInfo<
'/story/web-core/ui/image-radio-button/ui-image-radio-button',
'/story/web-core/ui/image-radio-button/ui-image-radio-button',
Record<never, never>,
Record<never, never>,
| never
>,
'/story/web-core/ui/info/ui-info': RouteRecordInfo<
'/story/web-core/ui/info/ui-info',
'/story/web-core/ui/info/ui-info',
@@ -1010,13 +961,6 @@ declare module 'vue-router/auto-routes' {
Record<never, never>,
| never
>,
'/story/web-core/ui/overridden/ui-overridden': RouteRecordInfo<
'/story/web-core/ui/overridden/ui-overridden',
'/story/web-core/ui/overridden/ui-overridden',
Record<never, never>,
Record<never, never>,
| never
>,
'/story/web-core/ui/panel/ui-panel': RouteRecordInfo<
'/story/web-core/ui/panel/ui-panel',
'/story/web-core/ui/panel/ui-panel',
@@ -1066,20 +1010,6 @@ declare module 'vue-router/auto-routes' {
Record<never, never>,
| never
>,
'/story/web-core/ui/rich-checkbox/ui-rich-checkbox': RouteRecordInfo<
'/story/web-core/ui/rich-checkbox/ui-rich-checkbox',
'/story/web-core/ui/rich-checkbox/ui-rich-checkbox',
Record<never, never>,
Record<never, never>,
| never
>,
'/story/web-core/ui/rich-checkbox-group/ui-rich-checkbox-group': RouteRecordInfo<
'/story/web-core/ui/rich-checkbox-group/ui-rich-checkbox-group',
'/story/web-core/ui/rich-checkbox-group/ui-rich-checkbox-group',
Record<never, never>,
Record<never, never>,
| never
>,
'/story/web-core/ui/rich-radio-button/ui-rich-radio-button': RouteRecordInfo<
'/story/web-core/ui/rich-radio-button/ui-rich-radio-button',
'/story/web-core/ui/rich-radio-button/ui-rich-radio-button',
@@ -1087,13 +1017,6 @@ declare module 'vue-router/auto-routes' {
Record<never, never>,
| never
>,
'/story/web-core/ui/rich-radio-button-group/ui-rich-radio-button-group': RouteRecordInfo<
'/story/web-core/ui/rich-radio-button-group/ui-rich-radio-button-group',
'/story/web-core/ui/rich-radio-button-group/ui-rich-radio-button-group',
Record<never, never>,
Record<never, never>,
| never
>,
'/story/web-core/ui/stacked-bar/ui-stacked-bar': RouteRecordInfo<
'/story/web-core/ui/stacked-bar/ui-stacked-bar',
'/story/web-core/ui/stacked-bar/ui-stacked-bar',
@@ -1150,13 +1073,6 @@ declare module 'vue-router/auto-routes' {
Record<never, never>,
| never
>,
'/story/web-core/ui/tag/ui-label-value-tag': RouteRecordInfo<
'/story/web-core/ui/tag/ui-label-value-tag',
'/story/web-core/ui/tag/ui-label-value-tag',
Record<never, never>,
Record<never, never>,
| never
>,
'/story/web-core/ui/tag/ui-tag': RouteRecordInfo<
'/story/web-core/ui/tag/ui-tag',
'/story/web-core/ui/tag/ui-tag',
@@ -1171,6 +1087,13 @@ declare module 'vue-router/auto-routes' {
Record<never, never>,
| never
>,
'/story/web-core/ui/tag/ui-tertiary-tag': RouteRecordInfo<
'/story/web-core/ui/tag/ui-tertiary-tag',
'/story/web-core/ui/tag/ui-tertiary-tag',
Record<never, never>,
Record<never, never>,
| never
>,
'/story/web-core/ui/task-item/ui-task-item': RouteRecordInfo<
'/story/web-core/ui/task-item/ui-task-item',
'/story/web-core/ui/task-item/ui-task-item',
@@ -1178,6 +1101,13 @@ declare module 'vue-router/auto-routes' {
Record<never, never>,
| never
>,
'/story/web-core/ui/task-list/ui-task-list': RouteRecordInfo<
'/story/web-core/ui/task-list/ui-task-list',
'/story/web-core/ui/task-list/ui-task-list',
Record<never, never>,
Record<never, never>,
| never
>,
'/story/web-core/ui/title/ui-title': RouteRecordInfo<
'/story/web-core/ui/title/ui-title',
'/story/web-core/ui/title/ui-title',
@@ -1731,12 +1661,6 @@ declare module 'vue-router/auto-routes' {
views:
| never
}
'src/stories/web-core/middle-ellipsis/vts-middle-ellipsis.story.vue': {
routes:
| '/story/web-core/middle-ellipsis/vts-middle-ellipsis'
views:
| never
}
'src/stories/web-core/number-input/vts-number-input.story.vue': {
routes:
| '/story/web-core/number-input/vts-number-input'
@@ -1791,12 +1715,6 @@ declare module 'vue-router/auto-routes' {
views:
| never
}
'src/stories/web-core/select/vts-detailed-option.story.vue': {
routes:
| '/story/web-core/select/vts-detailed-option'
views:
| never
}
'src/stories/web-core/select/vts-select.story.vue': {
routes:
| '/story/web-core/select/vts-select'
@@ -1851,30 +1769,12 @@ declare module 'vue-router/auto-routes' {
views:
| never
}
'src/stories/web-core/tag/vts-tag.story.vue': {
routes:
| '/story/web-core/tag/vts-tag'
views:
| never
}
'src/stories/web-core/tag-select/vts-tag-select.story.vue': {
routes:
| '/story/web-core/tag-select/vts-tag-select'
views:
| never
}
'src/stories/web-core/tags-input/vts-tags-input.story.vue': {
routes:
| '/story/web-core/tags-input/vts-tags-input'
views:
| never
}
'src/stories/web-core/task/vts-task-list.story.vue': {
routes:
| '/story/web-core/task/vts-task-list'
views:
| never
}
'src/stories/web-core/tree/vts-tree-item.story.vue': {
routes:
| '/story/web-core/tree/vts-tree-item'
@@ -2073,24 +1973,12 @@ declare module 'vue-router/auto-routes' {
views:
| never
}
'src/stories/web-core/ui/group-subcategory/ui-group-subcategory.story.vue': {
routes:
| '/story/web-core/ui/group-subcategory/ui-group-subcategory'
views:
| never
}
'src/stories/web-core/ui/head-bar/ui-head-bar.story.vue': {
routes:
| '/story/web-core/ui/head-bar/ui-head-bar'
views:
| never
}
'src/stories/web-core/ui/image-radio-button/ui-image-radio-button.story.vue': {
routes:
| '/story/web-core/ui/image-radio-button/ui-image-radio-button'
views:
| never
}
'src/stories/web-core/ui/info/ui-info.story.vue': {
routes:
| '/story/web-core/ui/info/ui-info'
@@ -2175,12 +2063,6 @@ declare module 'vue-router/auto-routes' {
views:
| never
}
'src/stories/web-core/ui/overridden/ui-overridden.story.vue': {
routes:
| '/story/web-core/ui/overridden/ui-overridden'
views:
| never
}
'src/stories/web-core/ui/panel/ui-panel.story.vue': {
routes:
| '/story/web-core/ui/panel/ui-panel'
@@ -2223,30 +2105,12 @@ declare module 'vue-router/auto-routes' {
views:
| never
}
'src/stories/web-core/ui/rich-checkbox/ui-rich-checkbox.story.vue': {
routes:
| '/story/web-core/ui/rich-checkbox/ui-rich-checkbox'
views:
| never
}
'src/stories/web-core/ui/rich-checkbox-group/ui-rich-checkbox-group.story.vue': {
routes:
| '/story/web-core/ui/rich-checkbox-group/ui-rich-checkbox-group'
views:
| never
}
'src/stories/web-core/ui/rich-radio-button/ui-rich-radio-button.story.vue': {
routes:
| '/story/web-core/ui/rich-radio-button/ui-rich-radio-button'
views:
| never
}
'src/stories/web-core/ui/rich-radio-button-group/ui-rich-radio-button-group.story.vue': {
routes:
| '/story/web-core/ui/rich-radio-button-group/ui-rich-radio-button-group'
views:
| never
}
'src/stories/web-core/ui/stacked-bar/ui-stacked-bar.story.vue': {
routes:
| '/story/web-core/ui/stacked-bar/ui-stacked-bar'
@@ -2295,12 +2159,6 @@ declare module 'vue-router/auto-routes' {
views:
| never
}
'src/stories/web-core/ui/tag/ui-label-value-tag.story.vue': {
routes:
| '/story/web-core/ui/tag/ui-label-value-tag'
views:
| never
}
'src/stories/web-core/ui/tag/ui-tag.story.vue': {
routes:
| '/story/web-core/ui/tag/ui-tag'
@@ -2313,12 +2171,24 @@ declare module 'vue-router/auto-routes' {
views:
| never
}
'src/stories/web-core/ui/tag/ui-tertiary-tag.story.vue': {
routes:
| '/story/web-core/ui/tag/ui-tertiary-tag'
views:
| never
}
'src/stories/web-core/ui/task-item/ui-task-item.story.vue': {
routes:
| '/story/web-core/ui/task-item/ui-task-item'
views:
| never
}
'src/stories/web-core/ui/task-list/ui-task-list.story.vue': {
routes:
| '/story/web-core/ui/task-list/ui-task-list'
views:
| never
}
'src/stories/web-core/ui/title/ui-title.story.vue': {
routes:
| '/story/web-core/ui/title/ui-title'

View File

@@ -1,37 +1,9 @@
import type { XenApiVdi } from '@/libs/xen-api/xen-api.types.ts'
import { createXapiStoreConfig } from '@/stores/xen-api/create-xapi-store-config.ts'
import { createSubscribableStoreContext } from '@core/utils/create-subscribable-store-context.util.ts'
import { defineStore } from 'pinia'
export const useVdiStore = defineStore('xen-api-vdi', () => {
const { context: baseContext, ...configRest } = createXapiStoreConfig('vdi')
const config = createXapiStoreConfig('vdi')
const getChainPhysicalUsage = (vdi: XenApiVdi) => {
if (vdi.is_a_snapshot || !vdi.managed) {
return vdi.physical_utilisation
}
let total = vdi.physical_utilisation
let parentUuid = vdi.sm_config['vhd-parent'] as XenApiVdi['uuid'] | undefined
while (parentUuid !== undefined) {
const parent = baseContext.getByUuid(parentUuid)
if (parent === undefined) {
break
}
total += parent.physical_utilisation
parentUuid = parent.sm_config['vhd-parent'] as XenApiVdi['uuid'] | undefined
}
return total
}
const context = {
...baseContext,
getChainPhysicalUsage,
}
return createSubscribableStoreContext({ context, ...configRest }, {})
return createSubscribableStoreContext(config, {})
})

View File

@@ -4,7 +4,7 @@
<div class="row">
Choose a component
<VtsSelect :id="componentSelectId" accent="neutral" />
<VtsSelect :id="componentSelectId" accent="brand" />
</div>
<div class="row">

View File

@@ -4,7 +4,7 @@
<template #content>
<div class="demo-rename-modal-content">
<VtsInputWrapper label="New name">
<UiInput v-model.trim="newName" accent="neutral" required />
<UiInput v-model.trim="newName" accent="brand" required />
</VtsInputWrapper>
<p>
Tip: name the VM "fail" to make the fake API call fail: the confirmation modal closes and this modal stays

View File

@@ -1,24 +0,0 @@
<template>
<ComponentStory
v-slot="{ properties, settings }"
:params="[
prop('text')
.str()
.required()
.preset('prod-web-frontend-eu-west-01')
.widget()
.help('Rendered as is when it fits, cut in the middle otherwise, with the full text in a tooltip'),
prop('tailLength').num().default(10).widget().help('Number of characters kept visible at the end of a cut text'),
setting('width').widget(number()).preset(15).help('Available width, in rem'),
]"
>
<VtsMiddleEllipsis v-bind="properties" :style="{ width: `${settings.width}rem` }" />
</ComponentStory>
</template>
<script lang="ts" setup>
import ComponentStory from '@/components/component-story/ComponentStory.vue'
import { prop, setting } from '@/libs/story/story-param.ts'
import { number } from '@/libs/story/story-widget.ts'
import VtsMiddleEllipsis from '@core/components/middle-ellipsis/VtsMiddleEllipsis.vue'
</script>

View File

@@ -1,53 +0,0 @@
<template>
<ComponentStory
v-slot="{ properties }"
:params="[
prop('option')
.required()
.obj('FormOption<{ accent?: DropdownAccent }>')
.help('Given by the default slot of VtsSelect'),
iconProp().preset('object:network'),
prop('iconTooltip').str().widget(),
prop('details').str().widget().preset('eth0').help('Displayed after a dash'),
]"
:presets="{
'PIF with VLAN': {
props: {
icon: 'object:network',
details: 'eth1, VLAN 20',
},
},
'Disabled VM': {
props: {
icon: 'object:vm:running',
iconTooltip: 'Running',
details: 'No VIF detected',
},
},
'Without details': {
props: {
icon: 'object:network',
details: undefined,
},
},
}"
>
<VtsSelect :id="optionSelectId" accent="neutral">
<template #default="{ option }">
<VtsDetailedOption v-bind="properties" :option />
</template>
</VtsSelect>
</ComponentStory>
</template>
<script lang="ts" setup>
import ComponentStory from '@/components/component-story/ComponentStory.vue'
import { iconProp, prop } from '@/libs/story/story-param.ts'
import VtsDetailedOption from '@core/components/select/VtsDetailedOption.vue'
import VtsSelect from '@core/components/select/VtsSelect.vue'
import { useFormSelect } from '@core/packages/form-select'
const optionLabels = ['Pool-wide network associated with eth0', 'Storage network']
const { id: optionSelectId } = useFormSelect(optionLabels)
</script>

View File

@@ -2,32 +2,36 @@
<ComponentStory
v-slot="{ properties }"
:params="[
prop('accent').required().enum('neutral', 'success', 'warning', 'danger').preset('neutral').widget(),
prop('id').required().obj('FormSelectId').preset(id),
prop('accent').required().enum('brand', 'warning', 'danger').preset('brand').widget(),
prop('options').required().arr('FormOption<TEntry, TValue>').widget().preset(options),
prop('selectedLabel').str(),
prop('required').bool().widget(),
prop('placeholder').str().widget().preset('Choose colors'),
prop('searchPlaceholder').str().widget().preset('Search colors'),
prop('loading').bool().widget(),
model('search'),
slot(),
]"
>
<VtsSelect v-bind="properties" />
<VtsSelect v-bind="properties" v-model:search="searchTerm" :selected-label />
</ComponentStory>
</template>
<script lang="ts" setup>
import ComponentStory from '@/components/component-story/ComponentStory.vue'
import { prop, slot } from '@/libs/story/story-param.ts'
import { model, prop, slot } from '@/libs/story/story-param.ts'
import VtsSelect from '@core/components/select/VtsSelect.vue'
import { useFormSelect } from '@core/packages/form-select'
import { upperFirst } from 'lodash-es'
const colors = ['blue', 'yellow', 'red', 'green', 'orange', 'purple', 'white', 'grey', 'black']
const { id } = useFormSelect(colors, {
option: {
label: color => `${upperFirst(color)} color`,
disabled: color => color === 'blue' || color === 'orange' || color === 'black',
},
const { options, searchTerm, selectedLabel } = useFormSelect(colors, {
properties: color => ({
value: color,
label: `${upperFirst(color)} color`,
disabled: color === 'blue' || color === 'orange' || color === 'black',
}),
multiple: true,
searchable: true,
placeholder: 'Choose colors',
searchPlaceholder: 'Search colors',
})
</script>

View File

@@ -1,46 +0,0 @@
<template>
<ComponentStory
v-slot="{ properties }"
:params="[
prop('tags').arr('string').required().help('Currently selected tags. The component never mutates it'),
prop('suggestions').arr('TagSelectSuggestion').preset(suggestions).widget(),
prop('iconOnly').bool().widget().help('Displays the `Add`/`Edit` trigger as an icon with a tooltip'),
prop('busy').bool().widget().help('Displays the trigger as busy, e.g. while the tags are being saved'),
event('save')
.args({ changes: 'TagSelectChanges' })
.help('Emitted with the added and removed tags when clicking `Save`. `Cancel` discards the changes'),
]"
>
<UiTagsList>
<VtsTag v-for="tag of tags" :key="tag" :value="tag" accent="brand" />
<VtsTagSelect v-bind="properties" :tags @save="changes => saveTags(changes)" />
</UiTagsList>
</ComponentStory>
</template>
<script lang="ts" setup>
import ComponentStory from '@/components/component-story/ComponentStory.vue'
import { event, prop } from '@/libs/story/story-param.ts'
import VtsTag from '@core/components/tag/VtsTag.vue'
import VtsTagSelect, {
type TagSelectChanges,
type TagSelectSuggestion,
} from '@core/components/tag-select/VtsTagSelect.vue'
import UiTagsList from '@core/components/ui/tag/UiTagsList.vue'
import { ref } from 'vue'
const tags = ref(['production', 'env=prod'])
const suggestions: TagSelectSuggestion[] = [
{ tag: 'production' },
{ tag: 'staging' },
{ tag: 'env=prod' },
{ tag: 'env=dev' },
{ tag: 'xo:no-bak', info: 'Excludes the VM from backups' },
{ tag: 'xo:notify-on-snapshot', info: 'Notifies when a snapshot is created' },
]
function saveTags({ added, removed }: TagSelectChanges) {
tags.value = [...tags.value.filter(tag => !removed.includes(tag)), ...added]
}
</script>

View File

@@ -1,36 +0,0 @@
<template>
<ComponentStory
v-slot="{ properties }"
:params="[
prop('value')
.str()
.required()
.preset('env=prod')
.widget()
.help('Tags in the `term=label` form are displayed as a tertiary tag'),
prop('accent')
.type('TagAccent')
.enum('brand', 'info', 'neutral', 'success', 'warning', 'danger', 'muted')
.default('info')
.widget(),
prop('variant')
.type('TagVariant')
.enum('primary', 'secondary')
.default('secondary')
.widget()
.help('Ignored when the tag is displayed as a tertiary tag'),
prop('wrap')
.bool()
.widget()
.help('Stacks the term above the value when they do not fit on one line (tertiary tag only)'),
]"
>
<VtsTag v-bind="properties" />
</ComponentStory>
</template>
<script lang="ts" setup>
import ComponentStory from '@/components/component-story/ComponentStory.vue'
import { prop } from '@/libs/story/story-param.ts'
import VtsTag from '@core/components/tag/VtsTag.vue'
</script>

View File

@@ -9,6 +9,6 @@ The label comes from the surrounding `VtsInputWrapper`.
```vue-template
<VtsInputWrapper label="Values">
<VtsTagsInput v-model="values" accent="neutral" placeholder="Add a value" />
<VtsTagsInput v-model="values" accent="brand" placeholder="Add a value" />
</VtsInputWrapper>
```

View File

@@ -3,7 +3,7 @@
v-slot="{ properties }"
:params="[
model().type('string[]').preset(['alpha', 'beta']).help('Enter or comma adds the typed value'),
prop('accent').enum('neutral', 'warning', 'danger').required().preset('neutral').widget(),
prop('accent').enum('brand', 'warning', 'danger').required().preset('brand').widget(),
prop('placeholder').str().preset('Add a value').widget(),
]"
>

View File

@@ -1,33 +0,0 @@
<template>
<ComponentStory
v-slot="{ properties }"
:params="[
prop('tasks').type('Task[]').required().preset(allTasks),
prop('selectedTaskId').str().widget(),
prop('showEyeIcon').bool().widget(),
prop('autoCollapseCompleted').bool().widget(),
prop('expandAll')
.bool()
.widget()
.help('Shows every task expanded; turning it off restores the tasks expanded before'),
prop('unreadTaskIds').type('ReadonlySet<string>').help('Shows an unread dot column, with a dot for these tasks'),
event('select').args({ id: 'string' }),
]"
:presets="{
'Unread tasks': {
props: {
unreadTaskIds: new Set(['1', '1-2', '4', '9', '9-2', '9-2-1']),
},
},
}"
>
<VtsTaskList v-bind="properties" />
</ComponentStory>
</template>
<script lang="ts" setup>
import ComponentStory from '@/components/component-story/ComponentStory.vue'
import { event, prop } from '@/libs/story/story-param.ts'
import { allTasks } from '@/stories/web-core/ui/task-item/mock-tasks.ts'
import VtsTaskList from '@core/components/task/VtsTaskList.vue'
</script>

View File

@@ -3,7 +3,6 @@
v-slot="{ properties, settings }"
:params="[
prop('accent').type('CheckboxAccent').required().enum('brand', 'warning', 'danger').preset('brand').widget(),
prop('value').str().help('Used when the model is an array'),
prop('disabled').bool().widget(),
slot(),
slot('info'),
@@ -11,7 +10,7 @@
setting('defaultSlot').widget(text()).preset('Label'),
setting('info').widget(text()).preset('Lorem ipsum dolor sit amet, consectetur adipiscing elit.'),
setting('message').widget(text()).preset('Lorem ipsum dolor sit amet, consectetur adipiscing elit.'),
model().type('boolean | undefined | string[]').preset(undefined).help('undefined means partly checked'),
model().type('boolean').preset(undefined),
]"
>
<UiCheckbox v-bind="properties">

View File

@@ -7,7 +7,7 @@
prop('accent')
.type('CircleProgressBarAccent')
.required()
.enum('brand', 'info', 'warning', 'danger')
.enum('info', 'warning', 'danger')
.preset('info')
.widget(),
prop('size')
@@ -16,7 +16,6 @@
.enum('extra-small', 'small', 'medium', 'large')
.preset('large')
.widget(),
prop('noValue').bool().widget(),
]"
:presets
>
@@ -36,7 +35,6 @@ const presets = {
maxValue: 500,
size: 'medium',
accent: 'info',
noValue: false,
},
},
'75% of 300': {
@@ -45,34 +43,6 @@ const presets = {
maxValue: 300,
size: 'medium',
accent: 'info',
noValue: false,
},
},
'Value above max (success)': {
props: {
value: 150,
maxValue: 100,
size: 'medium',
accent: 'info',
noValue: false,
},
},
'Value above max (warning)': {
props: {
value: 150,
maxValue: 100,
size: 'medium',
accent: 'warning',
noValue: false,
},
},
'Brand ring without value': {
props: {
value: 1,
maxValue: 3,
size: 'small',
accent: 'brand',
noValue: true,
},
},
}

View File

@@ -1,23 +0,0 @@
<template>
<ComponentStory
v-slot="{ settings }"
:params="[
slot().help('Meant to receive the subcategory title'),
slot('info').help('Meant to receive a short text displayed on the right'),
setting('defaultSlot').widget(text()).preset('Into a pool'),
setting('info').widget(text()).preset('Writes to a pool'),
]"
>
<UiGroupSubcategory>
{{ settings.defaultSlot }}
<template v-if="settings.info" #info>{{ settings.info }}</template>
</UiGroupSubcategory>
</ComponentStory>
</template>
<script lang="ts" setup>
import ComponentStory from '@/components/component-story/ComponentStory.vue'
import { setting, slot } from '@/libs/story/story-param.ts'
import { text } from '@/libs/story/story-widget.ts'
import UiGroupSubcategory from '@core/components/ui/group-subcategory/UiGroupSubcategory.vue'
</script>

View File

@@ -1,39 +0,0 @@
<template>
<ComponentStory
v-slot="{ properties, settings }"
:params="[
prop('accent').required().enum('brand', 'warning', 'danger').preset('brand').widget(),
prop('size').required().enum('small', 'medium').preset('medium').widget(),
prop('disabled').bool().widget(),
prop('src').required().str().help('Image URL for rich mode'),
prop('alt').required().str().help('Alt text for image'),
model().type('string').preset(''),
setting('defaultSlot').widget(text()).preset('Label'),
]"
>
<div class="radio">
<UiImageRadioButton v-model="selectedRadio" value="1" v-bind="properties" :src="imageUrl" :alt="properties.alt">
{{ settings.defaultSlot }}
</UiImageRadioButton>
</div>
</ComponentStory>
</template>
<script lang="ts" setup>
import ComponentStory from '@/components/component-story/ComponentStory.vue'
import { model, prop, setting } from '@/libs/story/story-param.ts'
import { text } from '@/libs/story/story-widget.ts'
import UiImageRadioButton from '@core/components/ui/image-radio-button/UiImageRadioButton.vue'
import { ref } from 'vue'
import imageUrl from '../../../../assets/color-mode-dark.svg'
const selectedRadio = ref('')
</script>
<style lang="postcss" scoped>
.radio {
display: flex;
gap: 1.6rem;
flex-wrap: wrap;
}
</style>

View File

@@ -3,7 +3,7 @@
v-slot="{ properties }"
:params="[
model().type('string | number').preset(''),
prop('accent').enum('neutral', 'success', 'warning', 'danger').required().preset('neutral').widget(),
prop('accent').enum('brand', 'warning', 'danger').required().preset('brand').widget(),
prop('id').str().widget(),
prop('required').bool().widget(),
prop('selected').bool().widget(),

View File

@@ -3,7 +3,7 @@
v-slot="{ properties, settings }"
:params="[
model().type('string').preset(''),
prop('accent').enum('neutral', 'warning', 'danger').required().preset('neutral').widget(),
prop('accent').enum('brand', 'warning', 'danger').required().preset('brand').widget(),
prop('disabled').bool().widget(),
prop('href').str().widget(),
prop('max-characters').num().help('When used, it will display the character count under the input').widget(),

View File

@@ -1,19 +0,0 @@
<template>
<ComponentStory
v-slot="{ settings }"
:params="[
slot().help('Label displayed next to the dot, leave empty to only display the dot'),
setting('defaultSlot').widget(text()).preset('Overridden'),
]"
>
<UiOverridden v-if="settings.defaultSlot">{{ settings.defaultSlot }}</UiOverridden>
<UiOverridden v-else />
</ComponentStory>
</template>
<script lang="ts" setup>
import ComponentStory from '@/components/component-story/ComponentStory.vue'
import { setting, slot } from '@/libs/story/story-param.ts'
import { text } from '@/libs/story/story-widget.ts'
import UiOverridden from '@core/components/ui/overridden/UiOverridden.vue'
</script>

View File

@@ -10,16 +10,16 @@
slot().help('Meant to receive a list of radio button components'),
slot('label').help('Meant to receive a label UiLabel component or another component'),
slot('info').help('Meant to receive a message info or UiInfo component or another component'),
setting('imageRadioButton').widget(boolean()),
setting('richRadioButton').widget(boolean()),
]"
>
<UiRadioButtonGroup v-bind="properties">
<component
:is="settings.imageRadioButton === true ? UiImageRadioButton : UiRadioButton"
:is="settings.richRadioButton === true ? UiRichRadioButton : UiRadioButton"
v-for="(label, index) in labels"
:key="index"
v-model="selectedRadio"
v-bind="imageButtonProps(properties, settings.imageRadioButton)"
v-bind="richButtonProps(properties, settings.richRadioButton)"
:value="`radio-${index}`"
>
{{ label }}
@@ -32,9 +32,9 @@
import ComponentStory from '@/components/component-story/ComponentStory.vue'
import { prop, setting, slot } from '@/libs/story/story-param.ts'
import { boolean } from '@/libs/story/story-widget.ts'
import UiImageRadioButton from '@core/components/ui/image-radio-button/UiImageRadioButton.vue'
import UiRadioButton from '@core/components/ui/radio-button/UiRadioButton.vue'
import UiRadioButtonGroup from '@core/components/ui/radio-button-group/UiRadioButtonGroup.vue'
import UiRichRadioButton from '@core/components/ui/rich-radio-button/UiRichRadioButton.vue'
import { ref } from 'vue'
import imageUrl from '../../../../assets/color-mode-dark.svg'
@@ -42,8 +42,8 @@ const selectedRadio = ref('')
const labels = ref(['Label 1', 'Label 2', 'Label 3'])
const imageButtonProps = (properties: any, imageRadioButton: boolean) => {
if (imageRadioButton) {
const richButtonProps = (properties: any, richRadioButton: boolean) => {
if (richRadioButton) {
return {
...properties,
src: imageUrl,

View File

@@ -1,75 +0,0 @@
<template>
<ComponentStory
v-slot="{ properties }"
:params="[
prop('accent').type('RichCheckboxAccent').required().enum('brand', 'warning', 'danger').preset('brand').widget(),
prop('label').str().widget().preset('Backup repositories'),
prop('info').str().widget(),
prop('message').str().widget().help('Only displayed when the accent is not brand'),
prop('vertical').bool().widget().preset(true),
slot().help('Meant to receive UiRichCheckbox components, and UiGroupSubcategory components in vertical mode'),
slot('label').help('Meant to receive a UiLabel component or another component'),
slot('info').help('Meant to receive a UiInfo component or another component'),
slot('message').help('Meant to receive a UiInfo component or another component'),
]"
>
<UiRichCheckboxGroup v-bind="properties">
<template v-for="category of properties.vertical ? categories : horizontalCategories" :key="category.title">
<UiGroupSubcategory v-if="properties.vertical">
{{ category.title }}
<template v-if="category.info" #info>{{ category.info }}</template>
</UiGroupSubcategory>
<UiRichCheckbox
v-for="option of category.options"
:key="option.value"
v-model="selectedRepositories"
:accent="properties.accent"
:value="option.value"
:tag="option.tag"
:description="option.description"
:disabled="option.disabled"
icon="fa:server"
>
{{ option.label }}
</UiRichCheckbox>
</template>
</UiRichCheckboxGroup>
</ComponentStory>
</template>
<script lang="ts" setup>
import ComponentStory from '@/components/component-story/ComponentStory.vue'
import { prop, slot } from '@/libs/story/story-param.ts'
import UiGroupSubcategory from '@core/components/ui/group-subcategory/UiGroupSubcategory.vue'
import UiRichCheckbox from '@core/components/ui/rich-checkbox/UiRichCheckbox.vue'
import UiRichCheckboxGroup from '@core/components/ui/rich-checkbox-group/UiRichCheckboxGroup.vue'
import { ref } from 'vue'
type StoryOption = {
value: string
label: string
description: string
tag?: string
disabled?: boolean
}
const selectedRepositories = ref(['nfs-backups', 'smb-archive'])
const categories: { title: string; info?: string; options: StoryOption[] }[] = [
{
title: 'Category 1',
options: [
{ value: 'rd-s3', label: 'RD - S3', description: '3.1 TiB free', tag: 'Source' },
{ value: 'nfs-backups', label: 'NFS backups', description: '4.2 TiB free' },
{ value: 'local-backups', label: 'Local backups', description: '120 GiB free', disabled: true },
],
},
{
title: 'Category 2',
info: 'Info',
options: [{ value: 'smb-archive', label: 'SMB archive', description: '900 GiB free' }],
},
]
const horizontalCategories = categories.slice(0, 1)
</script>

View File

@@ -1,41 +0,0 @@
<template>
<ComponentStory
v-slot="{ properties, settings }"
:params="[
prop('accent').type('RichCheckboxAccent').required().enum('brand', 'warning', 'danger').preset('brand').widget(),
prop('value').str().help('Used when the model is an array'),
iconProp(),
prop('tag').str().widget().preset('Label'),
prop('description').str().widget().preset('Description'),
prop('info').str().widget(),
prop('message').str().widget().help('Only displayed when the accent is not brand'),
prop('disabled').bool().widget(),
model().type('boolean | undefined | string[]').preset(undefined).help('undefined means partly checked'),
slot().help('Meant to receive the label'),
slot('tag').help('Meant to receive a UiTag component, to use another accent than the default info one'),
slot('description'),
slot('info'),
slot('message'),
setting('defaultSlot').widget(text()).preset('Label'),
]"
>
<div class="checkbox">
<UiRichCheckbox v-bind="properties">
{{ settings.defaultSlot }}
</UiRichCheckbox>
</div>
</ComponentStory>
</template>
<script lang="ts" setup>
import ComponentStory from '@/components/component-story/ComponentStory.vue'
import { iconProp, model, prop, setting, slot } from '@/libs/story/story-param.ts'
import { text } from '@/libs/story/story-widget.ts'
import UiRichCheckbox from '@core/components/ui/rich-checkbox/UiRichCheckbox.vue'
</script>
<style lang="postcss" scoped>
.checkbox {
max-width: 40rem;
}
</style>

View File

@@ -1,125 +0,0 @@
<template>
<ComponentStory
v-slot="{ properties }"
:params="[
prop('accent')
.type('RichRadioButtonAccent')
.required()
.enum('brand', 'warning', 'danger')
.preset('brand')
.widget(),
prop('label').str().widget().preset('Restore type'),
prop('info').str().widget(),
prop('message').str().widget().help('Only displayed when the accent is not brand'),
prop('vertical').bool().widget().preset(true),
slot().help('Meant to receive UiRichRadioButton components, and UiGroupSubcategory components in vertical mode'),
slot('label').help('Meant to receive a UiLabel component or another component'),
slot('info').help('Meant to receive a UiInfo component or another component'),
slot('message').help('Meant to receive a UiInfo component or another component'),
]"
>
<UiRichRadioButtonGroup v-bind="properties">
<template v-for="category of properties.vertical ? categories : horizontalCategories" :key="category.title">
<UiGroupSubcategory v-if="properties.vertical">
{{ category.title }}
<template #info>{{ category.info }}</template>
</UiGroupSubcategory>
<UiRichRadioButton
v-for="option of category.options"
:key="option.value"
v-model="selectedRadio"
:accent="properties.accent"
:value="option.value"
:icon="option.icon"
:description="option.description"
:disabled="option.disabled"
>
{{ option.label }}
<template v-if="option.tag" #tag>
<UiTag :accent="option.tag.accent" variant="secondary">{{ option.tag.label }}</UiTag>
</template>
</UiRichRadioButton>
</template>
</UiRichRadioButtonGroup>
</ComponentStory>
</template>
<script lang="ts" setup>
import ComponentStory from '@/components/component-story/ComponentStory.vue'
import { prop, slot } from '@/libs/story/story-param.ts'
import type { IconName } from '@core/icons'
import UiGroupSubcategory from '@core/components/ui/group-subcategory/UiGroupSubcategory.vue'
import UiRichRadioButton from '@core/components/ui/rich-radio-button/UiRichRadioButton.vue'
import UiRichRadioButtonGroup from '@core/components/ui/rich-radio-button-group/UiRichRadioButtonGroup.vue'
import UiTag, { type TagAccent } from '@core/components/ui/tag/UiTag.vue'
import { ref } from 'vue'
type StoryOption = {
value: string
label: string
description: string
icon: IconName
tag?: { label: string; accent: TagAccent }
disabled?: boolean
}
const selectedRadio = ref('copy-then-start')
const categories: { title: string; info: string; options: StoryOption[] }[] = [
{
title: 'Into a pool',
info: 'Writes to a pool',
options: [
{
value: 'copy-then-start',
label: 'Copy, then start',
description:
'Copy the disks to a storage of the pool, then start the VM. When a snapshot of the VM is still in the pool, only the blocks that differ are transferred, if possible.',
icon: 'action:copy',
tag: { label: 'Default', accent: 'info' },
},
{
value: 'start-now',
label: 'Start now',
description: 'Start the VM right away from the backup. What it writes goes to a cache storage.',
icon: 'status:running',
tag: { label: 'Live restore', accent: 'neutral' },
},
{
value: 'attach-disk',
label: 'Attach a disk to a running VM',
description: 'Serve a disk of the backup, read-only, to an existing VM. Nothing is copied.',
icon: 'action:attach',
},
],
},
{
title: 'Out of the backup',
info: 'Nothing written to a pool',
options: [
{
value: 'download-files',
label: 'Download files',
description:
'Browse a partition of a disk and download individual files or folders. Best for a small amount of data.',
icon: 'action:download',
},
{
value: 'export-disk',
label: 'Export a disk',
description: 'Convert one disk to qcow2, vmdk, vhd or raw, then download it.',
icon: 'action:download',
},
{
value: 'export-vm',
label: 'Export the VM',
description: 'Build an XVA from the backup, to import into XCP-ng or XenServer.',
icon: 'action:download',
disabled: true,
},
],
},
]
const horizontalCategories = categories.slice(0, 1)
</script>

View File

@@ -2,30 +2,17 @@
<ComponentStory
v-slot="{ properties, settings }"
:params="[
prop('accent')
.type('RichRadioButtonAccent')
.required()
.enum('brand', 'warning', 'danger')
.preset('brand')
.widget(),
iconProp(),
prop('tag').str().widget().preset('Label'),
prop('description').str().widget().preset('Description'),
prop('info').str().widget(),
prop('accent').required().enum('brand', 'warning', 'danger').preset('brand').widget(),
prop('size').required().enum('small', 'medium').preset('medium').widget(),
prop('disabled').bool().widget(),
model().type('string'),
slot().help('Meant to receive the label'),
slot('tag').help('Meant to receive a UiTag component, to use another accent than the default info one'),
slot('description'),
slot('info'),
prop('src').required().str().help('Image URL for rich mode'),
prop('alt').required().str().help('Alt text for image'),
model().type('string').preset(''),
setting('defaultSlot').widget(text()).preset('Label'),
]"
>
<div class="radios">
<UiRichRadioButton v-model="selectedRadio" v-bind="properties" value="1">
{{ settings.defaultSlot }}
</UiRichRadioButton>
<UiRichRadioButton v-model="selectedRadio" v-bind="properties" value="2">
<div class="radio">
<UiRichRadioButton v-model="selectedRadio" value="1" v-bind="properties" :src="imageUrl" :alt="properties.alt">
{{ settings.defaultSlot }}
</UiRichRadioButton>
</div>
@@ -34,19 +21,19 @@
<script lang="ts" setup>
import ComponentStory from '@/components/component-story/ComponentStory.vue'
import { iconProp, model, prop, setting, slot } from '@/libs/story/story-param.ts'
import { model, prop, setting } from '@/libs/story/story-param.ts'
import { text } from '@/libs/story/story-widget.ts'
import UiRichRadioButton from '@core/components/ui/rich-radio-button/UiRichRadioButton.vue'
import { ref } from 'vue'
import imageUrl from '../../../../assets/color-mode-dark.svg'
const selectedRadio = ref('')
</script>
<style lang="postcss" scoped>
.radios {
.radio {
display: flex;
flex-direction: column;
gap: 0.8rem;
max-width: 40rem;
gap: 1.6rem;
flex-wrap: wrap;
}
</style>

View File

@@ -1,40 +0,0 @@
<template>
<ComponentStory
v-slot="{ properties, settings }"
:params="[
prop('accent')
.type('TagAccent')
.required()
.preset('info')
.enum('brand', 'info', 'neutral', 'success', 'warning', 'danger', 'muted')
.widget(),
prop('truncate')
.bool()
.widget()
.help('Keeps the tag on one line: the longer part ends with an ellipsis first, the shorter one stays whole'),
prop('wrap').bool().widget().help('Stacks the term above the value when they do not fit on one line'),
slot(),
slot('term'),
setting('slot').preset('Label').widget(),
setting('term').preset('term').widget(),
setting('maxWidth').widget(number()).help('Maximum width, in rem'),
]"
>
<UiLabelValueTag
v-bind="properties"
:style="{ maxWidth: settings.maxWidth ? `${settings.maxWidth}rem` : undefined }"
>
{{ settings.slot }}
<template #term>
{{ settings.term }}
</template>
</UiLabelValueTag>
</ComponentStory>
</template>
<script lang="ts" setup>
import ComponentStory from '@/components/component-story/ComponentStory.vue'
import { prop, setting, slot } from '@/libs/story/story-param.ts'
import { number } from '@/libs/story/story-widget.ts'
import UiLabelValueTag from '@core/components/ui/tag/UiLabelValueTag.vue'
</script>

View File

@@ -6,10 +6,9 @@
.type('TagAccent')
.required()
.preset('info')
.enum('brand', 'info', 'neutral', 'success', 'warning', 'danger', 'muted')
.enum('info', 'neutral', 'success', 'warning', 'danger', 'muted')
.widget(),
prop('variant').type('TagVariant').required().preset('primary').enum('primary', 'secondary').widget(),
iconProp(),
slot(),
setting('slot').preset('Label').widget(),
]"
@@ -22,6 +21,6 @@
<script lang="ts" setup>
import ComponentStory from '@/components/component-story/ComponentStory.vue'
import { iconProp, prop, setting, slot } from '@/libs/story/story-param.ts'
import { prop, setting, slot } from '@/libs/story/story-param.ts'
import UiTag from '@core/components/ui/tag/UiTag.vue'
</script>

View File

@@ -8,18 +8,18 @@
<UiTag accent="success" variant="primary">{{ settings.slot }}</UiTag>
<UiTag accent="warning" variant="secondary">{{ settings.slot }}</UiTag>
<UiTag accent="danger" variant="secondary">{{ settings.slot }}</UiTag>
<UiLabelValueTag accent="info">
<UiTertiaryTag accent="info">
{{ settings.slot }}
<template #term>
{{ settings.slot }}
</template>
</UiLabelValueTag>
<UiLabelValueTag accent="success">
</UiTertiaryTag>
<UiTertiaryTag accent="success">
{{ settings.slot }}
<template #term>
{{ settings.slot }}
</template>
</UiLabelValueTag>
</UiTertiaryTag>
</UiTagsList>
</ComponentStory>
</template>
@@ -27,7 +27,7 @@
<script lang="ts" setup>
import ComponentStory from '@/components/component-story/ComponentStory.vue'
import { setting, slot } from '@/libs/story/story-param.ts'
import UiLabelValueTag from '@core/components/ui/tag/UiLabelValueTag.vue'
import UiTag from '@core/components/ui/tag/UiTag.vue'
import UiTagsList from '@core/components/ui/tag/UiTagsList.vue'
import UiTertiaryTag from '@core/components/ui/tag/UiTertiaryTag.vue'
</script>

View File

@@ -0,0 +1,30 @@
<template>
<ComponentStory
v-slot="{ properties, settings }"
:params="[
prop('accent')
.type('TagAccent')
.required()
.preset('info')
.enum('info', 'neutral', 'success', 'warning', 'danger', 'muted')
.widget(),
slot(),
slot('term'),
setting('slot').preset('Label').widget(),
setting('term').preset('term').widget(),
]"
>
<UiTertiaryTag v-bind="properties">
{{ settings.slot }}
<template #term>
{{ settings.term }}
</template>
</UiTertiaryTag>
</ComponentStory>
</template>
<script lang="ts" setup>
import ComponentStory from '@/components/component-story/ComponentStory.vue'
import { prop, setting, slot } from '@/libs/story/story-param.ts'
import UiTertiaryTag from '@core/components/ui/tag/UiTertiaryTag.vue'
</script>

View File

@@ -67,107 +67,10 @@ export const deepNestedTask: Task = {
],
}
export const pendingWithoutProgressTask: Task = {
id: '6',
name: 'Queued replication',
status: 'pending',
start: Date.now() - 2 * 60_000,
}
export const pendingFullProgressTask: Task = {
id: '7',
name: 'Finalize export',
status: 'pending',
progress: 100,
start: Date.now() - 60_000,
infos: [{ message: 'Waiting for cleanup', data: null }],
}
export const infosAndWarningsTask: Task = {
id: '8',
name: 'Rolling pool update',
status: 'pending',
progress: 50,
start: Date.now() - 3 * 60 * 60_000,
infos: [{ message: 'Hosts updated', data: { hosts: 4, done: 2 } }],
warnings: [{ message: 'Reboot required after update', data: { host: 'host-3' } }],
subtasks: [
{ id: '8-1', name: 'host-1', status: 'success', progress: 100, end: Date.now() - 2 * 60 * 60_000 },
{ id: '8-2', name: 'host-2', status: 'success', progress: 100, end: Date.now() - 60 * 60_000 },
{ id: '8-3', name: 'host-3', status: 'pending', progress: 30, start: Date.now() - 15 * 60_000 },
],
}
export const failedNestedTask: Task = {
id: '9',
name: 'Disaster recovery drill',
status: 'failure',
progress: 100,
start: Date.now() - 8 * 60 * 60_000,
end: Date.now() - 7 * 60 * 60_000,
subtasks: [
{ id: '9-1', name: 'Provision VM', status: 'success', progress: 100, end: Date.now() - 7.5 * 60 * 60_000 },
{
id: '9-2',
name: 'Restore data',
status: 'failure',
progress: 100,
end: Date.now() - 7 * 60 * 60_000,
warnings: [{ message: 'Missing backup files', data: { missing: 3 } }],
subtasks: [
{ id: '9-2-1', name: 'Mount SR', status: 'failure', progress: 100, end: Date.now() - 7.1 * 60 * 60_000 },
],
},
],
}
export const interruptedTask: Task = {
id: '10',
name: 'Storage migration',
status: 'interrupted',
progress: 10,
start: Date.now() - 2 * 60 * 60_000,
infos: [
{ message: 'Rows migrated before interruption', data: { rows: 1200 } },
{ message: 'Task manually aborted', data: null },
],
}
export const longNameTask: Task = {
id: '11',
name: 'Very long task name that should wrap gracefully in the task list UI when space is limited',
status: 'pending',
progress: 8,
start: Date.now() - 2 * 60 * 60_000,
}
export const longNameWithEverythingTask: Task = {
id: '12',
name: 'Very long task name for a full backup job that also has subtasks, infos, warnings and an end time to display',
to: '#',
status: 'failure',
progress: 100,
start: Date.now() - 5 * 60 * 60_000,
end: Date.now() - 4 * 60 * 60_000,
infos: [{ message: 'Transferred 120 GiB', data: { size: 120 } }],
warnings: [{ message: 'Some VDIs were skipped', data: { skipped: 2 } }],
subtasks: [
{ id: '12-1', name: 'Snapshot', status: 'success', progress: 100, end: Date.now() - 4.5 * 60 * 60_000 },
{ id: '12-2', name: 'Transfer', status: 'failure', progress: 100, end: Date.now() - 4 * 60 * 60_000 },
],
}
export const allTasks: Task[] = [
pendingBackupTask,
completedWithRootLinkTask,
failedWithWarningsTask,
migrationNamePartsTask,
deepNestedTask,
pendingWithoutProgressTask,
pendingFullProgressTask,
infosAndWarningsTask,
failedNestedTask,
interruptedTask,
longNameTask,
longNameWithEverythingTask,
]

View File

@@ -4,22 +4,27 @@
:presets
:params="[
prop('task').type('object').required().widget().preset(pendingBackupTask),
prop('depth').type('number').required().preset(1),
model('expanded').prop(p => p.type('boolean').widget(boolean()).preset(false)),
prop('selected').type('boolean').widget(boolean()).preset(false),
prop('showEyeIcon').type('boolean').widget(boolean()).preset(true),
prop('showUnread').bool().widget().help('Reserves the unread dot column'),
prop('unread').bool().widget(),
event('expand'),
event('select').args({ id: 'string' }),
]"
>
<UiTaskItem v-bind="properties" />
<ul>
<UiTaskItem v-bind="properties" @expand="properties['onUpdate:expanded']?.(!properties.expanded)" />
</ul>
</ComponentStory>
</template>
<script lang="ts" setup>
import ComponentStory from '@/components/component-story/ComponentStory.vue'
import { event, prop } from '@/libs/story/story-param.ts'
import { event, model, prop } from '@/libs/story/story-param.ts'
import { boolean } from '@/libs/story/story-widget.ts'
import {
completedWithRootLinkTask,
deepNestedTask,
failedWithWarningsTask,
migrationNamePartsTask,
pendingBackupTask,
@@ -35,24 +40,45 @@ const presets: Record<
'Pending backup': {
props: {
task: pendingBackupTask,
depth: 1,
expanded: false,
selected: false,
showEyeIcon: true,
},
},
'Completed + root link': {
props: {
task: completedWithRootLinkTask,
depth: 1,
expanded: false,
selected: false,
showEyeIcon: true,
},
},
'Failed + warnings': {
props: {
task: failedWithWarningsTask,
depth: 1,
expanded: false,
selected: false,
showEyeIcon: true,
},
},
'Migration (nameParts)': {
props: {
task: migrationNamePartsTask,
depth: 1,
expanded: false,
selected: false,
showEyeIcon: true,
},
},
'Deep nested': {
props: {
task: deepNestedTask,
depth: 1,
expanded: true,
selected: false,
showEyeIcon: true,
},
},

View File

@@ -0,0 +1,15 @@
<template>
<ComponentStory
v-slot="{ properties }"
:params="[prop('tasks').type('Task[]').required().preset(allTasks), event('select')]"
>
<UiTaskList v-bind="properties" />
</ComponentStory>
</template>
<script lang="ts" setup>
import ComponentStory from '@/components/component-story/ComponentStory.vue'
import { event, prop } from '@/libs/story/story-param.ts'
import { allTasks } from '@/stories/web-core/ui/task-item/mock-tasks.ts'
import UiTaskList from '@core/components/ui/task-list/UiTaskList.vue'
</script>

View File

@@ -1,16 +1,8 @@
import type {
XenApiHost,
XenApiNetwork,
XenApiSr,
XenApiVbd,
XenApiVdi,
XenApiVm,
} from '@/libs/xen-api/xen-api.types.ts'
import type { XenApiHost, XenApiNetwork, XenApiSr, XenApiVdi, XenApiVm } from '@/libs/xen-api/xen-api.types.ts'
import { type OPAQUE_REF_NULL, type VDI_TYPE } from '@vates/types/common'
export interface Vdi {
id?: XenApiVdi['$ref'] | undefined
userdevice?: XenApiVbd['userdevice']
name_label: string
name_description: string
size: number

View File

@@ -1,7 +1,7 @@
{
"private": false,
"name": "@xen-orchestra/log",
"version": "1.0.0",
"version": "0.7.2",
"license": "ISC",
"description": "Logging system with decoupled producers/consumer",
"keywords": [

View File

@@ -1,7 +1,7 @@
{
"private": false,
"name": "@xen-orchestra/mcp",
"version": "1.4.4",
"version": "1.4.3",
"description": "MCP server for Xen Orchestra — allows AI assistants to query and manage XO infrastructure",
"type": "module",
"main": "./dist/index.mjs",
@@ -34,7 +34,7 @@
"devDependencies": {
"@eslint/js": "^9.19.0",
"@types/node": "^22.3.0",
"@vates/types": "^3.1.0",
"@vates/types": "^2.5.0",
"rimraf": "^6.0.0",
"typescript": "~5.6.3",
"typescript-eslint": "^8.61.0"

View File

@@ -14,18 +14,18 @@
"url": "https://vates.fr"
},
"license": "AGPL-3.0-or-later",
"version": "0.24.0",
"version": "0.23.0",
"engines": {
"node": ">=15.6"
},
"dependencies": {
"@vates/async-each": "^1.0.3",
"@vates/event-listeners-manager": "^1.0.1",
"@vates/iscsi": "^0.4.1",
"@vates/iscsi": "^0.4.0",
"@vates/parse-duration": "^0.1.1",
"@vates/task": "^0.7.0",
"@xen-orchestra/backup-archive": "^1.2.1",
"@xen-orchestra/log": "^1.0.0",
"@xen-orchestra/backup-archive": "^1.2.0",
"@xen-orchestra/log": "^0.7.2",
"acme-client": "^5.0.0",
"app-conf": "^3.0.0",
"fast-xml-parser": "^4.0.0",
@@ -36,7 +36,7 @@
"xo-common": "^0.11.0"
},
"devDependencies": {
"@vates/types": "^3.1.0"
"@vates/types": "^2.5.0"
},
"scripts": {
"postversion": "npm publish --access public",

Some files were not shown because too many files have changed in this diff Show More