mirror of
https://github.com/vatesfr/xen-orchestra.git
synced 2026-11-20 13:58:45 -06:00
Compare commits
117 Commits
docs-fixes
...
web/fix-qu
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
dd18f3e97d | ||
|
|
7c670b479e | ||
|
|
a1103f6da9 | ||
|
|
4c5b5f603b | ||
|
|
d77d6d0d9f | ||
|
|
93be967459 | ||
|
|
a62ac1ab82 | ||
|
|
55f51184c2 | ||
|
|
f7ae461337 | ||
|
|
3f57f2b8ec | ||
|
|
2786c9c392 | ||
|
|
332b4d6197 | ||
|
|
8fa7a77fab | ||
|
|
a0046fa19f | ||
|
|
692f60c323 | ||
|
|
9e4fe7a2a3 | ||
|
|
bcee503a77 | ||
|
|
29af04b8f2 | ||
|
|
c00659ba61 | ||
|
|
d7afda4c52 | ||
|
|
d07732119b | ||
|
|
396ba3868f | ||
|
|
4453bbc16c | ||
|
|
b01adbe2e1 | ||
|
|
46f5e7bc0d | ||
|
|
d76e7744e2 | ||
|
|
b6100980fc | ||
|
|
b8a839068e | ||
|
|
d2fd68df74 | ||
|
|
5d03dc3c10 | ||
|
|
1c01f1c7fe | ||
|
|
8135148217 | ||
|
|
067ee26715 | ||
|
|
c8827ab076 | ||
|
|
ba4b9b6cb3 | ||
|
|
44d93b90b3 | ||
|
|
7bb6592be4 | ||
|
|
8f2b8791cc | ||
|
|
b56ffbdb8d | ||
|
|
b4e05b3183 | ||
|
|
c2c8d1b1ea | ||
|
|
857d038316 | ||
|
|
b16d568b7a | ||
|
|
1471ab0c7c | ||
|
|
ee74a640b4 | ||
|
|
44bfc28a44 | ||
|
|
de0c535976 | ||
|
|
3fdc97b690 | ||
|
|
ec042d1089 | ||
|
|
a459015ca9 | ||
|
|
4944ea902f | ||
|
|
4c93609bfe | ||
|
|
c2144947c9 | ||
|
|
0d481ffb18 | ||
|
|
b4c22f623d | ||
|
|
e84e34efa5 | ||
|
|
878e8ceea7 | ||
|
|
876c28d392 | ||
|
|
6a08b82d86 | ||
|
|
9dda9be6f0 | ||
|
|
98ddd115fd | ||
|
|
39cb465941 | ||
|
|
f28181b07c | ||
|
|
31bbf0bdff | ||
|
|
a509a7c6b7 | ||
|
|
02b732b9da | ||
|
|
89e4f051fc | ||
|
|
d36d64380d | ||
|
|
1dc2d2b6fa | ||
|
|
348dfab021 | ||
|
|
fbc5e3e071 | ||
|
|
f7feaaa4f9 | ||
|
|
a96865198d | ||
|
|
114df4e18e | ||
|
|
3676ce9764 | ||
|
|
3512a2f768 | ||
|
|
d68c8c7ee0 | ||
|
|
0c2c948712 | ||
|
|
c9d053e70d | ||
|
|
c3905bc10d | ||
|
|
ba30ca08d9 | ||
|
|
4dfd4829ad | ||
|
|
e0fccacc2f | ||
|
|
3937eadbce | ||
|
|
043387a913 | ||
|
|
88f2e3b7eb | ||
|
|
ea6410e711 | ||
|
|
e1ce9eca7b | ||
|
|
b0cfd9e7f9 | ||
|
|
4f44af6763 | ||
|
|
384bb37dd4 | ||
|
|
a4410a3c82 | ||
|
|
e900f61ed6 | ||
|
|
a65f6cd42d | ||
|
|
aee55234ea | ||
|
|
5ddb78fdf6 | ||
|
|
f8cb07596b | ||
|
|
6c32155327 | ||
|
|
c6d8ccf85a | ||
|
|
659e636657 | ||
|
|
d15776e44a | ||
|
|
e9ba0bd494 | ||
|
|
f1e3e6968a | ||
|
|
354284f6ca | ||
|
|
f53b78bef1 | ||
|
|
769dc19baa | ||
|
|
9d3cffd211 | ||
|
|
c1c3b56441 | ||
|
|
e0748796eb | ||
|
|
4ac481e311 | ||
|
|
05847ca1fc | ||
|
|
dd7538b82b | ||
|
|
b665bb3e6e | ||
|
|
a324da30bc | ||
|
|
5911d266f9 | ||
|
|
2090898ce2 | ||
|
|
5d66e6de5f |
@@ -233,7 +233,7 @@ module.exports = {
|
||||
'@intlify/vue-i18n/no-duplicate-keys-in-locale': 'error',
|
||||
'@intlify/vue-i18n/no-missing-keys-in-other-locales': [
|
||||
'error',
|
||||
{ ignoreLocales: ['de', 'fa', 'cs', 'es', 'sv', 'it', 'ru', 'uk', 'nl'] },
|
||||
{ ignoreLocales: ['de', 'fa', 'cs', 'es', 'sv', 'it', 'ru', 'uk', 'nl', 'pt_BR'] },
|
||||
],
|
||||
},
|
||||
},
|
||||
|
||||
@@ -19,12 +19,12 @@
|
||||
},
|
||||
"main": "./index.mjs",
|
||||
"dependencies": {
|
||||
"@xen-orchestra/fs": "^4.6.2",
|
||||
"@xen-orchestra/fs": "^4.6.3",
|
||||
"@xen-orchestra/log": "^0.7.1",
|
||||
"fuse-native": "^2.2.6",
|
||||
"lru-cache": "^7.14.0",
|
||||
"promise-toolbox": "^0.21.0",
|
||||
"vhd-lib": "^4.14.0"
|
||||
"vhd-lib": "^4.14.1"
|
||||
},
|
||||
"bin": {
|
||||
"xo-fuse-vhd": "./cli.mjs"
|
||||
|
||||
122
@vates/nbd-client/NbdDisk.mjs
Normal file
122
@vates/nbd-client/NbdDisk.mjs
Normal file
@@ -0,0 +1,122 @@
|
||||
import { RandomAccessDisk } from '@xen-orchestra/disk-transform'
|
||||
import NbdClient from '@vates/nbd-client'
|
||||
|
||||
/**
|
||||
* @typedef {{ offset: number, length: number }} DataRange
|
||||
*/
|
||||
|
||||
/**
|
||||
* @extends {RandomAccessDisk}
|
||||
*/
|
||||
export class NbdDisk extends RandomAccessDisk {
|
||||
#nbdInfos
|
||||
/** @type {NbdClient|undefined} */
|
||||
#nbdClient
|
||||
|
||||
/** @type {Array<DataRange> | undefined} */
|
||||
#dataMap
|
||||
|
||||
/** @type {number} */
|
||||
#blockSize
|
||||
|
||||
constructor(nbdInfos, blockSize, { dataMap } = {}) {
|
||||
super()
|
||||
this.#blockSize = blockSize
|
||||
this.#nbdInfos = nbdInfos
|
||||
this.#dataMap = dataMap && this.#processDatamap(dataMap)
|
||||
}
|
||||
|
||||
#processDatamap(rawDataMap) {
|
||||
return rawDataMap
|
||||
.filter(({ type }) => type === 0)
|
||||
.map(({ offset, length }) => ({ offset, length }))
|
||||
.sort(({ offset: offset1 }, { offset: offset2 }) => offset1 - offset2)
|
||||
}
|
||||
/**
|
||||
* @param {number} index
|
||||
* @returns {Promise<DiskBlock>}
|
||||
*/
|
||||
async readBlock(index) {
|
||||
if (!this.#nbdClient) {
|
||||
throw new Error("can't readBlock before init")
|
||||
}
|
||||
const data = await this.#nbdClient.readBlock(index, this.getBlockSize())
|
||||
return {
|
||||
index,
|
||||
data,
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns {number}
|
||||
*/
|
||||
getVirtualSize() {
|
||||
if (!this.#nbdClient) {
|
||||
throw new Error("can't get size before init")
|
||||
}
|
||||
return Number(this.#nbdClient.exportSize)
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns {number}
|
||||
*/
|
||||
getBlockSize() {
|
||||
return this.#blockSize
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns {Promise<void>}
|
||||
*/
|
||||
async init() {
|
||||
this.#nbdClient = new NbdClient(this.#nbdInfos)
|
||||
await this.#nbdClient.connect()
|
||||
if (this.#dataMap === undefined) {
|
||||
this.#dataMap = this.#processDatamap(await this.#nbdClient.getMap())
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns {Promise<void>}
|
||||
*/
|
||||
async close() {
|
||||
await this.#nbdClient?.disconnect()
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns {boolean}
|
||||
*/
|
||||
isDifferencing() {
|
||||
return false
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns {Array<number>}
|
||||
*/
|
||||
getBlockIndexes() {
|
||||
const indexes = new Set()
|
||||
this.#dataMap?.forEach(({ offset, length }) => {
|
||||
if (length === 0) return
|
||||
|
||||
const firstBlockIndex = Math.floor(offset / this.getBlockSize())
|
||||
const lastBlockIndex = Math.floor((offset + length - 1) / this.getBlockSize())
|
||||
|
||||
for (let blockIndex = firstBlockIndex; blockIndex <= lastBlockIndex; blockIndex++) {
|
||||
indexes.add(blockIndex)
|
||||
}
|
||||
})
|
||||
return [...indexes].sort((a, b) => a - b)
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {number} index
|
||||
* @returns {boolean}
|
||||
*/
|
||||
hasBlock(index) {
|
||||
if (!this.#dataMap) {
|
||||
throw new Error("can't hasBlock before init")
|
||||
}
|
||||
const blockStart = index * this.getBlockSize()
|
||||
const blockEnd = (index + 1) * this.getBlockSize()
|
||||
return this.#dataMap.some(({ offset, length }) => offset + length > blockStart && blockEnd >= offset)
|
||||
}
|
||||
}
|
||||
@@ -20,6 +20,7 @@ import {
|
||||
OPTS_MAGIC,
|
||||
NBD_CMD_DISC,
|
||||
} from './constants.mjs'
|
||||
import { spawn } from 'node:child_process'
|
||||
|
||||
const { warn } = createLogger('vates:nbd-client')
|
||||
|
||||
@@ -358,4 +359,40 @@ export default class NbdClient {
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* returns the map of the file with holes, zeros and data, useful to handle efficiently sparse source
|
||||
* to implement this internally: use structure response if the server supports it, and then ask for BLOCK_STATUS *
|
||||
*
|
||||
* @returns {Promise<{ offset: number, length: number, type: number }[]>}
|
||||
* A promise that resolves to an array where each object represents a segment:
|
||||
* - `offset` — The byte offset from the start.
|
||||
* - `length` — The size of the segment in bytes.
|
||||
* - `type` — A numeric code indicating the segment type ( 0 means no data).
|
||||
*/
|
||||
/* async */ getMap() {
|
||||
return new Promise((resolve, reject) => {
|
||||
const process = spawn('nbdinfo', [
|
||||
'--json',
|
||||
'--map',
|
||||
`nbd://${this.#serverAddress}:${this.#serverPort}/${encodeURIComponent(this.#exportName)}`,
|
||||
])
|
||||
let text = ''
|
||||
let errText = ''
|
||||
process.stdout.on('data', data => (text += data))
|
||||
process.stderr.on('data', data => (errText += data))
|
||||
process.on('error', reject)
|
||||
process.on('close', code => {
|
||||
if (code !== 0) {
|
||||
return reject(new Error(`Error during getMap (code: ${code}): ${errText}`))
|
||||
}
|
||||
try {
|
||||
const json = JSON.parse(text)
|
||||
resolve(json)
|
||||
} catch (error) {
|
||||
reject(new Error(`${error} ${text}`))
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -129,4 +129,17 @@ export default class MultiNbdClient {
|
||||
yield readAhead.shift()
|
||||
}
|
||||
}
|
||||
/**
|
||||
* returns the map of the file with holes, zeros and data, useful to handle efficiently sparse source *
|
||||
*
|
||||
* @returns {Promise<{ offset: number, length: number, type: number }[]>}
|
||||
* A promise that resolves to an array where each object represents a segment:
|
||||
* - `offset` — The byte offset from the start.
|
||||
* - `length` — The size of the segment in bytes.
|
||||
* - `type` — A numeric code indicating the segment type (0 means no data).
|
||||
*/
|
||||
async getMap() {
|
||||
// ask the map from one of the connected client
|
||||
return this.#clients[Math.floor(this.#clients.length * Math.random())].getMap()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,18 +13,19 @@
|
||||
"url": "https://vates.fr"
|
||||
},
|
||||
"license": "ISC",
|
||||
"version": "3.1.4",
|
||||
"version": "3.2.1",
|
||||
"engines": {
|
||||
"node": ">=14.0"
|
||||
},
|
||||
"main": "./index.mjs",
|
||||
"dependencies": {
|
||||
"@vates/async-each": "^1.0.0",
|
||||
"@vates/read-chunk": "^1.2.0",
|
||||
"@vates/read-chunk": "^1.2.1",
|
||||
"@xen-orchestra/async-map": "^0.1.2",
|
||||
"@xen-orchestra/disk-transform": "^1.0.1",
|
||||
"@xen-orchestra/log": "^0.7.1",
|
||||
"promise-toolbox": "^0.21.0",
|
||||
"xen-api": "^4.7.3"
|
||||
"xen-api": "^4.7.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
"tap": "^18.7.0",
|
||||
|
||||
@@ -71,13 +71,17 @@ exports.readChunk = readChunk
|
||||
* If `size` bytes are not available to be read, the returned promise is rejected.
|
||||
*
|
||||
* @param {Readable} stream - A readable stream to read from.
|
||||
* @param {number} [size] - The number of bytes to read for binary streams (ignored for object streams).
|
||||
* @param {number?} [size] - The number of bytes to read for binary streams (ignored for object streams).
|
||||
* @returns {Promise<Buffer|string|unknown>} - A Promise that resolves to the read chunk.
|
||||
*/
|
||||
exports.readChunkStrict = async function readChunkStrict(stream, size) {
|
||||
const chunk = await readChunk(stream, size)
|
||||
if (chunk === null) {
|
||||
throw new Error('stream has ended without data')
|
||||
if (size === undefined) {
|
||||
throw new Error(`stream has ended without data`)
|
||||
} else {
|
||||
throw new Error(`stream has ended without data, was looking for ${size} bytes`)
|
||||
}
|
||||
}
|
||||
|
||||
if (size !== undefined && chunk.length !== size) {
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
"type": "git",
|
||||
"url": "https://github.com/vatesfr/xen-orchestra.git"
|
||||
},
|
||||
"version": "1.2.0",
|
||||
"version": "1.2.1",
|
||||
"engines": {
|
||||
"node": ">=8.10"
|
||||
},
|
||||
|
||||
@@ -2,8 +2,17 @@
|
||||
|
||||
import eslint from '@eslint/js'
|
||||
import tseslint from 'typescript-eslint'
|
||||
import { fileURLToPath } from 'node:url'
|
||||
import path from 'node:path'
|
||||
|
||||
const __dirname = path.dirname(fileURLToPath(import.meta.url))
|
||||
|
||||
export default tseslint.config(eslint.configs.recommended, tseslint.configs.recommended, {
|
||||
languageOptions: {
|
||||
parserOptions: {
|
||||
tsconfigRootDir: __dirname,
|
||||
},
|
||||
},
|
||||
ignores: ['dist'],
|
||||
rules: {
|
||||
// Allow empty interface for recursive generic typing (E.g. interface XenApiNetworkWrapped)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@vates/types",
|
||||
"private": false,
|
||||
"version": "1.10.0",
|
||||
"version": "1.12.0",
|
||||
"main": "./dist/index.mjs",
|
||||
"exports": {
|
||||
".": {
|
||||
@@ -21,6 +21,10 @@
|
||||
"./lib/xen-orchestra/*": {
|
||||
"default": "./dist/lib/xen-orchestra-*.mjs",
|
||||
"type": "./dist/lib/xen-orchestra-*.d.mts"
|
||||
},
|
||||
"./lib/complex-matcher": {
|
||||
"default": "./dist/lib/complex-matcher.mjs",
|
||||
"type": "./dist/lib/complex-matcher.d.mts"
|
||||
}
|
||||
},
|
||||
"type": "module",
|
||||
|
||||
@@ -655,6 +655,14 @@ export const BACKUP_TYPE = { backup: 'backup', metadata: 'metadataBackup', mirro
|
||||
|
||||
export type BACKUP_TYPE = (typeof BACKUP_TYPE)[keyof typeof BACKUP_TYPE]
|
||||
|
||||
export const SUPPORTED_VDI_FORMAT = {
|
||||
raw: 'raw',
|
||||
vhd: 'vhd',
|
||||
qcow2: 'qcow2',
|
||||
} as const
|
||||
|
||||
export type SUPPORTED_VDI_FORMAT = (typeof SUPPORTED_VDI_FORMAT)[keyof typeof SUPPORTED_VDI_FORMAT]
|
||||
|
||||
// ----- XAPI Stats
|
||||
|
||||
type XapiStatsResponse<T> = {
|
||||
|
||||
@@ -2,3 +2,4 @@ export * from './common.mjs'
|
||||
export * from './xen-api.mjs'
|
||||
export * from './xo.mjs'
|
||||
export * from './lib/xen-orchestra-xapi.mjs'
|
||||
export * from './lib/complex-matcher.mjs'
|
||||
|
||||
5
@vates/types/src/lib/complex-matcher.mts
Normal file
5
@vates/types/src/lib/complex-matcher.mts
Normal file
@@ -0,0 +1,5 @@
|
||||
export type Or<T> = Id<{ __or: T[] }>
|
||||
|
||||
export type Id<T> = { id: T }
|
||||
|
||||
export type IdOr<T> = Id<T> | Or<T>
|
||||
@@ -1,7 +1,21 @@
|
||||
import { Branded } from '../common.mjs'
|
||||
|
||||
export type Task = {
|
||||
id: Branded<'task'>
|
||||
export interface VatesTask {
|
||||
_abortController: AbortController
|
||||
_onProgress(data?: unknown): void
|
||||
|
||||
run: <T>(fn: () => T) => Promise<T>
|
||||
id: Branded<'vates-task'>
|
||||
status: 'failure' | 'pending' | 'success'
|
||||
|
||||
abort(reason?: unknown): void
|
||||
failure(error?: unknown): void
|
||||
info(message: string, data: unknown): void
|
||||
run<T>(fn: () => T | (() => Promise<T>)): Promise<T>
|
||||
runInside<T>(fn: () => T | (() => Promise<T>)): Promise<T>
|
||||
set(name: string, value: unknown): void
|
||||
start(): void
|
||||
success(result?: unknown): void
|
||||
warning(message: string, data: unknown): void
|
||||
wrap<T>(fn: () => T | (() => Promise<T>)): Promise<T>
|
||||
wrapInside<T>(fn: () => T | (() => Promise<T>)): Promise<T>
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ import {
|
||||
XenApiVm,
|
||||
XenApiVmWrapped,
|
||||
} from '../xen-api.mjs'
|
||||
import type { Readable } from 'node:stream'
|
||||
import type { PassThrough, Readable } from 'node:stream'
|
||||
import type {
|
||||
XoGpuGroup,
|
||||
XoVgpuType,
|
||||
@@ -22,6 +22,7 @@ import type {
|
||||
XoVm,
|
||||
XoVmTemplate,
|
||||
} from '../xo.mjs'
|
||||
import type { SUPPORTED_VDI_FORMAT } from '../common.mjs'
|
||||
|
||||
export type XcpPatches = {
|
||||
changelog?: {
|
||||
@@ -78,10 +79,28 @@ export interface Xapi {
|
||||
}
|
||||
): Promise<XenApiNetworkWrapped>
|
||||
deleteNetwork(id: XoNetwork['id']): Promise<void>
|
||||
exportVmOva(vmRef: XenApiVm['$ref']): Promise<PassThrough>
|
||||
listMissingPatches(host: XoHost['id']): Promise<XcpPatches[] | XsPatches[]>
|
||||
pool_emergencyShutdown(): Promise<void>
|
||||
resumeVm(id: XoVm['id']): Promise<void>
|
||||
unpauseVm(id: XoVm['id']): Promise<void>
|
||||
SR_importVdi(
|
||||
ref: XenApiSr['$ref'],
|
||||
stream: Readable,
|
||||
opts?: {
|
||||
format?: SUPPORTED_VDI_FORMAT
|
||||
name_description?: XoVdi['name_description']
|
||||
name_label?: XoVdi['name_label']
|
||||
other_config?: XoVdi['other_config']
|
||||
read_only?: boolean
|
||||
sharable?: boolean
|
||||
SR?: XenApiSr['$ref']
|
||||
tags?: XoVdi['tags']
|
||||
type?: XoVdi['type']
|
||||
virtual_size?: XoVdi['size']
|
||||
xenstore_data?: Record<string, string>
|
||||
}
|
||||
): Promise<XenApiVdi['$ref']>
|
||||
startVm(
|
||||
id: XoVm['id'],
|
||||
opts?: {
|
||||
@@ -97,6 +116,10 @@ export interface Xapi {
|
||||
startOnly?: boolean
|
||||
}
|
||||
): Promise<void>
|
||||
VM_export(
|
||||
vmRef: XenApiVm['$ref'],
|
||||
opts?: { cancelToken?: unknown; compress?: boolean; useSnapshot?: boolean }
|
||||
): ReturnType<Xapi['getResource']>
|
||||
VM_import(
|
||||
stream: Readable,
|
||||
srRef?: XenApiSr['$ref'],
|
||||
@@ -153,7 +176,12 @@ export interface Xapi {
|
||||
creatorId?: XoUser['id'],
|
||||
opts?: { destroyAllVifs: boolean }
|
||||
): Promise<XenApiVmWrapped>
|
||||
VDI_destroy(vdiRef: XenApiVdi['$ref']): Promise<void>
|
||||
VDI_destroyCloudInitConfig(vdiRef: XenApiVdi['$ref'], opts?: { timeLimit?: number }): Promise<void>
|
||||
VDI_exportContent(
|
||||
vdiRef: XenApiVdi['$ref'],
|
||||
opts: { baseRef?: string; cancelToken?: unknown; format: SUPPORTED_VDI_FORMAT }
|
||||
): Promise<Readable & { length?: number }>
|
||||
VM_createCloudInitConfig(
|
||||
vmRef: XenApiVm['$ref'],
|
||||
cloudConfig: string,
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
// Types based on xapi-object-to-xo
|
||||
|
||||
import type {
|
||||
BACKUP_TYPE,
|
||||
Branded,
|
||||
DOMAIN_TYPE,
|
||||
HOST_ALLOWED_OPERATIONS,
|
||||
@@ -19,6 +18,7 @@ import type {
|
||||
VM_OPERATIONS,
|
||||
VM_POWER_STATE,
|
||||
} from './common.mjs'
|
||||
import type * as CMType from './lib/complex-matcher.mjs'
|
||||
|
||||
type BaseXapiXo = {
|
||||
$pool: XoPool['id']
|
||||
@@ -133,6 +133,18 @@ export type XoAlarm = Omit<XoMessage, '$object' | 'body'> & {
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: to be typed when Bastien.N has finished working on the XO task
|
||||
type BaseXoLog = {
|
||||
id: Branded<'xo-log'>
|
||||
[key: string]: unknown
|
||||
}
|
||||
export type XoBackupLog = BaseXoLog & {
|
||||
message: 'backup' | 'metadata'
|
||||
}
|
||||
export type XoRestoreLog = BaseXoLog & {
|
||||
message: 'restore'
|
||||
}
|
||||
|
||||
export type XoBackupRepository = {
|
||||
benchmarks?: { readRate: number; timestamp: number; writeRate: number }[]
|
||||
enabled: boolean
|
||||
@@ -371,63 +383,122 @@ export type XoPool = BaseXapiXo & {
|
||||
|
||||
export type XoProxy = {
|
||||
id: Branded<'proxy'>
|
||||
}
|
||||
url: string
|
||||
version?: string
|
||||
name: string
|
||||
} & (
|
||||
| { address?: undefined; vmUuid: XoVm['id'] }
|
||||
| { address: string; vmUuid?: undefined }
|
||||
| { address: string; vmUuid: XoVm['id'] }
|
||||
)
|
||||
|
||||
type BaseXoJob = {
|
||||
id: Branded<'job'>
|
||||
name?: string
|
||||
}
|
||||
// @TODO: create type for complex matcher
|
||||
export type XoBackupJob = BaseXoJob & {
|
||||
|
||||
type XoBackupJobGeneralSettings = {
|
||||
backupReportTpl?: 'compactMjml' | 'mjml'
|
||||
reportWhen?: 'always' | 'error' | 'failure' | 'never'
|
||||
hideSuccessfulItems?: boolean
|
||||
[key: string]: unknown
|
||||
}
|
||||
|
||||
export type XoVmBackupJobGeneralSettings = XoBackupJobGeneralSettings & {
|
||||
cbtDestroySnapshotData?: boolean
|
||||
concurrency?: number
|
||||
longTermRetention?: {
|
||||
daily?: { retention: number; settings: Record<string, unknown> }
|
||||
weekly?: { retention: number; settings: Record<string, unknown> }
|
||||
monthly?: { retention: number; settings: Record<string, unknown> }
|
||||
yearly?: { retention: number; settings: Record<string, unknown> }
|
||||
}
|
||||
maxExportRate?: number
|
||||
nbdConcurrency?: number
|
||||
nRetriesVmBackupFailures?: number
|
||||
preferNbd?: boolean
|
||||
timezone?: string
|
||||
mergeBackupsSynchronously?: boolean
|
||||
offlineBackup?: boolean
|
||||
timeout?: number
|
||||
[key: string]: unknown
|
||||
}
|
||||
export type XoVmBackupJobScheduleSettings = {
|
||||
exportRetention?: number
|
||||
healthCheckVmsWithTags?: XoVm['tags']
|
||||
fullInterval?: number
|
||||
copyRetention?: number
|
||||
snapshotRetention?: number
|
||||
cbtDestroySnapshotData?: boolean
|
||||
healthCheckSr?: XoSr['id']
|
||||
[key: string]: unknown
|
||||
}
|
||||
export type XoVmBackupJob = BaseXoJob & {
|
||||
compression?: 'native' | 'zstd' | ''
|
||||
proxy?: XoProxy['id']
|
||||
mode: 'full' | 'delta'
|
||||
name?: string
|
||||
remotes?: {
|
||||
id: XoBackupRepository['id'] | { __or: XoBackupRepository['id'][] }
|
||||
}
|
||||
vms?: {
|
||||
id: XoVm['id'] | { __or: XoVm['id'][] } | Record<string, unknown>
|
||||
}
|
||||
srs: {
|
||||
id: XoSr['id'] | { __or: XoSr['id'][] }
|
||||
}
|
||||
type: BACKUP_TYPE
|
||||
remotes?: CMType.IdOr<XoBackupRepository['id']>
|
||||
vms: CMType.IdOr<XoVm['id']> | Record<string, unknown>
|
||||
srs?: CMType.IdOr<XoSr['id']>
|
||||
type: 'backup'
|
||||
settings: {
|
||||
'': {
|
||||
cbtDestroySnapshotData?: boolean
|
||||
concurrency?: number
|
||||
longTermRetention?: {
|
||||
daily?: { retention: number; settings: Record<string, unknown> }
|
||||
weekly?: { retention: number; settings: Record<string, unknown> }
|
||||
monthly?: { retention: number; settings: Record<string, unknown> }
|
||||
yearly?: { retention: number; settings: Record<string, unknown> }
|
||||
}
|
||||
maxExportRate?: number
|
||||
nbdConcurrency?: number
|
||||
nRetriesVmBackupFailures?: number
|
||||
preferNbd?: boolean
|
||||
timezone?: string
|
||||
[key: string]: unknown
|
||||
}
|
||||
[key: XoSchedule['id']]: {
|
||||
exportRetention?: number
|
||||
healthCheckSr?: XoSr['id']
|
||||
healthCheckVmsWithTags?: string[]
|
||||
fullInterval?: number
|
||||
copyRetention?: number
|
||||
snapshotRetention?: number
|
||||
cbtDestroySnapshotData?: boolean
|
||||
[key: string]: unknown
|
||||
}
|
||||
'': XoVmBackupJobGeneralSettings
|
||||
[key: XoSchedule['id']]: XoVmBackupJobScheduleSettings | undefined
|
||||
}
|
||||
}
|
||||
|
||||
export type XoMetadataBackupJobGeneralSettings = XoBackupJobGeneralSettings
|
||||
export type XoMetadataBackupJobScheduleSettings = {
|
||||
retentionPoolMetadata?: number
|
||||
retentionXoMetadata?: number
|
||||
[key: string]: unknown
|
||||
}
|
||||
export type XoMetadataBackupJob = BaseXoJob & {
|
||||
type: 'metadataBackup'
|
||||
pools?: CMType.IdOr<XoPool['id']>
|
||||
remotes: CMType.IdOr<XoBackupRepository['id']>
|
||||
settings: {
|
||||
''?: XoMetadataBackupJobGeneralSettings
|
||||
[scheduleId: XoSchedule['id']]: XoMetadataBackupJobScheduleSettings | undefined
|
||||
}
|
||||
xoMetadata?: boolean
|
||||
userId: XoUser['id']
|
||||
proxy?: XoProxy['id']
|
||||
}
|
||||
|
||||
export type XoMirrorBackupGeneralSettings = XoBackupJobGeneralSettings & {
|
||||
concurrency?: number
|
||||
nRetriesVmBackupFailures?: number
|
||||
timeout?: number
|
||||
maxExportRate?: number
|
||||
backupReportTpl?: 'compactMjml'
|
||||
reportWhen: 'failure'
|
||||
[key: string]: unknown
|
||||
}
|
||||
export type XoMirrorBackupScheduleSettings = {
|
||||
exportRetention?: number
|
||||
healthCheckVmsWithTags?: XoVm['tags']
|
||||
healthCheckSr?: XoSr['id']
|
||||
[key: string]: unknown
|
||||
}
|
||||
export type XoMirrorBackupJob = BaseXoJob & {
|
||||
type: 'mirrorBackup'
|
||||
mode: 'full' | 'delta'
|
||||
sourceRemote: XoBackupRepository['id']
|
||||
remotes: CMType.IdOr<XoBackupRepository['id']>
|
||||
settings: {
|
||||
'': XoMirrorBackupGeneralSettings
|
||||
[scheduleId: XoSchedule['id']]: XoMirrorBackupScheduleSettings | undefined
|
||||
}
|
||||
}
|
||||
|
||||
export type XoJob = BaseXoJob & {}
|
||||
|
||||
export type XoSchedule = {
|
||||
cron: string
|
||||
enabled: boolean
|
||||
id: Branded<'schedule'>
|
||||
jobId: (XoJob | XoBackupJob)['id']
|
||||
jobId: AnyXoJob['id']
|
||||
name?: string
|
||||
timezone?: string
|
||||
}
|
||||
@@ -489,6 +560,28 @@ export type XoSm = BaseXapiXo & {
|
||||
type: 'SM'
|
||||
}
|
||||
|
||||
export type XoTask = {
|
||||
abortionRequestedAt?: number
|
||||
end?: number
|
||||
id: Branded<'task'>
|
||||
infos?: { data: unknown; message: string }[]
|
||||
properties: {
|
||||
method?: string
|
||||
name?: string
|
||||
objectId?: string
|
||||
params?: Record<string, unknown>
|
||||
type?: string
|
||||
userId?: string
|
||||
[key: string]: unknown | undefined
|
||||
}
|
||||
result: Record<string, unknown>
|
||||
start: number
|
||||
status: 'failure' | 'interrupted' | 'pending' | 'success'
|
||||
tasks?: XoTask[]
|
||||
updatedAt?: number
|
||||
warnings?: { data: unknown; message: string }[]
|
||||
}
|
||||
|
||||
export type XoUser = {
|
||||
authProviders?: Record<string, string>
|
||||
email: string
|
||||
@@ -500,6 +593,19 @@ export type XoUser = {
|
||||
preferences: Record<string, string>
|
||||
}
|
||||
|
||||
export type XoAuthenticationToken = {
|
||||
client?: {
|
||||
id: string
|
||||
[key: string]: unknown
|
||||
}
|
||||
created_at?: number
|
||||
description?: string
|
||||
user_id: XoUser['id']
|
||||
expiration: number
|
||||
last_uses?: Record<string, { timestamp: number }>
|
||||
id: Branded<'authentication-token'>
|
||||
}
|
||||
|
||||
export type XoVbd = BaseXapiXo & {
|
||||
attached: boolean
|
||||
bootable: boolean
|
||||
@@ -654,7 +760,16 @@ export type XapiXoRecord =
|
||||
| XoVtpm
|
||||
| XoSm
|
||||
|
||||
export type NonXapiXoRecord = XoGroup | XoProxy | XoJob | XoBackupRepository | XoSchedule | XoServer | XoUser
|
||||
export type NonXapiXoRecord =
|
||||
| AnyXoJob
|
||||
| AnyXoLog
|
||||
| XoGroup
|
||||
| XoProxy
|
||||
| XoBackupRepository
|
||||
| XoSchedule
|
||||
| XoServer
|
||||
| XoTask
|
||||
| XoUser
|
||||
|
||||
export type XoRecord = XapiXoRecord | NonXapiXoRecord
|
||||
|
||||
@@ -662,4 +777,8 @@ export type AnyXoVm = XoVm | XoVmSnapshot | XoVmTemplate | XoVmController
|
||||
|
||||
export type AnyXoVdi = XoVdi | XoVdiSnapshot | XoVdiUnmanaged
|
||||
|
||||
export type AnyXoJob = XoJob | XoBackupJob
|
||||
export type AnyXoJob = XoJob | AnyXoBackupJob
|
||||
|
||||
export type AnyXoBackupJob = XoVmBackupJob | XoMetadataBackupJob | XoMirrorBackupJob
|
||||
|
||||
export type AnyXoLog = XoBackupLog | XoRestoreLog
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
"dependencies": {
|
||||
"@vates/async-each": "^1.0.0",
|
||||
"@xen-orchestra/async-map": "^0.1.2",
|
||||
"@xen-orchestra/backups": "^0.63.0",
|
||||
"@xen-orchestra/fs": "^4.6.2",
|
||||
"@xen-orchestra/backups": "^0.64.3",
|
||||
"@xen-orchestra/fs": "^4.6.3",
|
||||
"filenamify": "^6.0.0",
|
||||
"getopts": "^2.2.5",
|
||||
"lodash": "^4.17.15",
|
||||
@@ -28,7 +28,7 @@
|
||||
"scripts": {
|
||||
"postversion": "npm publish --access public"
|
||||
},
|
||||
"version": "1.1.2",
|
||||
"version": "1.1.3",
|
||||
"license": "AGPL-3.0-or-later",
|
||||
"author": {
|
||||
"name": "Vates SAS",
|
||||
|
||||
@@ -94,11 +94,13 @@ export async function exportIncrementalVm(
|
||||
}
|
||||
})
|
||||
|
||||
// Get a fresh list of VM's VTPM to avoid `vm.VTPMs: [undefined]`
|
||||
const vmVtpms = await vm.$xapi.getField('VM', vm.$ref, 'VTPMs')
|
||||
const vtpms = await Promise.all(
|
||||
vm.$VTPMs.map(async vtpm => {
|
||||
vmVtpms.map(async vtpmRef => {
|
||||
let content
|
||||
try {
|
||||
content = await vm.$xapi.call('VTPM.get_contents', vtpm.$ref)
|
||||
content = await vm.$xapi.call('VTPM.get_contents', vtpmRef)
|
||||
} catch (err) {
|
||||
console.error(err)
|
||||
}
|
||||
|
||||
@@ -37,5 +37,6 @@ export const FullRemote = class FullRemoteVmBackupRunner extends AbstractRemote
|
||||
// for healthcheck
|
||||
this._tags = metadata.vm.tags
|
||||
}
|
||||
this._hasTransferredData = transferList.length > 0
|
||||
}
|
||||
}
|
||||
|
||||
@@ -115,6 +115,7 @@ class IncrementalRemoteVmBackupRunner extends AbstractRemote {
|
||||
// for healthcheck
|
||||
this._tags = metadata.vm.tags
|
||||
}
|
||||
this._hasTransferredData = transferList.length > 0
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -45,6 +45,9 @@ export const IncrementalXapi = class IncrementalXapiVmBackupRunner extends Abstr
|
||||
for (const key in deltaExport.disks) {
|
||||
const disk = deltaExport.disks[key]
|
||||
isVhdDifferencing[key] = disk.isDifferencing()
|
||||
if (!isFull && !isVhdDifferencing[key] && key !== exportedVm.$suspend_VDI?.$ref) {
|
||||
Task.warning('Backup fell back to a full')
|
||||
}
|
||||
deltaExport.disks[key] = new SynchronizedDisk(disk)
|
||||
useNbd = useNbd || disk.useNbd()
|
||||
}
|
||||
|
||||
@@ -13,6 +13,8 @@ import { Task } from '../../Task.mjs'
|
||||
|
||||
export const AbstractRemote = class AbstractRemoteVmBackupRunner extends Abstract {
|
||||
_filterPredicate
|
||||
_hasTransferredData
|
||||
|
||||
constructor({
|
||||
config,
|
||||
job,
|
||||
@@ -141,7 +143,16 @@ export const AbstractRemote = class AbstractRemoteVmBackupRunner extends Abstrac
|
||||
})
|
||||
}, 'writer.beforeBackup()')
|
||||
await this._run()
|
||||
await this._healthCheck()
|
||||
|
||||
if (this._hasTransferredData === undefined) {
|
||||
throw new Error('Missing tag to check there are some transferred data')
|
||||
}
|
||||
|
||||
if (this._hasTransferredData) {
|
||||
await this._healthCheck()
|
||||
} else {
|
||||
Task.info(`No healthCheck needed because no data was transferred.`)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,7 +25,11 @@ export class IncrementalXapiWriter extends MixinXapiWriter(AbstractIncrementalWr
|
||||
const replicatedVdis = sr.$VDIs
|
||||
.filter(vdi => {
|
||||
// REPLICATED_TO_SR_UUID is not used here since we are already filtering from sr.$VDIs
|
||||
return baseUuidToSrcVdi.has(vdi?.other_config[COPY_OF])
|
||||
return (
|
||||
vdi?.managed &&
|
||||
!vdi?.is_a_snapshot /* only look for real vdi */ &&
|
||||
baseUuidToSrcVdi.has(vdi?.other_config[COPY_OF])
|
||||
)
|
||||
})
|
||||
.map(({ other_config }) => other_config?.[COPY_OF])
|
||||
.filter(_ => !!_)
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
"type": "git",
|
||||
"url": "https://github.com/vatesfr/xen-orchestra.git"
|
||||
},
|
||||
"version": "0.63.0",
|
||||
"version": "0.64.3",
|
||||
"engines": {
|
||||
"node": ">=14.18"
|
||||
},
|
||||
@@ -26,11 +26,11 @@
|
||||
"@vates/disposable": "^0.1.6",
|
||||
"@vates/fuse-vhd": "^2.1.2",
|
||||
"@vates/generator-toolbox": "^1.0.4",
|
||||
"@vates/nbd-client": "^3.1.4",
|
||||
"@vates/nbd-client": "^3.2.1",
|
||||
"@vates/parse-duration": "^0.1.1",
|
||||
"@xen-orchestra/async-map": "^0.1.2",
|
||||
"@xen-orchestra/disk-transform": "^1.1.0",
|
||||
"@xen-orchestra/fs": "^4.6.2",
|
||||
"@xen-orchestra/fs": "^4.6.3",
|
||||
"@xen-orchestra/log": "^0.7.1",
|
||||
"@xen-orchestra/qcow2": "^1.0.0",
|
||||
"@xen-orchestra/template": "^0.1.0",
|
||||
@@ -51,8 +51,8 @@
|
||||
"tar": "^6.1.15",
|
||||
"uuid": "^9.0.0",
|
||||
"value-matcher": "^0.2.0",
|
||||
"vhd-lib": "^4.14.0",
|
||||
"xen-api": "^4.7.3",
|
||||
"vhd-lib": "^4.14.1",
|
||||
"xen-api": "^4.7.4",
|
||||
"yazl": "^2.5.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
@@ -62,7 +62,7 @@
|
||||
"tmp": "^0.2.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@xen-orchestra/xapi": "^8.3.3"
|
||||
"@xen-orchestra/xapi": "^8.4.1"
|
||||
},
|
||||
"license": "AGPL-3.0-or-later",
|
||||
"author": {
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
"preferGlobal": true,
|
||||
"dependencies": {
|
||||
"golike-defer": "^0.5.1",
|
||||
"xen-api": "^4.7.3"
|
||||
"xen-api": "^4.7.4"
|
||||
},
|
||||
"scripts": {
|
||||
"postversion": "npm publish"
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
"node": ">=20.17"
|
||||
},
|
||||
"dependencies": {
|
||||
"vhd-lib": "^4.14.0",
|
||||
"vhd-lib": "^4.14.1",
|
||||
"@vates/generator-toolbox": "^1.0.4"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"private": false,
|
||||
"name": "@xen-orchestra/fs",
|
||||
"version": "4.6.2",
|
||||
"version": "4.6.3",
|
||||
"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",
|
||||
@@ -29,7 +29,7 @@
|
||||
"@vates/async-each": "^1.0.0",
|
||||
"@vates/coalesce-calls": "^0.1.0",
|
||||
"@vates/decorate-with": "^2.1.0",
|
||||
"@vates/read-chunk": "^1.2.0",
|
||||
"@vates/read-chunk": "^1.2.1",
|
||||
"@xen-orchestra/log": "^0.7.1",
|
||||
"bind-property-descriptor": "^2.0.0",
|
||||
"decorator-synchronized": "^0.6.0",
|
||||
|
||||
@@ -23,7 +23,7 @@ const computeRate = (hrtime, size) => {
|
||||
return size / seconds
|
||||
}
|
||||
|
||||
const DEFAULT_TIMEOUT = 6e5 // 10 min
|
||||
const DEFAULT_TIMEOUT = 12e5 // 20 min
|
||||
const DEFAULT_MAX_PARALLEL_OPERATIONS = 10
|
||||
|
||||
const ENCRYPTION_DESC_FILENAME = 'encryption.json'
|
||||
|
||||
@@ -10,7 +10,7 @@ import AbstractHandler from './abstract'
|
||||
import fs from 'fs-extra'
|
||||
import tmp from 'tmp'
|
||||
|
||||
const TIMEOUT = 6e5
|
||||
const TIMEOUT = 12e5
|
||||
|
||||
class TestHandler extends AbstractHandler {
|
||||
constructor() {
|
||||
@@ -54,7 +54,7 @@ describe('closeFile()', () => {
|
||||
|
||||
const promise = testHandler.closeFile({ fd: undefined, path: '' })
|
||||
clock.tick(TIMEOUT)
|
||||
await assert.rejects(promise, TimeoutError)
|
||||
await assert.rejects(promise, new TimeoutError())
|
||||
})
|
||||
})
|
||||
|
||||
@@ -64,7 +64,7 @@ describe('getInfo()', () => {
|
||||
|
||||
const promise = testHandler.getInfo()
|
||||
clock.tick(TIMEOUT)
|
||||
await assert.rejects(promise, TimeoutError)
|
||||
await assert.rejects(promise, new TimeoutError())
|
||||
})
|
||||
})
|
||||
|
||||
@@ -74,7 +74,7 @@ describe('getSize()', () => {
|
||||
|
||||
const promise = testHandler.getSize('')
|
||||
clock.tick(TIMEOUT)
|
||||
await assert.rejects(promise, TimeoutError)
|
||||
await assert.rejects(promise, new TimeoutError())
|
||||
})
|
||||
})
|
||||
|
||||
@@ -84,7 +84,7 @@ describe('list()', () => {
|
||||
|
||||
const promise = testHandler.list('.')
|
||||
clock.tick(TIMEOUT)
|
||||
await assert.rejects(promise, TimeoutError)
|
||||
await assert.rejects(promise, new TimeoutError())
|
||||
})
|
||||
})
|
||||
|
||||
@@ -94,7 +94,7 @@ describe('openFile()', () => {
|
||||
|
||||
const promise = testHandler.openFile('path')
|
||||
clock.tick(TIMEOUT)
|
||||
await assert.rejects(promise, TimeoutError)
|
||||
await assert.rejects(promise, new TimeoutError())
|
||||
})
|
||||
})
|
||||
|
||||
@@ -104,7 +104,7 @@ describe('rename()', () => {
|
||||
|
||||
const promise = testHandler.rename('oldPath', 'newPath')
|
||||
clock.tick(TIMEOUT)
|
||||
await assert.rejects(promise, TimeoutError)
|
||||
await assert.rejects(promise, new TimeoutError())
|
||||
})
|
||||
})
|
||||
|
||||
@@ -114,7 +114,7 @@ describe('rmdir()', () => {
|
||||
|
||||
const promise = testHandler.rmdir('dir')
|
||||
clock.tick(TIMEOUT)
|
||||
await assert.rejects(promise, TimeoutError)
|
||||
await assert.rejects(promise, new TimeoutError())
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
@@ -17,19 +17,19 @@
|
||||
"xo-lift-remote-immutability": "./liftProtection.mjs"
|
||||
},
|
||||
"license": "AGPL-3.0-or-later",
|
||||
"version": "1.0.23",
|
||||
"version": "1.0.24",
|
||||
"engines": {
|
||||
"node": ">=14.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@vates/async-each": "^1.0.0",
|
||||
"@xen-orchestra/backups": "^0.63.0",
|
||||
"@xen-orchestra/backups": "^0.64.3",
|
||||
"@xen-orchestra/log": "^0.7.1",
|
||||
"app-conf": "^3.0.0",
|
||||
"chokidar": "^3.6.0",
|
||||
"execa": "^5.0.0",
|
||||
"ms": "^2.1.3",
|
||||
"vhd-lib": "^4.14.0"
|
||||
"vhd-lib": "^4.14.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"rimraf": "^5.0.5",
|
||||
|
||||
@@ -2,8 +2,20 @@
|
||||
|
||||
## **next**
|
||||
|
||||
- [Settings] Add icon for external links on settings page (PR [#8980](https://github.com/vatesfr/xen-orchestra/pull/8980))
|
||||
- [VM/dashboard] Update QuickInfo card in dashboard to show more information (PR [#8952](https://github.com/vatesfr/xen-orchestra/pull/8952))
|
||||
- [StateHero] Update VtsStateHero component and modify usages in every component (PR [#8910](https://github.com/vatesfr/pull/8910))
|
||||
|
||||
## **0.14.1** (2025-09-04)
|
||||
|
||||
- [VM/System] Correctly display enable/disable for secure boot (PR [#8925](https://github.com/vatesfr/xen-orchestra/pull/8925))
|
||||
|
||||
## **0.14.0** (2025-08-28)
|
||||
|
||||
- [Pool,Host,VM/Dashboard] Remember the last visited tab per object type (Pool/Host/VM) when navigating (PR [#8872](https://github.com/vatesfr/xen-orchestra/pull/8872))
|
||||
- Replace native `select` with a new custom component (PR [#8681](https://github.com/vatesfr/xen-orchestra/pull/8681))
|
||||
- Add i18n engage link on the settings page [Issue#8603](https://github.com/vatesfr/xen-orchestra/issues/8603) (PR [#8884](https://github.com/vatesfr/xen-orchestra/pull/8884))
|
||||
- Migrate progress bar usages to Web Core components and remove old Lite components (PR [#8899](https://github.com/vatesfr/xen-orchestra/pull/8899))
|
||||
|
||||
## **0.13.1** (2025-08-06)
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@xen-orchestra/lite",
|
||||
"version": "0.13.1",
|
||||
"version": "0.14.1",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "GIT_HEAD=$(git rev-parse HEAD) vite",
|
||||
@@ -28,14 +28,14 @@
|
||||
"@types/file-saver": "^2.0.7",
|
||||
"@types/lodash-es": "^4.17.12",
|
||||
"@types/node": "^18.19.80",
|
||||
"@vates/types": "^1.10.0",
|
||||
"@vates/types": "^1.12.0",
|
||||
"@vitejs/plugin-vue": "^5.2.1",
|
||||
"@vue/tsconfig": "^0.7.0",
|
||||
"@vueuse/core": "^13.0.0",
|
||||
"@vueuse/math": "^13.0.0",
|
||||
"@vueuse/shared": "^13.0.0",
|
||||
"@xen-orchestra/web-core": "^0.27.0",
|
||||
"complex-matcher": "^0.7.1",
|
||||
"@xen-orchestra/web-core": "^0.31.0",
|
||||
"complex-matcher": "^1.0.0",
|
||||
"d3-time-format": "^4.1.0",
|
||||
"decorator-synchronized": "^0.6.0",
|
||||
"file-saver": "^2.0.5",
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
v-if="!uiStore.isDesktopLarge"
|
||||
ref="navigationTrigger"
|
||||
:class="{ 'menu-to-right': !uiStore.isMobile }"
|
||||
:icon="faBars"
|
||||
accent="brand"
|
||||
icon="fa:bars"
|
||||
size="medium"
|
||||
/>
|
||||
<RouterLink :to="logoRoute" class="logo-container">
|
||||
@@ -32,7 +32,6 @@ import { useNavigationStore } from '@/stores/navigation.store'
|
||||
import { usePoolStore } from '@/stores/xen-api/pool.store.ts'
|
||||
import UiButtonIcon from '@core/components/ui/button-icon/UiButtonIcon.vue'
|
||||
import { useUiStore } from '@core/stores/ui.store'
|
||||
import { faBars } from '@fortawesome/free-solid-svg-icons'
|
||||
import { storeToRefs } from 'pinia'
|
||||
import { computed } from 'vue'
|
||||
import type { RouteLocationRaw } from 'vue-router'
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<img alt="XO Lite" src="../assets/logo-title.svg" />
|
||||
<PoolOverrideWarning />
|
||||
<p v-if="isHostIsSlaveErr(error)" class="error">
|
||||
<UiIcon :icon="faExclamationCircle" />
|
||||
<VtsIcon name="fa:exclamation-circle" size="medium" />
|
||||
{{ t('login-only-on-master') }}
|
||||
<a :href="masterUrl.href">{{ masterUrl.hostname }}</a>
|
||||
</p>
|
||||
@@ -42,14 +42,13 @@
|
||||
import FormInput from '@/components/form/FormInput.vue'
|
||||
import LoginError from '@/components/LoginError.vue'
|
||||
import PoolOverrideWarning from '@/components/PoolOverrideWarning.vue'
|
||||
import UiIcon from '@/components/ui/icon/UiIcon.vue'
|
||||
import type { XenApiError } from '@/libs/xen-api/xen-api.types'
|
||||
import { usePageTitleStore } from '@/stores/page-title.store'
|
||||
import { useXenApiStore } from '@/stores/xen-api.store'
|
||||
import VtsIcon from '@core/components/icon/VtsIcon.vue'
|
||||
import VtsInputWrapper from '@core/components/input-wrapper/VtsInputWrapper.vue'
|
||||
import UiButton from '@core/components/ui/button/UiButton.vue'
|
||||
import UiCheckbox from '@core/components/ui/checkbox/UiCheckbox.vue'
|
||||
import { faExclamationCircle } from '@fortawesome/free-solid-svg-icons'
|
||||
import { useLocalStorage, whenever } from '@vueuse/core'
|
||||
import { storeToRefs } from 'pinia'
|
||||
import { onMounted, ref, watch } from 'vue'
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
{{ filter }}
|
||||
</UiFilter>
|
||||
|
||||
<UiActionButton :icon="faPlus" class="add-filter" @click="openModal()">
|
||||
<UiActionButton icon="fa:plus" class="add-filter" @click="openModal()">
|
||||
{{ t('add-filter') }}
|
||||
</UiActionButton>
|
||||
</UiFilterGroup>
|
||||
@@ -21,7 +21,6 @@ import UiFilter from '@/components/ui/UiFilter.vue'
|
||||
import UiFilterGroup from '@/components/ui/UiFilterGroup.vue'
|
||||
import { useModal } from '@/composables/modal.composable'
|
||||
import type { Filters } from '@/types/filter'
|
||||
import { faPlus } from '@fortawesome/free-solid-svg-icons'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
|
||||
const props = defineProps<{
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
<VtsSelect v-if="currentFilter?.type === 'enum'" :id="builderValueSelectId" accent="brand" />
|
||||
<UiInput v-else-if="hasValueInput" v-model="newFilter.builder.value" accent="brand" />
|
||||
</template>
|
||||
<UiActionButton v-if="!newFilter.isAdvanced" :icon="faPencil" @click="enableAdvancedMode" />
|
||||
<UiActionButton :icon="faRemove" @click="emit('remove', newFilter.id)" />
|
||||
<UiActionButton v-if="!newFilter.isAdvanced" icon="fa:pencil" @click="enableAdvancedMode" />
|
||||
<UiActionButton icon="fa:remove" @click="emit('remove', newFilter.id)" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -21,7 +21,6 @@ import type { Filter, FilterComparisons, FilterComparisonType, Filters, FilterTy
|
||||
import VtsSelect from '@core/components/select/VtsSelect.vue'
|
||||
import UiInput from '@core/components/ui/input/UiInput.vue'
|
||||
import { useFormSelect } from '@core/packages/form-select'
|
||||
import { faPencil, faRemove } from '@fortawesome/free-solid-svg-icons'
|
||||
import { computed, watch } from 'vue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
|
||||
|
||||
@@ -7,25 +7,24 @@
|
||||
@remove="emit('removeSort', property)"
|
||||
>
|
||||
<span class="property">
|
||||
<UiIcon :icon="isAscending ? faCaretUp : faCaretDown" />
|
||||
<VtsIcon :name="isAscending ? 'fa:caret-up' : 'fa:caret-down'" size="medium" />
|
||||
{{ property }}
|
||||
</span>
|
||||
</UiFilter>
|
||||
|
||||
<UiActionButton :icon="faPlus" class="add-sort" @click="openModal()">
|
||||
<UiActionButton icon="fa:plus" class="add-sort" @click="openModal()">
|
||||
{{ t('add-sort') }}
|
||||
</UiActionButton>
|
||||
</UiFilterGroup>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import UiIcon from '@/components/ui/icon/UiIcon.vue'
|
||||
import UiActionButton from '@/components/ui/UiActionButton.vue'
|
||||
import UiFilter from '@/components/ui/UiFilter.vue'
|
||||
import UiFilterGroup from '@/components/ui/UiFilterGroup.vue'
|
||||
import { useModal } from '@/composables/modal.composable'
|
||||
import type { ActiveSorts, NewSort, Sorts } from '@/types/sort'
|
||||
import { faCaretDown, faCaretUp, faPlus } from '@fortawesome/free-solid-svg-icons'
|
||||
import VtsIcon from '@core/components/icon/VtsIcon.vue'
|
||||
import { computed } from 'vue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<th>
|
||||
<div class="content">
|
||||
<span class="label">
|
||||
<UiIcon :icon />
|
||||
<VtsIcon :name="icon" size="medium" />
|
||||
<slot />
|
||||
</span>
|
||||
</div>
|
||||
@@ -10,11 +10,11 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import UiIcon from '@/components/ui/icon/UiIcon.vue'
|
||||
import type { IconDefinition } from '@fortawesome/fontawesome-common-types'
|
||||
import type { IconName } from '@core/icons'
|
||||
import VtsIcon from '@core/components/icon/VtsIcon.vue'
|
||||
|
||||
defineProps<{
|
||||
icon?: IconDefinition
|
||||
icon?: IconName
|
||||
}>()
|
||||
</script>
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div v-if="error !== undefined" class="error typo-body-regular-small">
|
||||
<UiIcon :icon="faExclamationCircle" />
|
||||
<VtsIcon name="fa:exclamation-circle" size="medium" />
|
||||
<span v-if="error.message === 'SESSION_AUTHENTICATION_FAILED'">
|
||||
{{ t('password-invalid') }}
|
||||
</span>
|
||||
@@ -11,9 +11,8 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import UiIcon from '@/components/ui/icon/UiIcon.vue'
|
||||
import type { XenApiError } from '@/libs/xen-api/xen-api.types'
|
||||
import { faExclamationCircle } from '@fortawesome/free-solid-svg-icons'
|
||||
import VtsIcon from '@core/components/icon/VtsIcon.vue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
|
||||
defineProps<{
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
<template>
|
||||
<UiStatusPanel
|
||||
:image-source="underConstruction"
|
||||
:subtitle="t('new-features-are-coming')"
|
||||
:title="t('xo-lite-under-construction')"
|
||||
>
|
||||
<VtsStateHero format="page" type="under-construction" size="large">
|
||||
<span>{{ t('xo-lite-under-construction') }}</span>
|
||||
<span class="typo-h3">{{ t('new-features-are-coming') }}</span>
|
||||
<p class="contact typo-body-regular">
|
||||
{{ t('do-you-have-needs') }}
|
||||
<a
|
||||
@@ -14,12 +12,11 @@
|
||||
{{ `${t('here')} →` }}
|
||||
</a>
|
||||
</p>
|
||||
</UiStatusPanel>
|
||||
</VtsStateHero>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import underConstruction from '@/assets/under-construction.svg'
|
||||
import UiStatusPanel from '@/components/ui/UiStatusPanel.vue'
|
||||
import VtsStateHero from '@core/components/state-hero/VtsStateHero.vue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
|
||||
const { t } = useI18n()
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
@click="xenApi.resetPoolMasterIp"
|
||||
>
|
||||
<div class="wrapper">
|
||||
<UiIcon :icon="faWarning" />
|
||||
<VtsIcon name="fa:triangle-exclamation" size="medium" />
|
||||
<p v-if="!asTooltip">
|
||||
<I18nT keypath="you-are-currently-on">
|
||||
<strong>{{ masterSessionStorage }}</strong>
|
||||
@@ -27,10 +27,9 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import UiIcon from '@/components/ui/icon/UiIcon.vue'
|
||||
import { useXenApiStore } from '@/stores/xen-api.store'
|
||||
import VtsIcon from '@core/components/icon/VtsIcon.vue'
|
||||
import { vTooltip } from '@core/directives/tooltip.directive'
|
||||
import { faWarning } from '@fortawesome/free-solid-svg-icons'
|
||||
import { useSessionStorage } from '@vueuse/core'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
|
||||
|
||||
@@ -1,47 +1,23 @@
|
||||
<template>
|
||||
<UiIcon :class="className" :icon class="power-state-icon" />
|
||||
<VtsIcon :name="icon" size="medium" class="power-state-icon" />
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import UiIcon from '@/components/ui/icon/UiIcon.vue'
|
||||
import { VM_POWER_STATE } from '@/libs/xen-api/xen-api.enums'
|
||||
import { faMoon, faPause, faPlay, faQuestion, faStop } from '@fortawesome/free-solid-svg-icons'
|
||||
import type { IconName } from '@core/icons'
|
||||
import VtsIcon from '@core/components/icon/VtsIcon.vue'
|
||||
import { computed } from 'vue'
|
||||
|
||||
const props = defineProps<{
|
||||
state: VM_POWER_STATE
|
||||
}>()
|
||||
|
||||
const icons = {
|
||||
[VM_POWER_STATE.RUNNING]: faPlay,
|
||||
[VM_POWER_STATE.PAUSED]: faPause,
|
||||
[VM_POWER_STATE.SUSPENDED]: faMoon,
|
||||
[VM_POWER_STATE.HALTED]: faStop,
|
||||
const icons: Record<VM_POWER_STATE, IconName> = {
|
||||
[VM_POWER_STATE.RUNNING]: 'legacy:running',
|
||||
[VM_POWER_STATE.PAUSED]: 'legacy:paused',
|
||||
[VM_POWER_STATE.SUSPENDED]: 'legacy:suspended',
|
||||
[VM_POWER_STATE.HALTED]: 'legacy:halted',
|
||||
}
|
||||
|
||||
const icon = computed(() => icons[props.state] ?? faQuestion)
|
||||
|
||||
const className = computed(() => `state-${props.state.toLocaleLowerCase()}`)
|
||||
const icon = computed(() => icons[props.state])
|
||||
</script>
|
||||
|
||||
<style lang="postcss" scoped>
|
||||
.power-state-icon {
|
||||
color: var(--color-brand-txt-item);
|
||||
|
||||
&.state-running {
|
||||
color: var(--color-success-item-base);
|
||||
}
|
||||
|
||||
&.state-paused {
|
||||
color: var(--color-neutral-txt-secondary);
|
||||
}
|
||||
|
||||
&.state-suspended {
|
||||
color: var(--color-brand-txt-hover);
|
||||
}
|
||||
|
||||
&.state-halted {
|
||||
color: var(--color-danger-item-base);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div class="title-bar">
|
||||
<UiIcon :icon class="icon" />
|
||||
<VtsIcon :name="icon" class="icon" size="medium" />
|
||||
<div class="title typo-h4">
|
||||
<slot />
|
||||
</div>
|
||||
@@ -11,11 +11,11 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import UiIcon from '@/components/ui/icon/UiIcon.vue'
|
||||
import type { IconDefinition } from '@fortawesome/fontawesome-common-types'
|
||||
import type { IconName } from '@core/icons'
|
||||
import VtsIcon from '@core/components/icon/VtsIcon.vue'
|
||||
|
||||
defineProps<{
|
||||
icon: IconDefinition
|
||||
icon: IconName
|
||||
}>()
|
||||
</script>
|
||||
|
||||
|
||||
@@ -1,90 +0,0 @@
|
||||
<template>
|
||||
<div class="usage-bar">
|
||||
<div
|
||||
v-for="item in computedData.sortedArray"
|
||||
:key="item.id"
|
||||
:class="{
|
||||
warning: item.value > MIN_WARNING_VALUE,
|
||||
error: item.value > MIN_DANGEROUS_VALUE,
|
||||
}"
|
||||
class="progress-item"
|
||||
>
|
||||
<UiProgressBar :value="item.value" color="custom" />
|
||||
<UiProgressLegend :label="item.label" :value="item.badgeLabel ?? n(item.value / 100, 'percent')" />
|
||||
</div>
|
||||
<slot :total-percent="computedData.totalPercentUsage" name="footer" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import UiProgressBar from '@/components/ui/progress/UiProgressBar.vue'
|
||||
import UiProgressLegend from '@/components/ui/progress/UiProgressLegend.vue'
|
||||
import type { StatData } from '@/types/stat'
|
||||
import { computed } from 'vue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
|
||||
interface Props {
|
||||
data: StatData[]
|
||||
nItems?: number
|
||||
}
|
||||
|
||||
const props = defineProps<Props>()
|
||||
|
||||
const { n } = useI18n()
|
||||
|
||||
const MIN_WARNING_VALUE = 80
|
||||
const MIN_DANGEROUS_VALUE = 90
|
||||
|
||||
const computedData = computed(() => {
|
||||
const _data = props.data
|
||||
let totalPercentUsage = 0
|
||||
return {
|
||||
sortedArray: _data
|
||||
?.map(item => {
|
||||
const value = Math.round((item.value / (item.maxValue ?? 100)) * 100)
|
||||
totalPercentUsage += value
|
||||
return {
|
||||
...item,
|
||||
value,
|
||||
}
|
||||
})
|
||||
.sort((item, nextItem) => nextItem.value - item.value)
|
||||
.slice(0, props.nItems ?? _data.length),
|
||||
totalPercentUsage,
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="postcss" scoped>
|
||||
.usage-bar {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 1rem;
|
||||
}
|
||||
|
||||
.progress-item:nth-child(1) {
|
||||
--progress-bar-color: var(--color-brand-txt-item);
|
||||
}
|
||||
|
||||
.progress-item:nth-child(2) {
|
||||
--progress-bar-color: var(--color-brand-txt-active);
|
||||
}
|
||||
|
||||
.progress-item:nth-child(3) {
|
||||
--progress-bar-color: var(--color-brand-txt-hover);
|
||||
}
|
||||
|
||||
.progress-item {
|
||||
--progress-bar-height: 1.2rem;
|
||||
--progress-bar-color: var(--color-brand-item-hover);
|
||||
--progress-bar-background-color: var(--color-neutral-background-disabled);
|
||||
|
||||
&.warning {
|
||||
--progress-bar-color: var(--color-warning-item-base);
|
||||
}
|
||||
|
||||
&.error {
|
||||
--progress-bar-color: var(--color-danger-item-base);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -4,7 +4,7 @@
|
||||
size="medium"
|
||||
accent="brand"
|
||||
variant="primary"
|
||||
:left-icon="faArrowUpRightFromSquare"
|
||||
left-icon="fa:arrow-up-right-from-square"
|
||||
class="xoa-button"
|
||||
@click="openXoa()"
|
||||
>
|
||||
@@ -15,7 +15,7 @@
|
||||
size="medium"
|
||||
accent="brand"
|
||||
variant="primary"
|
||||
:left-icon="faDownload"
|
||||
left-icon="fa:download"
|
||||
class="xoa-button"
|
||||
@click="openXoaDeploy()"
|
||||
>
|
||||
@@ -27,7 +27,6 @@
|
||||
import type { PRIMARY_ADDRESS_TYPE } from '@/libs/xen-api/xen-api.enums'
|
||||
import { usePoolStore } from '@/stores/xen-api/pool.store'
|
||||
import UiButton from '@core/components/ui/button/UiButton.vue'
|
||||
import { faDownload, faArrowUpRightFromSquare } from '@fortawesome/free-solid-svg-icons'
|
||||
import { computed } from 'vue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import { useRouter } from 'vue-router'
|
||||
|
||||
@@ -8,23 +8,23 @@
|
||||
@click="open($event)"
|
||||
/>
|
||||
</template>
|
||||
<MenuItem :icon="faGear" @click="openSettings">{{ t('settings') }}</MenuItem>
|
||||
<MenuItem :icon="faBook" @click="openUrl('https://docs.xcp-ng.org?utm_campaign=xolite&utm_term=xcpdoc')">
|
||||
<MenuItem icon="fa:gear" @click="openSettings">{{ t('settings') }}</MenuItem>
|
||||
<MenuItem icon="fa:book" @click="openUrl('https://docs.xcp-ng.org?utm_campaign=xolite&utm_term=xcpdoc')">
|
||||
{{ t('documentation-name', { name: 'XCP-ng' }) }}
|
||||
</MenuItem>
|
||||
<MenuItem
|
||||
:icon="faHeadset"
|
||||
icon="fa:headset"
|
||||
@click="openUrl('https://vates.tech/pricing-and-support?utm_campaign=xolite&utm_term=pricing')"
|
||||
>
|
||||
{{ t('professional-support') }}
|
||||
</MenuItem>
|
||||
<MenuItem
|
||||
:icon="faComments"
|
||||
icon="fa:comments"
|
||||
@click="openUrl('https://xcp-ng.org/forum/topic/4731/xen-orchestra-lite?utm_campaign=xolite&utm_term=forum')"
|
||||
>
|
||||
{{ t('access-forum') }}
|
||||
</MenuItem>
|
||||
<MenuItem :icon="faArrowRightFromBracket" class="menu-item-logout" @click="logout">
|
||||
<MenuItem icon="fa:arrow-right-from-bracket" class="menu-item-logout" @click="logout">
|
||||
{{ t('log-out') }}
|
||||
</MenuItem>
|
||||
</MenuList>
|
||||
@@ -36,7 +36,6 @@ import MenuItem from '@core/components/menu/MenuItem.vue'
|
||||
import MenuList from '@core/components/menu/MenuList.vue'
|
||||
import UiAccountMenuButton from '@core/components/ui/account-menu-button/UiAccountMenuButton.vue'
|
||||
import { vTooltip } from '@core/directives/tooltip.directive'
|
||||
import { faArrowRightFromBracket, faBook, faComments, faGear, faHeadset } from '@fortawesome/free-solid-svg-icons'
|
||||
import { nextTick } from 'vue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import { useRouter } from 'vue-router'
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
<MenuList placement="bottom">
|
||||
<template #trigger="{ open, isOpen }">
|
||||
<TabItem :active="isOpen" :disabled="presets === undefined" class="preset-tab" @click="open">
|
||||
<UiIcon :icon="faSliders" />
|
||||
<VtsIcon name="fa:sliders" size="medium" />
|
||||
Presets
|
||||
</TabItem>
|
||||
</template>
|
||||
@@ -79,7 +79,6 @@ import StoryEventParams from '@/components/component-story/StoryEventParams.vue'
|
||||
import StoryPropParams from '@/components/component-story/StoryPropParams.vue'
|
||||
import StorySettingParams from '@/components/component-story/StorySettingParams.vue'
|
||||
import StorySlotParams from '@/components/component-story/StorySlotParams.vue'
|
||||
import UiIcon from '@/components/ui/icon/UiIcon.vue'
|
||||
import UiCard from '@/components/ui/UiCard.vue'
|
||||
import UiCardTitle from '@/components/ui/UiCardTitle.vue'
|
||||
import {
|
||||
@@ -91,13 +90,13 @@ import {
|
||||
ModelParam,
|
||||
type Param,
|
||||
} from '@/libs/story/story-param'
|
||||
import VtsIcon from '@core/components/icon/VtsIcon.vue'
|
||||
import MenuItem from '@core/components/menu/MenuItem.vue'
|
||||
import MenuList from '@core/components/menu/MenuList.vue'
|
||||
import TabItem from '@core/components/tab/TabItem.vue'
|
||||
import TabList from '@core/components/tab/TabList.vue'
|
||||
import UiButton from '@core/components/ui/button/UiButton.vue'
|
||||
import UiCounter from '@core/components/ui/counter/UiCounter.vue'
|
||||
import { faSliders } from '@fortawesome/free-solid-svg-icons'
|
||||
import 'highlight.js/styles/github-dark.css'
|
||||
import { uniqueId, upperFirst } from 'lodash-es'
|
||||
import { computed, onBeforeMount, reactive, ref, watch, watchEffect } from 'vue'
|
||||
|
||||
@@ -6,11 +6,11 @@
|
||||
class="directory typo-body-bold"
|
||||
@click="emit('toggleDirectory', node.directory)"
|
||||
>
|
||||
<UiIcon :icon="isOpen(node.directory) ? faFolderOpen : faFolderClosed" />
|
||||
<VtsIcon :name="isOpen(node.directory) ? 'fa:folder-open' : 'fa:folder-closed'" size="medium" />
|
||||
{{ formatName(key) }}
|
||||
</span>
|
||||
<RouterLink v-else :to="node.path" class="link typo-body-regular">
|
||||
<UiIcon :icon="faFile" />
|
||||
<VtsIcon name="fa:file" size="medium" />
|
||||
{{ formatName(key) }}
|
||||
</RouterLink>
|
||||
|
||||
@@ -26,8 +26,7 @@
|
||||
|
||||
<script lang="ts" setup>
|
||||
import type { StoryTree } from '@/components/component-story/StoryMenu.vue'
|
||||
import UiIcon from '@/components/ui/icon/UiIcon.vue'
|
||||
import { faFile, faFolderClosed, faFolderOpen } from '@fortawesome/free-regular-svg-icons'
|
||||
import VtsIcon from '@core/components/icon/VtsIcon.vue'
|
||||
|
||||
const props = defineProps<{
|
||||
tree: StoryTree
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
v-tooltip="`[Model] Can be used with ${param.getVModelDirective()}`"
|
||||
class="v-model-indicator"
|
||||
>
|
||||
<UiIcon :icon="faRepeat" />
|
||||
<VtsIcon name="fa:repeat" size="medium" />
|
||||
</sup>
|
||||
<sup
|
||||
v-if="param.isUsingContext()"
|
||||
@@ -42,10 +42,11 @@
|
||||
<CodeHighlight :code="param.getTypeLabel()" />
|
||||
</td>
|
||||
<td class="reset-param">
|
||||
<UiIcon
|
||||
<VtsIcon
|
||||
v-if="param.hasWidget() && !param.isRequired() && model[param.name] !== undefined"
|
||||
:icon="faClose"
|
||||
class="reset-icon"
|
||||
name="fa:close"
|
||||
size="medium"
|
||||
@click="model[param.name] = undefined"
|
||||
/>
|
||||
</td>
|
||||
@@ -82,12 +83,11 @@
|
||||
import CodeHighlight from '@/components/CodeHighlight.vue'
|
||||
import StoryParamsTable from '@/components/component-story/StoryParamsTable.vue'
|
||||
import StoryWidget from '@/components/component-story/StoryWidget.vue'
|
||||
import UiIcon from '@/components/ui/icon/UiIcon.vue'
|
||||
import { useModal } from '@/composables/modal.composable'
|
||||
import useSortedCollection from '@/composables/sorted-collection.composable'
|
||||
import type { PropParam } from '@/libs/story/story-param'
|
||||
import VtsIcon from '@core/components/icon/VtsIcon.vue'
|
||||
import { vTooltip } from '@core/directives/tooltip.directive'
|
||||
import { faClose, faRepeat } from '@fortawesome/free-solid-svg-icons'
|
||||
import { useVModel } from '@vueuse/core'
|
||||
import { toRef } from 'vue'
|
||||
|
||||
|
||||
@@ -11,24 +11,22 @@
|
||||
v-bind="attrs"
|
||||
/>
|
||||
<span v-if="before !== undefined" class="before">
|
||||
<template v-if="typeof before === 'string'">{{ before }}</template>
|
||||
<UiIcon v-else :icon="before" class="before" />
|
||||
<VtsIcon :name="before" class="before" size="medium" />
|
||||
</span>
|
||||
<span v-if="after !== undefined" class="after">
|
||||
<template v-if="typeof after === 'string'">{{ after }}</template>
|
||||
<UiIcon v-else :icon="after" class="after" />
|
||||
<VtsIcon :name="after" class="after" size="medium" />
|
||||
</span>
|
||||
</span>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import UiIcon from '@/components/ui/icon/UiIcon.vue'
|
||||
import { useContext } from '@/composables/context.composable'
|
||||
import { ColorContext } from '@/context'
|
||||
import type { Color } from '@/types'
|
||||
import { IK_INPUT_ID, IK_INPUT_TYPE } from '@/types/injection-keys'
|
||||
import type { IconName } from '@core/icons'
|
||||
import VtsIcon from '@core/components/icon/VtsIcon.vue'
|
||||
import { useDisabled } from '@core/composables/disabled.composable'
|
||||
import type { IconDefinition } from '@fortawesome/fontawesome-common-types'
|
||||
import { useVModel } from '@vueuse/core'
|
||||
import { computed, type HTMLAttributes, inject, ref, useAttrs } from 'vue'
|
||||
|
||||
@@ -38,8 +36,8 @@ const props = defineProps<{
|
||||
id?: string
|
||||
modelValue?: any
|
||||
color?: Color
|
||||
before?: IconDefinition | string
|
||||
after?: IconDefinition | string
|
||||
before?: IconName
|
||||
after?: IconName
|
||||
beforeWidth?: string
|
||||
afterWidth?: string
|
||||
disabled?: boolean
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
<template>
|
||||
<FormInput :before="faCode" :model-value="jsonValue" readonly @click="openModal()" />
|
||||
<FormInput before="fa:code" :model-value="jsonValue" readonly @click="openModal()" />
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import FormInput from '@/components/form/FormInput.vue'
|
||||
import { useModal } from '@/composables/modal.composable'
|
||||
import { faCode } from '@fortawesome/free-solid-svg-icons'
|
||||
import { useVModel } from '@vueuse/core'
|
||||
import { computed } from 'vue'
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<fieldset class="fieldset">
|
||||
<legend class="legend typo-h4" @click="toggleCollapse">
|
||||
{{ label }}
|
||||
<UiIcon :icon class="collapse-icon" />
|
||||
<VtsIcon :name="icon" class="collapse-icon" size="medium" />
|
||||
</legend>
|
||||
<div v-if="!isCollapsed" class="content">
|
||||
<slot />
|
||||
@@ -13,8 +13,7 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import UiIcon from '@/components/ui/icon/UiIcon.vue'
|
||||
import { faChevronDown, faChevronUp } from '@fortawesome/free-solid-svg-icons'
|
||||
import VtsIcon from '@core/components/icon/VtsIcon.vue'
|
||||
import { useVModel, whenever } from '@vueuse/core'
|
||||
import { computed } from 'vue'
|
||||
|
||||
@@ -41,7 +40,7 @@ const icon = computed(() => {
|
||||
return undefined
|
||||
}
|
||||
|
||||
return isCollapsed.value ? faChevronDown : faChevronUp
|
||||
return isCollapsed.value ? 'fa:chevron-down' : 'fa:chevron-up'
|
||||
})
|
||||
|
||||
whenever(
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
<template>
|
||||
<UiHeadBar>
|
||||
<template #icon>
|
||||
<UiObjectIcon size="medium" type="host" :state="powerState as HostState" />
|
||||
<VtsObjectIcon size="medium" type="host" :state="powerState" />
|
||||
</template>
|
||||
{{ host.name_label }}
|
||||
<template v-if="isMaster" #status>
|
||||
<VtsIcon v-tooltip="t('master')" accent="info" :icon="faCircle" :overlay-icon="faStar" />
|
||||
<VtsIcon v-tooltip="t('master')" name="legacy:primary" size="medium" />
|
||||
</template>
|
||||
</UiHeadBar>
|
||||
</template>
|
||||
@@ -14,12 +14,10 @@
|
||||
import type { XenApiHost } from '@/libs/xen-api/xen-api.types'
|
||||
import { useHostMetricsStore } from '@/stores/xen-api/host-metrics.store'
|
||||
import { usePoolStore } from '@/stores/xen-api/pool.store'
|
||||
import type { HostState } from '@core/types/object-icon.type'
|
||||
import VtsIcon from '@core/components/icon/VtsIcon.vue'
|
||||
import VtsObjectIcon from '@core/components/object-icon/VtsObjectIcon.vue'
|
||||
import UiHeadBar from '@core/components/ui/head-bar/UiHeadBar.vue'
|
||||
import UiObjectIcon from '@core/components/ui/object-icon/UiObjectIcon.vue'
|
||||
import { vTooltip } from '@core/directives/tooltip.directive'
|
||||
import { faCircle, faStar } from '@fortawesome/free-solid-svg-icons'
|
||||
import { computed } from 'vue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
|
||||
|
||||
@@ -1,9 +1,15 @@
|
||||
<template>
|
||||
<UiCard class="host-dashboard-cpu-provisioning">
|
||||
<UiCardTitle>{{ t('cpu-provisioning') }}</UiCardTitle>
|
||||
<VtsLoadingHero v-if="!isReady" type="card" />
|
||||
<VtsStateHero v-if="!isReady" format="card" busy size="medium" />
|
||||
<template v-else>
|
||||
<UiProgressBar display-mode="percent" :value="vCpusCount" :max="cpusCount" :legend="t('vcpus')" />
|
||||
<VtsProgressBar
|
||||
:current="vCpusCount"
|
||||
:label="t('vcpus')"
|
||||
:thresholds="cpuProgressThresholds(t('cpu-provisioning-warning'))"
|
||||
:total="cpusCount"
|
||||
legend-type="percent"
|
||||
/>
|
||||
<div class="total">
|
||||
<UiCardNumbers :label="t('vcpus-assigned')" :value="vCpusCount" size="medium" />
|
||||
<UiCardNumbers :label="t('total-cpus')" :value="cpusCount" size="medium" />
|
||||
@@ -18,11 +24,12 @@ import type { XenApiHost } from '@/libs/xen-api/xen-api.types.ts'
|
||||
import { useHostStore } from '@/stores/xen-api/host.store.ts'
|
||||
import { useVmMetricsStore } from '@/stores/xen-api/vm-metrics.store.ts'
|
||||
import { useVmStore } from '@/stores/xen-api/vm.store.ts'
|
||||
import VtsLoadingHero from '@core/components/state-hero/VtsLoadingHero.vue'
|
||||
import VtsProgressBar from '@core/components/progress-bar/VtsProgressBar.vue'
|
||||
import VtsStateHero from '@core/components/state-hero/VtsStateHero.vue'
|
||||
import UiCard from '@core/components/ui/card/UiCard.vue'
|
||||
import UiCardNumbers from '@core/components/ui/card-numbers/UiCardNumbers.vue'
|
||||
import UiCardTitle from '@core/components/ui/card-title/UiCardTitle.vue'
|
||||
import UiProgressBar from '@core/components/ui/progress-bar/UiProgressBar.vue'
|
||||
import { cpuProgressThresholds } from '@core/utils/progress.util.ts'
|
||||
import { and } from '@vueuse/math'
|
||||
import { useArrayReduce } from '@vueuse/shared'
|
||||
import { computed } from 'vue'
|
||||
|
||||
@@ -1,11 +1,16 @@
|
||||
<template>
|
||||
<UiCard>
|
||||
<UiCard :has-error="error">
|
||||
<UiCardTitle>
|
||||
{{ t('cpu-usage') }}
|
||||
<template #description>{{ t('last-week') }}</template>
|
||||
</UiCardTitle>
|
||||
<VtsLoadingHero v-if="loading || data.stats === undefined" type="card" />
|
||||
<VtsErrorNoDataHero v-else-if="error" type="card" />
|
||||
<VtsStateHero v-if="loading || data.stats === undefined" format="card" busy size="medium" />
|
||||
<VtsStateHero v-else-if="error" format="card" type="error" size="medium">
|
||||
{{ t('error-no-data') }}
|
||||
</VtsStateHero>
|
||||
<VtsStateHero v-else-if="cpuUsage.length === 0" format="card" type="no-data" size="medium">
|
||||
{{ t('no-data-to-calculate') }}
|
||||
</VtsStateHero>
|
||||
<VtsLinearChart v-else :data="cpuUsage" :max-value :value-formatter class="chart" />
|
||||
</UiCard>
|
||||
</template>
|
||||
@@ -13,8 +18,7 @@
|
||||
<script lang="ts" setup>
|
||||
import { RRD_STEP_FROM_STRING } from '@/libs/xapi-stats.ts'
|
||||
import type { LinearChartData, ValueFormatter } from '@core/types/chart.ts'
|
||||
import VtsErrorNoDataHero from '@core/components/state-hero/VtsErrorNoDataHero.vue'
|
||||
import VtsLoadingHero from '@core/components/state-hero/VtsLoadingHero.vue'
|
||||
import VtsStateHero from '@core/components/state-hero/VtsStateHero.vue'
|
||||
import UiCard from '@core/components/ui/card/UiCard.vue'
|
||||
import UiCardTitle from '@core/components/ui/card-title/UiCardTitle.vue'
|
||||
import type { XapiHostStatsRaw } from '@vates/types/common'
|
||||
@@ -27,7 +31,7 @@ const { data } = defineProps<{
|
||||
timestampStart: number
|
||||
}
|
||||
loading: boolean
|
||||
error?: string
|
||||
error?: boolean
|
||||
}>()
|
||||
|
||||
const VtsLinearChart = defineAsyncComponent(() => import('@core/components/linear-chart/VtsLinearChart.vue'))
|
||||
|
||||
@@ -1,11 +1,16 @@
|
||||
<template>
|
||||
<UiCard>
|
||||
<UiCard :has-error="error">
|
||||
<UiCardTitle>
|
||||
{{ t('load-average') }}
|
||||
<template #description>{{ t('last-week') }}</template>
|
||||
</UiCardTitle>
|
||||
<VtsLoadingHero v-if="loading || data.stats === undefined" type="card" />
|
||||
<VtsErrorNoDataHero v-else-if="error" type="card" />
|
||||
<VtsStateHero v-if="loading || data.stats === undefined" format="card" busy size="medium" />
|
||||
<VtsStateHero v-else-if="error" format="card" type="error" size="medium">
|
||||
{{ t('error-no-data') }}
|
||||
</VtsStateHero>
|
||||
<VtsStateHero v-else-if="loadAverage.length === 0" format="card" type="no-data" size="medium">
|
||||
{{ t('no-data-to-calculate') }}
|
||||
</VtsStateHero>
|
||||
<VtsLinearChart v-else :data="loadAverage" :max-value />
|
||||
</UiCard>
|
||||
</template>
|
||||
@@ -13,8 +18,7 @@
|
||||
<script lang="ts" setup>
|
||||
import { RRD_STEP_FROM_STRING } from '@/libs/xapi-stats.ts'
|
||||
import type { LinearChartData } from '@core/types/chart.ts'
|
||||
import VtsErrorNoDataHero from '@core/components/state-hero/VtsErrorNoDataHero.vue'
|
||||
import VtsLoadingHero from '@core/components/state-hero/VtsLoadingHero.vue'
|
||||
import VtsStateHero from '@core/components/state-hero/VtsStateHero.vue'
|
||||
import UiCard from '@core/components/ui/card/UiCard.vue'
|
||||
import UiCardTitle from '@core/components/ui/card-title/UiCardTitle.vue'
|
||||
import type { XapiHostStatsRaw } from '@vates/types/common'
|
||||
@@ -27,7 +31,7 @@ const { data } = defineProps<{
|
||||
timestampStart: number
|
||||
}
|
||||
loading: boolean
|
||||
error?: string
|
||||
error?: boolean
|
||||
}>()
|
||||
|
||||
const VtsLinearChart = defineAsyncComponent(() => import('@core/components/linear-chart/VtsLinearChart.vue'))
|
||||
|
||||
@@ -1,11 +1,16 @@
|
||||
<template>
|
||||
<UiCard>
|
||||
<UiCard :has-error="error">
|
||||
<UiCardTitle>
|
||||
{{ t('network-throughput') }}
|
||||
<template #description>{{ t('last-week') }}</template>
|
||||
</UiCardTitle>
|
||||
<VtsLoadingHero v-if="loading || data.stats === undefined" type="card" />
|
||||
<VtsErrorNoDataHero v-else-if="error" type="card" />
|
||||
<VtsStateHero v-if="loading || data.stats === undefined" format="card" busy size="medium" />
|
||||
<VtsStateHero v-else-if="error" format="card" type="error" size="medium">
|
||||
{{ t('error-no-data') }}
|
||||
</VtsStateHero>
|
||||
<VtsStateHero v-else-if="networkUsage.length === 0" format="card" type="no-data" size="medium">
|
||||
{{ t('no-data-to-calculate') }}
|
||||
</VtsStateHero>
|
||||
<VtsLinearChart v-else :data="networkUsage" :max-value :value-formatter="byteFormatter" />
|
||||
</UiCard>
|
||||
</template>
|
||||
@@ -13,8 +18,7 @@
|
||||
<script lang="ts" setup>
|
||||
import { RRD_STEP_FROM_STRING } from '@/libs/xapi-stats.ts'
|
||||
import type { LinearChartData } from '@core/types/chart.ts'
|
||||
import VtsErrorNoDataHero from '@core/components/state-hero/VtsErrorNoDataHero.vue'
|
||||
import VtsLoadingHero from '@core/components/state-hero/VtsLoadingHero.vue'
|
||||
import VtsStateHero from '@core/components/state-hero/VtsStateHero.vue'
|
||||
import UiCard from '@core/components/ui/card/UiCard.vue'
|
||||
import UiCardTitle from '@core/components/ui/card-title/UiCardTitle.vue'
|
||||
import { formatSizeRaw } from '@core/utils/size.util.ts'
|
||||
@@ -28,7 +32,7 @@ const { data } = defineProps<{
|
||||
timestampStart: number
|
||||
}
|
||||
loading: boolean
|
||||
error?: string
|
||||
error?: boolean
|
||||
}>()
|
||||
|
||||
const VtsLinearChart = defineAsyncComponent(() => import('@core/components/linear-chart/VtsLinearChart.vue'))
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<VtsQuickInfoColumn>
|
||||
<VtsQuickInfoRow :label="t('state')">
|
||||
<template #value>
|
||||
<VtsIcon :accent="powerState.accent" :icon="powerState.icon" />
|
||||
<VtsIcon :name="powerState.icon" size="medium" />
|
||||
{{ powerState.text }}
|
||||
</template>
|
||||
</VtsQuickInfoRow>
|
||||
@@ -12,10 +12,10 @@
|
||||
<VtsQuickInfoRow :label="t('master')">
|
||||
<template #value>
|
||||
<template v-if="isMaster">
|
||||
<VtsIcon v-tooltip="t('master')" accent="info" :icon="faCircle" :overlay-icon="faStar" />
|
||||
<VtsIcon v-tooltip="t('master')" name="legacy:primary" size="medium" />
|
||||
{{ t('this-host') }}
|
||||
</template>
|
||||
<UiLink v-else-if="masterHost !== undefined" :to="`/host/${masterHost.uuid}/`" size="medium" :icon="faServer">
|
||||
<UiLink v-else-if="masterHost !== undefined" :to="`/host/${masterHost.uuid}/`" size="medium" icon="fa:server">
|
||||
{{ masterHost.name_label }}
|
||||
</UiLink>
|
||||
</template>
|
||||
@@ -52,7 +52,8 @@ import type { XenApiHost } from '@/libs/xen-api/xen-api.types.ts'
|
||||
import { useHostMetricsStore } from '@/stores/xen-api/host-metrics.store.ts'
|
||||
import { useHostStore } from '@/stores/xen-api/host.store.ts'
|
||||
import { usePoolStore } from '@/stores/xen-api/pool.store.ts'
|
||||
import VtsIcon, { type IconAccent } from '@core/components/icon/VtsIcon.vue'
|
||||
import type { IconName } from '@core/icons'
|
||||
import VtsIcon from '@core/components/icon/VtsIcon.vue'
|
||||
import VtsQuickInfoCard from '@core/components/quick-info-card/VtsQuickInfoCard.vue'
|
||||
import VtsQuickInfoColumn from '@core/components/quick-info-column/VtsQuickInfoColumn.vue'
|
||||
import VtsQuickInfoRow from '@core/components/quick-info-row/VtsQuickInfoRow.vue'
|
||||
@@ -63,8 +64,6 @@ import useRelativeTime from '@core/composables/relative-time.composable'
|
||||
import { vTooltip } from '@core/directives/tooltip.directive'
|
||||
import { formatSizeRaw } from '@core/utils/size.util'
|
||||
import { parseDateTime } from '@core/utils/time.util'
|
||||
import type { IconDefinition } from '@fortawesome/fontawesome-common-types'
|
||||
import { faCircle, faPlay, faServer, faStar, faStop } from '@fortawesome/free-solid-svg-icons'
|
||||
import { useNow } from '@vueuse/core'
|
||||
import { logicAnd } from '@vueuse/math'
|
||||
import { computed } from 'vue'
|
||||
@@ -82,22 +81,11 @@ const { isHostRunning, getHostMemory, isReady: isHostMetricsReady } = useHostMet
|
||||
|
||||
const isReady = logicAnd(isPoolReady, isHostReady, isHostMetricsReady)
|
||||
|
||||
const powerStateConfig: Record<
|
||||
string,
|
||||
{
|
||||
icon: IconDefinition | undefined
|
||||
accent: IconAccent
|
||||
}
|
||||
> = {
|
||||
running: { icon: faPlay, accent: 'success' },
|
||||
halted: { icon: faStop, accent: 'danger' },
|
||||
}
|
||||
|
||||
const isRunning = computed(() => isHostRunning(host))
|
||||
|
||||
const powerState = computed(() => ({
|
||||
const powerState = computed<{ text: string; icon: IconName }>(() => ({
|
||||
text: t(`host-status.${isRunning.value ? 'running' : 'halted'}`),
|
||||
...powerStateConfig[isRunning.value ? 'running' : 'halted'],
|
||||
icon: isRunning.value ? 'legacy:running' : 'legacy:halted',
|
||||
}))
|
||||
|
||||
const date = computed(() => new Date(parseDateTime(Number(host.other_config.boot_time) * 1000)))
|
||||
|
||||
@@ -1,9 +1,14 @@
|
||||
<template>
|
||||
<UiCard class="host-dashboard-ram-provisioning">
|
||||
<UiCardTitle>{{ t('ram-provisioning') }}</UiCardTitle>
|
||||
<VtsLoadingHero v-if="!isReady" type="card" />
|
||||
<VtsStateHero v-if="!isReady" format="card" busy size="medium" />
|
||||
<template v-else>
|
||||
<UiProgressBar display-mode="percent" :value="memory?.usage ?? 0" :max="memory?.size" :legend="host.name_label" />
|
||||
<VtsProgressBar
|
||||
:current="memory?.usage ?? 0"
|
||||
:label="host.name_label"
|
||||
:total="memory?.size ?? 0"
|
||||
legend-type="percent"
|
||||
/>
|
||||
<div class="total">
|
||||
<UiCardNumbers
|
||||
:label="t('total-assigned')"
|
||||
@@ -26,11 +31,11 @@
|
||||
import type { XenApiHost } from '@/libs/xen-api/xen-api.types.ts'
|
||||
import { useHostMetricsStore } from '@/stores/xen-api/host-metrics.store.ts'
|
||||
import { useHostStore } from '@/stores/xen-api/host.store.ts'
|
||||
import VtsLoadingHero from '@core/components/state-hero/VtsLoadingHero.vue'
|
||||
import VtsProgressBar from '@core/components/progress-bar/VtsProgressBar.vue'
|
||||
import VtsStateHero from '@core/components/state-hero/VtsStateHero.vue'
|
||||
import UiCard from '@core/components/ui/card/UiCard.vue'
|
||||
import UiCardNumbers from '@core/components/ui/card-numbers/UiCardNumbers.vue'
|
||||
import UiCardTitle from '@core/components/ui/card-title/UiCardTitle.vue'
|
||||
import UiProgressBar from '@core/components/ui/progress-bar/UiProgressBar.vue'
|
||||
import { formatSizeRaw } from '@core/utils/size.util'
|
||||
import { logicAnd } from '@vueuse/math'
|
||||
import { computed } from 'vue'
|
||||
|
||||
@@ -1,11 +1,16 @@
|
||||
<template>
|
||||
<UiCard>
|
||||
<UiCard :has-error="error">
|
||||
<UiCardTitle>
|
||||
{{ t('ram-usage') }}
|
||||
<template #description>{{ t('last-week') }}</template>
|
||||
</UiCardTitle>
|
||||
<VtsLoadingHero v-if="loading || data.stats === undefined" type="card" />
|
||||
<VtsErrorNoDataHero v-else-if="error" type="card" />
|
||||
<VtsStateHero v-if="loading || data.stats === undefined" format="card" busy size="medium" />
|
||||
<VtsStateHero v-else-if="error" format="card" type="error" size="medium">
|
||||
{{ t('error-no-data') }}
|
||||
</VtsStateHero>
|
||||
<VtsStateHero v-else-if="memoryUsage.length === 0" format="card" type="no-data" size="medium">
|
||||
{{ t('no-data-to-calculate') }}
|
||||
</VtsStateHero>
|
||||
<VtsLinearChart v-else :data="memoryUsage" :max-value :value-formatter="byteFormatter" />
|
||||
</UiCard>
|
||||
</template>
|
||||
@@ -13,8 +18,7 @@
|
||||
<script lang="ts" setup>
|
||||
import { RRD_STEP_FROM_STRING } from '@/libs/xapi-stats.ts'
|
||||
import type { LinearChartData } from '@core/types/chart.ts'
|
||||
import VtsErrorNoDataHero from '@core/components/state-hero/VtsErrorNoDataHero.vue'
|
||||
import VtsLoadingHero from '@core/components/state-hero/VtsLoadingHero.vue'
|
||||
import VtsStateHero from '@core/components/state-hero/VtsStateHero.vue'
|
||||
import UiCard from '@core/components/ui/card/UiCard.vue'
|
||||
import UiCardTitle from '@core/components/ui/card-title/UiCardTitle.vue'
|
||||
import { formatSizeRaw } from '@core/utils/size.util.ts'
|
||||
@@ -28,7 +32,7 @@ const { data } = defineProps<{
|
||||
timestampStart: number
|
||||
}
|
||||
loading: boolean
|
||||
error?: string
|
||||
error?: boolean
|
||||
}>()
|
||||
|
||||
const VtsLinearChart = defineAsyncComponent(() => import('@core/components/linear-chart/VtsLinearChart.vue'))
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<UiCard class="host-dashboard-vms-status">
|
||||
<UiCardTitle>{{ t('vms-status') }}</UiCardTitle>
|
||||
<VtsLoadingHero v-if="!isReady" type="card" />
|
||||
<VtsStateHero v-if="!isReady" format="card" busy size="medium" />
|
||||
<template v-else>
|
||||
<VtsDonutChartWithLegend :segments />
|
||||
<UiCardNumbers class="total" :label="t('total')" :value="total" size="small" />
|
||||
@@ -16,7 +16,7 @@ import { useVmStore } from '@/stores/xen-api/vm.store.ts'
|
||||
import VtsDonutChartWithLegend, {
|
||||
type DonutChartWithLegendProps,
|
||||
} from '@core/components/donut-chart-with-legend/VtsDonutChartWithLegend.vue'
|
||||
import VtsLoadingHero from '@core/components/state-hero/VtsLoadingHero.vue'
|
||||
import VtsStateHero from '@core/components/state-hero/VtsStateHero.vue'
|
||||
import UiCard from '@core/components/ui/card/UiCard.vue'
|
||||
import UiCardNumbers from '@core/components/ui/card-numbers/UiCardNumbers.vue'
|
||||
import UiCardTitle from '@core/components/ui/card-title/UiCardTitle.vue'
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
size="medium"
|
||||
variant="tertiary"
|
||||
accent="brand"
|
||||
:icon="faAngleLeft"
|
||||
icon="fa:angle-left"
|
||||
@click="emit('close')"
|
||||
/>
|
||||
<div class="action-buttons">
|
||||
@@ -18,7 +18,7 @@
|
||||
size="medium"
|
||||
variant="tertiary"
|
||||
accent="brand"
|
||||
:left-icon="faEdit"
|
||||
left-icon="fa:edit"
|
||||
>
|
||||
{{ t('edit') }}
|
||||
</UiButton>
|
||||
@@ -28,7 +28,7 @@
|
||||
size="medium"
|
||||
variant="tertiary"
|
||||
accent="danger"
|
||||
:left-icon="faTrash"
|
||||
left-icon="fa:trash"
|
||||
>
|
||||
{{ t('delete') }}
|
||||
</UiButton>
|
||||
@@ -49,13 +49,7 @@
|
||||
{{ pif.uuid }}
|
||||
</template>
|
||||
<template #addons>
|
||||
<VtsIcon
|
||||
v-if="pif.management"
|
||||
v-tooltip="t('management')"
|
||||
accent="info"
|
||||
:icon="faCircle"
|
||||
:overlay-icon="faStar"
|
||||
/>
|
||||
<VtsIcon v-if="pif.management" v-tooltip="t('management')" name="legacy:primary" size="medium" />
|
||||
<VtsCopyButton :value="pif.uuid" />
|
||||
</template>
|
||||
</VtsCardRowKeyValue>
|
||||
@@ -69,7 +63,7 @@
|
||||
<!-- TODO Remove the span when the link works and the icon is fixed -->
|
||||
<!--
|
||||
<UiComplexIcon size="medium">
|
||||
<VtsIcon :icon="faNetworkWired" accent="current" />
|
||||
<VtsIcon icon="fa:network-wired" accent="current" />
|
||||
<VtsIcon accent="success" :icon="faCircle" :overlay-icon="faCheck" />
|
||||
</UiComplexIcon>
|
||||
<a href="">{{ networkNameLabel }}</a>
|
||||
@@ -157,7 +151,7 @@
|
||||
v-if="index === 0 && ipAddresses.length > 1"
|
||||
v-tooltip="t('coming-soon')"
|
||||
disabled
|
||||
:icon="faEllipsis"
|
||||
icon="fa:ellipsis"
|
||||
size="medium"
|
||||
accent="brand"
|
||||
/>
|
||||
@@ -248,7 +242,7 @@
|
||||
v-if="index === 0 && bondDevices.length > 1"
|
||||
v-tooltip="t('coming-soon')"
|
||||
disabled
|
||||
:icon="faEllipsis"
|
||||
icon="fa:ellipsis"
|
||||
size="medium"
|
||||
accent="brand"
|
||||
/>
|
||||
@@ -318,7 +312,6 @@ import UiTag from '@core/components/ui/tag/UiTag.vue'
|
||||
import UiTagsList from '@core/components/ui/tag/UiTagsList.vue'
|
||||
import { vTooltip } from '@core/directives/tooltip.directive'
|
||||
import { useUiStore } from '@core/stores/ui.store.ts'
|
||||
import { faAngleLeft, faCircle, faEdit, faEllipsis, faStar, faTrash } from '@fortawesome/free-solid-svg-icons'
|
||||
import humanFormat from 'human-format'
|
||||
import { computed } from 'vue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<UiButton
|
||||
v-tooltip="t('coming-soon')"
|
||||
disabled
|
||||
:left-icon="faPlus"
|
||||
left-icon="fa:plus"
|
||||
variant="secondary"
|
||||
accent="brand"
|
||||
size="medium"
|
||||
@@ -22,7 +22,7 @@
|
||||
<UiButton
|
||||
v-tooltip="t('coming-soon')"
|
||||
disabled
|
||||
:left-icon="faEdit"
|
||||
left-icon="fa:edit"
|
||||
variant="tertiary"
|
||||
accent="brand"
|
||||
size="medium"
|
||||
@@ -32,7 +32,7 @@
|
||||
<UiButton
|
||||
v-tooltip="t('coming-soon')"
|
||||
disabled
|
||||
:left-icon="faTrash"
|
||||
left-icon="fa:trash"
|
||||
variant="tertiary"
|
||||
accent="danger"
|
||||
size="medium"
|
||||
@@ -54,11 +54,11 @@
|
||||
</div>
|
||||
</th>
|
||||
<th v-else-if="column.id === 'more'" class="more">
|
||||
<UiButtonIcon v-tooltip="t('coming-soon')" :icon="faEllipsis" accent="brand" disabled size="small" />
|
||||
<UiButtonIcon v-tooltip="t('coming-soon')" icon="fa:ellipsis" accent="brand" disabled size="small" />
|
||||
</th>
|
||||
<th v-else>
|
||||
<div v-tooltip class="text-ellipsis">
|
||||
<VtsIcon accent="brand" :icon="headerIcon[column.id]" />
|
||||
<VtsIcon :name="headerIcon[column.id]" size="medium" />
|
||||
{{ column.label }}
|
||||
</div>
|
||||
</th>
|
||||
@@ -84,7 +84,7 @@
|
||||
<UiButtonIcon
|
||||
v-else-if="column.id === 'more'"
|
||||
v-tooltip="t('coming-soon')"
|
||||
:icon="faEllipsis"
|
||||
icon="fa:ellipsis"
|
||||
accent="brand"
|
||||
disabled
|
||||
size="small"
|
||||
@@ -96,7 +96,7 @@
|
||||
<!-- TODO Remove the span when the link works and the icon is fixed -->
|
||||
<!--
|
||||
<UiComplexIcon size="medium" class="icon">
|
||||
<VtsIcon :icon="faNetworkWired" accent="current" />
|
||||
<VtsIcon icon="fa:network-wired" accent="current" />
|
||||
<VtsIcon accent="success" :icon="faCircle" :overlay-icon="faCheck" />
|
||||
</UiComplexIcon>
|
||||
<a v-tooltip href="" class="text-ellipsis">{{ column.value.name }}</a>
|
||||
@@ -105,9 +105,8 @@
|
||||
<VtsIcon
|
||||
v-if="column.value.management"
|
||||
v-tooltip="t('management')"
|
||||
accent="info"
|
||||
:icon="faCircle"
|
||||
:overlay-icon="faStar"
|
||||
name="legacy:primary"
|
||||
size="medium"
|
||||
/>
|
||||
</div>
|
||||
<div v-else-if="column.id === 'IP'" class="ip-addresses">
|
||||
@@ -123,7 +122,7 @@
|
||||
</tr>
|
||||
</template>
|
||||
</VtsDataTable>
|
||||
<VtsStateHero v-if="searchQuery && filteredPifs.length === 0" type="table" image="no-result">
|
||||
<VtsStateHero v-if="searchQuery && filteredPifs.length === 0" format="table" type="no-result" size="small">
|
||||
<div>{{ t('no-result') }}</div>
|
||||
</VtsStateHero>
|
||||
<UiTopBottomTable :selected-items="0" :total-items="0">
|
||||
@@ -138,6 +137,7 @@ import useMultiSelect from '@/composables/multi-select.composable'
|
||||
import type { XenApiNetwork, XenApiPif } from '@/libs/xen-api/xen-api.types'
|
||||
import { useNetworkStore } from '@/stores/xen-api/network.store'
|
||||
import { usePifStore } from '@/stores/xen-api/pif.store'
|
||||
import type { IconName } from '@core/icons'
|
||||
import VtsConnectionStatus from '@core/components/connection-status/VtsConnectionStatus.vue'
|
||||
import VtsDataTable from '@core/components/data-table/VtsDataTable.vue'
|
||||
import VtsIcon from '@core/components/icon/VtsIcon.vue'
|
||||
@@ -154,19 +154,6 @@ import { usePagination } from '@core/composables/pagination.composable'
|
||||
import { useRouteQuery } from '@core/composables/route-query.composable'
|
||||
import { useTable } from '@core/composables/table.composable'
|
||||
import { vTooltip } from '@core/directives/tooltip.directive'
|
||||
import type { IconDefinition } from '@fortawesome/fontawesome-common-types'
|
||||
import {
|
||||
faAlignLeft,
|
||||
faAt,
|
||||
faCaretDown,
|
||||
faCircle,
|
||||
faEdit,
|
||||
faEllipsis,
|
||||
faPlus,
|
||||
faPowerOff,
|
||||
faStar,
|
||||
faTrash,
|
||||
} from '@fortawesome/free-solid-svg-icons'
|
||||
import { noop } from '@vueuse/shared'
|
||||
import { computed, ref } from 'vue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
@@ -248,14 +235,14 @@ const { pageRecords: pifsRecords, paginationBindings } = usePagination('pifs', r
|
||||
|
||||
type PifHeader = 'network' | 'device' | 'status' | 'VLAN' | 'IP' | 'MAC' | 'ip_configuration_mode'
|
||||
|
||||
const headerIcon: Record<PifHeader, IconDefinition> = {
|
||||
network: faAlignLeft,
|
||||
device: faAlignLeft,
|
||||
status: faPowerOff,
|
||||
VLAN: faAlignLeft,
|
||||
IP: faAt,
|
||||
MAC: faAt,
|
||||
ip_configuration_mode: faCaretDown,
|
||||
const headerIcon: Record<PifHeader, IconName> = {
|
||||
network: 'fa:align-left',
|
||||
device: 'fa:align-left',
|
||||
status: 'fa:power-off',
|
||||
VLAN: 'fa:align-left',
|
||||
IP: 'fa:at',
|
||||
MAC: 'fa:at',
|
||||
ip_configuration_mode: 'fa:caret-down',
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
</VtsQuickInfoRow>
|
||||
<VtsQuickInfoRow :label="t('pool')">
|
||||
<template v-if="pool !== undefined" #value>
|
||||
<UiLink size="medium" :to="`/pool/${pool.uuid}/`" :icon="faCity">
|
||||
<UiLink size="medium" :to="`/pool/${pool.uuid}/`" icon="fa:city">
|
||||
{{ pool.name_label }}
|
||||
</UiLink>
|
||||
</template>
|
||||
@@ -30,10 +30,10 @@
|
||||
<VtsQuickInfoRow :label="t('master')">
|
||||
<template #value>
|
||||
<template v-if="isMaster">
|
||||
<VtsIcon v-tooltip="t('master')" accent="info" :icon="faCircle" :overlay-icon="faStar" />
|
||||
<VtsIcon v-tooltip="t('master')" name="legacy:primary" size="medium" />
|
||||
{{ t('this-host') }}
|
||||
</template>
|
||||
<UiLink v-else-if="masterHost !== undefined" size="medium" :to="`/host/${masterHost.uuid}/`" :icon="faServer">
|
||||
<UiLink v-else-if="masterHost !== undefined" size="medium" :to="`/host/${masterHost.uuid}/`" icon="fa:server">
|
||||
{{ masterHost.name_label }}
|
||||
</UiLink>
|
||||
</template>
|
||||
@@ -65,7 +65,6 @@ import UiTag from '@core/components/ui/tag/UiTag.vue'
|
||||
import UiTagsList from '@core/components/ui/tag/UiTagsList.vue'
|
||||
import UiTitle from '@core/components/ui/title/UiTitle.vue'
|
||||
import { vTooltip } from '@core/directives/tooltip.directive'
|
||||
import { faCircle, faCity, faServer, faStar } from '@fortawesome/free-solid-svg-icons'
|
||||
import { computed } from 'vue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
<template>
|
||||
<VtsTreeItem v-if="host !== undefined" :expanded="isExpanded" class="infra-host-item">
|
||||
<UiTreeItemLabel :icon="faServer" :route="{ name: '/host/[uuid]', params: { uuid: host.uuid } }" @toggle="toggle()">
|
||||
<UiTreeItemLabel :route="{ name: '/host/[uuid]', params: { uuid: host.uuid } }" icon="fa:server" @toggle="toggle()">
|
||||
{{ host.name_label || '(Host)' }}
|
||||
<template #addons>
|
||||
<VtsIcon v-if="isPoolMaster" v-tooltip="t('master')" accent="info" :icon="faCircle" :overlay-icon="faStar" />
|
||||
<VtsIcon v-if="isPoolMaster" v-tooltip="t('master')" name="legacy:primary" size="medium" />
|
||||
<UiCounter
|
||||
v-if="isReady"
|
||||
v-tooltip="t('running-vm', { count: vmCount })"
|
||||
:value="vmCount"
|
||||
accent="brand"
|
||||
variant="secondary"
|
||||
size="small"
|
||||
variant="secondary"
|
||||
/>
|
||||
</template>
|
||||
</UiTreeItemLabel>
|
||||
@@ -34,7 +34,6 @@ import VtsTreeList from '@core/components/tree/VtsTreeList.vue'
|
||||
import UiCounter from '@core/components/ui/counter/UiCounter.vue'
|
||||
import UiTreeItemLabel from '@core/components/ui/tree-item-label/UiTreeItemLabel.vue'
|
||||
import { vTooltip } from '@core/directives/tooltip.directive'
|
||||
import { faCircle, faServer, faStar } from '@fortawesome/free-solid-svg-icons'
|
||||
import { useToggle } from '@vueuse/shared'
|
||||
import { computed } from 'vue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<VtsTreeItemError v-if="hasError">
|
||||
{{ t('error-no-data') }}
|
||||
</VtsTreeItemError>
|
||||
<VtsTreeLoadingItem v-else-if="!isReady" :icon="faServer">{{ t('loading-hosts') }}</VtsTreeLoadingItem>
|
||||
<VtsTreeLoadingItem v-else-if="!isReady" icon="fa:server">{{ t('loading-hosts') }}</VtsTreeLoadingItem>
|
||||
<InfraHostItem v-for="host in hosts" :key="host.$ref" :host-opaque-ref="host.$ref" />
|
||||
</template>
|
||||
|
||||
@@ -11,7 +11,6 @@ import InfraHostItem from '@/components/infra/InfraHostItem.vue'
|
||||
import { useHostStore } from '@/stores/xen-api/host.store'
|
||||
import VtsTreeItemError from '@core/components/tree/VtsTreeItemError.vue'
|
||||
import VtsTreeLoadingItem from '@core/components/tree/VtsTreeLoadingItem.vue'
|
||||
import { faServer } from '@fortawesome/free-solid-svg-icons'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
|
||||
const { t } = useI18n()
|
||||
|
||||
@@ -4,11 +4,11 @@
|
||||
<VtsTreeItemError v-if="hasError">
|
||||
{{ t('error-no-data') }}
|
||||
</VtsTreeItemError>
|
||||
<VtsTreeLoadingItem v-else-if="!isReady || pool === undefined" :icon="faCity" />
|
||||
<VtsTreeLoadingItem v-else-if="!isReady || pool === undefined" icon="fa:city" />
|
||||
<UiTreeItemLabel
|
||||
v-else
|
||||
:icon="faCity"
|
||||
:route="{ name: '/pool/[uuid]', params: { uuid: pool.uuid } }"
|
||||
icon="fa:city"
|
||||
@toggle="toggle()"
|
||||
>
|
||||
{{ pool.name_label || '(Pool)' }}
|
||||
@@ -32,7 +32,6 @@ import VtsTreeItemError from '@core/components/tree/VtsTreeItemError.vue'
|
||||
import VtsTreeList from '@core/components/tree/VtsTreeList.vue'
|
||||
import VtsTreeLoadingItem from '@core/components/tree/VtsTreeLoadingItem.vue'
|
||||
import UiTreeItemLabel from '@core/components/ui/tree-item-label/UiTreeItemLabel.vue'
|
||||
import { faCity } from '@fortawesome/free-solid-svg-icons'
|
||||
import { useToggle } from '@vueuse/shared'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<UiTreeItemLabel v-if="isVisible" :route="{ name: '/vm/[uuid]', params: { uuid: vm.uuid } }" no-indent>
|
||||
{{ vm.name_label || '(VM)' }}
|
||||
<template #icon>
|
||||
<UiObjectIcon size="medium" :state="vmPowerState!" type="vm" />
|
||||
<VtsObjectIcon size="medium" :state="vmPowerState!" type="vm" />
|
||||
</template>
|
||||
</UiTreeItemLabel>
|
||||
</VtsTreeItem>
|
||||
@@ -13,8 +13,8 @@
|
||||
import type { VM_POWER_STATE } from '@/libs/xen-api/xen-api.enums'
|
||||
import type { XenApiVm } from '@/libs/xen-api/xen-api.types'
|
||||
import { useVmStore } from '@/stores/xen-api/vm.store'
|
||||
import VtsObjectIcon from '@core/components/object-icon/VtsObjectIcon.vue'
|
||||
import VtsTreeItem from '@core/components/tree/VtsTreeItem.vue'
|
||||
import UiObjectIcon from '@core/components/ui/object-icon/UiObjectIcon.vue'
|
||||
import UiTreeItemLabel from '@core/components/ui/tree-item-label/UiTreeItemLabel.vue'
|
||||
import { useIntersectionObserver } from '@vueuse/core'
|
||||
import { computed, ref } from 'vue'
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<VtsTreeItemError v-if="hasError">{{ t('error-no-data') }}</VtsTreeItemError>
|
||||
<template v-else-if="!isReady">
|
||||
<VtsTreeLoadingItem v-for="i in 3" :key="i" :icon="faDisplay" />
|
||||
<VtsTreeLoadingItem v-for="i in 3" :key="i" icon="fa:display" />
|
||||
</template>
|
||||
<InfraVmItem v-for="vm in vms" :key="vm.$ref" :vm-opaque-ref="vm.$ref" />
|
||||
</template>
|
||||
@@ -12,7 +12,6 @@ import type { XenApiHost } from '@/libs/xen-api/xen-api.types'
|
||||
import { useVmStore } from '@/stores/xen-api/vm.store'
|
||||
import VtsTreeItemError from '@core/components/tree/VtsTreeItemError.vue'
|
||||
import VtsTreeLoadingItem from '@core/components/tree/VtsTreeLoadingItem.vue'
|
||||
import { faDisplay } from '@fortawesome/free-solid-svg-icons'
|
||||
import { computed } from 'vue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ const { id: sortPropertySelectId } = useFormSelect(Object.entries(availableSorts
|
||||
model: newSortProperty,
|
||||
option: {
|
||||
id: ([property]) => property,
|
||||
label: ([, sort]) => sort.label ?? '',
|
||||
label: ([property, sort]) => sort.label ?? property,
|
||||
value: ([property]) => property,
|
||||
},
|
||||
})
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<UiModal color="error" @submit="modal.approve()">
|
||||
<ConfirmModalLayout :icon="faExclamationCircle">
|
||||
<ConfirmModalLayout icon="fa:exclamation-circle">
|
||||
<template #title>{{ t('invalid-field') }}</template>
|
||||
|
||||
<template #default>
|
||||
@@ -21,7 +21,6 @@ import ConfirmModalLayout from '@/components/ui/modals/layouts/ConfirmModalLayou
|
||||
import ModalApproveButton from '@/components/ui/modals/ModalApproveButton.vue'
|
||||
import UiModal from '@/components/ui/modals/UiModal.vue'
|
||||
import { IK_MODAL } from '@/types/injection-keys'
|
||||
import { faExclamationCircle } from '@fortawesome/free-solid-svg-icons'
|
||||
import { inject } from 'vue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<UiModal :color="isJsonValid ? 'success' : 'error'" @submit.prevent="handleSubmit()">
|
||||
<FormModalLayout :icon="faCode" class="layout">
|
||||
<FormModalLayout icon="fa:code" class="layout">
|
||||
<template #default>
|
||||
<UiTextarea v-model="editedJson" accent="brand" class="modal-textarea" />
|
||||
</template>
|
||||
@@ -26,7 +26,6 @@ import UiModal from '@/components/ui/modals/UiModal.vue'
|
||||
import { IK_MODAL } from '@/types/injection-keys'
|
||||
import UiButton from '@core/components/ui/button/UiButton.vue'
|
||||
import UiTextarea from '@core/components/ui/text-area/UiTextarea.vue'
|
||||
import { faCode } from '@fortawesome/free-solid-svg-icons'
|
||||
import { computed, inject, ref } from 'vue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<UiModal color="error" @submit="modal.approve()">
|
||||
<ConfirmModalLayout :icon="faServer">
|
||||
<ConfirmModalLayout icon="fa:server">
|
||||
<template #title>{{ t('unreachable-hosts') }}</template>
|
||||
|
||||
<template #default>
|
||||
@@ -33,7 +33,6 @@ import ModalApproveButton from '@/components/ui/modals/ModalApproveButton.vue'
|
||||
import ModalDeclineButton from '@/components/ui/modals/ModalDeclineButton.vue'
|
||||
import UiModal from '@/components/ui/modals/UiModal.vue'
|
||||
import { IK_MODAL } from '@/types/injection-keys'
|
||||
import { faServer } from '@fortawesome/free-solid-svg-icons'
|
||||
import { inject } from 'vue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<UiModal @submit.prevent="handleSubmit()">
|
||||
<ConfirmModalLayout :icon="faSatellite">
|
||||
<ConfirmModalLayout icon="fa:satellite">
|
||||
<template #title>
|
||||
<I18nT keypath="confirm-delete" scope="global" tag="div">
|
||||
<span :class="textClass">
|
||||
@@ -35,7 +35,6 @@ import { ColorContext } from '@/context'
|
||||
import type { XenApiVm } from '@/libs/xen-api/xen-api.types'
|
||||
import { useXenApiStore } from '@/stores/xen-api.store'
|
||||
import { IK_MODAL } from '@/types/injection-keys'
|
||||
import { faSatellite } from '@fortawesome/free-solid-svg-icons'
|
||||
import { inject } from 'vue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<UiModal>
|
||||
<FormModalLayout :icon="faDisplay">
|
||||
<FormModalLayout icon="fa:display">
|
||||
<template #title>
|
||||
{{ t('export-n-vms-manually', { n: labelWithUrl.length }) }}
|
||||
</template>
|
||||
@@ -29,7 +29,6 @@ import ModalDeclineButton from '@/components/ui/modals/ModalDeclineButton.vue'
|
||||
import UiModal from '@/components/ui/modals/UiModal.vue'
|
||||
import type { XenApiVm } from '@/libs/xen-api/xen-api.types'
|
||||
import { useVmStore } from '@/stores/xen-api/vm.store'
|
||||
import { faDisplay } from '@fortawesome/free-solid-svg-icons'
|
||||
import { computed } from 'vue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<UiModal @submit.prevent="handleSubmit">
|
||||
<FormModalLayout :icon="faDisplay">
|
||||
<FormModalLayout icon="fa:display">
|
||||
<template #title>
|
||||
{{ t('export-n-vms', { n: vmRefs.length }) }}
|
||||
</template>
|
||||
@@ -35,7 +35,6 @@ import { IK_MODAL } from '@/types/injection-keys'
|
||||
import VtsInputWrapper from '@core/components/input-wrapper/VtsInputWrapper.vue'
|
||||
import VtsSelect from '@core/components/select/VtsSelect.vue'
|
||||
import { useFormSelect } from '@core/packages/form-select'
|
||||
import { faDisplay } from '@fortawesome/free-solid-svg-icons'
|
||||
import { inject, ref } from 'vue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<tr class="pif-row" :class="{ clickable: pifHost }" @click="pifHost?.redirect()">
|
||||
<td v-tooltip class="typo-body-regular-small text-ellipsis host-container">
|
||||
<div v-if="pifHost" class="host">
|
||||
<UiObjectIcon :state="pifHost.powerState" type="host" size="small" />
|
||||
<VtsObjectIcon :state="pifHost.powerState" type="host" size="small" />
|
||||
<span v-tooltip class="typo-body-regular-small text-ellipsis host-name">
|
||||
{{ pifHost.label }}
|
||||
</span>
|
||||
@@ -16,7 +16,7 @@
|
||||
<VtsConnectionStatus :status />
|
||||
</td>
|
||||
<td>
|
||||
<UiButtonIcon size="small" accent="brand" :icon="faAngleRight" :disabled="!pifHost" />
|
||||
<UiButtonIcon size="small" accent="brand" icon="fa:angle-right" :disabled="!pifHost" />
|
||||
</td>
|
||||
</tr>
|
||||
</template>
|
||||
@@ -27,10 +27,9 @@ import { useHostMetricsStore } from '@/stores/xen-api/host-metrics.store'
|
||||
import { useHostStore } from '@/stores/xen-api/host.store'
|
||||
import { usePifStore } from '@/stores/xen-api/pif.store'
|
||||
import VtsConnectionStatus from '@core/components/connection-status/VtsConnectionStatus.vue'
|
||||
import VtsObjectIcon from '@core/components/object-icon/VtsObjectIcon.vue'
|
||||
import UiButtonIcon from '@core/components/ui/button-icon/UiButtonIcon.vue'
|
||||
import UiObjectIcon from '@core/components/ui/object-icon/UiObjectIcon.vue'
|
||||
import { vTooltip } from '@core/directives/tooltip.directive'
|
||||
import { faAngleRight } from '@fortawesome/free-solid-svg-icons'
|
||||
import { computed } from 'vue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import { useRouter } from 'vue-router'
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<template>
|
||||
<UiHeadBar :icon="faCity">
|
||||
<UiHeadBar icon="fa:city">
|
||||
{{ name }}
|
||||
<template #actions>
|
||||
<RouterLink :to="{ name: '/vm/new' }">
|
||||
<UiButton :left-icon="faPlus" variant="secondary" accent="brand" size="medium">{{ t('new-vm') }}</UiButton>
|
||||
<UiButton left-icon="fa:plus" variant="secondary" accent="brand" size="medium">{{ t('new-vm') }}</UiButton>
|
||||
</RouterLink>
|
||||
</template>
|
||||
</UiHeadBar>
|
||||
@@ -13,7 +13,6 @@
|
||||
import { usePoolStore } from '@/stores/xen-api/pool.store'
|
||||
import UiButton from '@core/components/ui/button/UiButton.vue'
|
||||
import UiHeadBar from '@core/components/ui/head-bar/UiHeadBar.vue'
|
||||
import { faCity, faPlus } from '@fortawesome/free-solid-svg-icons'
|
||||
import { computed } from 'vue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
|
||||
|
||||
@@ -18,9 +18,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<NoDataError v-else-if="hasError" />
|
||||
<div v-else-if="!isReady">
|
||||
<UiCardSpinner />
|
||||
</div>
|
||||
<VtsStateHero v-else-if="!isReady" format="card" busy size="medium" />
|
||||
<div v-else-if="alarms.length === 0" class="no-alarm">
|
||||
<div>
|
||||
<img alt="" src="@/assets/server-status.svg" />
|
||||
@@ -41,10 +39,10 @@
|
||||
import NoDataError from '@/components/NoDataError.vue'
|
||||
import AlarmRow from '@/components/pool/dashboard/alarm/AlarmRow.vue'
|
||||
import UiCard from '@/components/ui/UiCard.vue'
|
||||
import UiCardSpinner from '@/components/ui/UiCardSpinner.vue'
|
||||
import UiCardTitle from '@/components/ui/UiCardTitle.vue'
|
||||
import UiTable from '@/components/ui/UiTable.vue'
|
||||
import { useAlarmStore } from '@/stores/xen-api/alarm.store'
|
||||
import VtsStateHero from '@core/components/state-hero/VtsStateHero.vue'
|
||||
import UiButton from '@core/components/ui/button/UiButton.vue'
|
||||
import UiCounter from '@core/components/ui/counter/UiCounter.vue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
|
||||
@@ -1,58 +1,42 @@
|
||||
<template>
|
||||
<UiCard :color="hasError ? 'error' : undefined">
|
||||
<UiCardTitle>
|
||||
{{ t('cpu-provisioning') }}
|
||||
<template v-if="!hasError" #right>
|
||||
<UiStatusIcon
|
||||
v-if="state !== 'success'"
|
||||
v-tooltip="{
|
||||
content: t('cpu-provisioning-warning'),
|
||||
placement: 'left',
|
||||
}"
|
||||
:state
|
||||
/>
|
||||
</template>
|
||||
</UiCardTitle>
|
||||
<NoDataError v-if="hasError" />
|
||||
<div v-else-if="isReady" :class="state" class="progress-item">
|
||||
<UiProgressBar :max-value="maxValue" :value color="custom" />
|
||||
<UiProgressScale :max-value="maxValue" :steps="1" unit="%" />
|
||||
<UiProgressLegend :label="t('vcpus')" :value="n(value / 100, 'percent')" />
|
||||
<UiCardFooter class="ui-card-footer">
|
||||
<template #left>
|
||||
<p>{{ t('vcpus-assigned') }}</p>
|
||||
<p class="footer-value">{{ nVcpuAssigned }}</p>
|
||||
</template>
|
||||
<template #right>
|
||||
<p>{{ t('total-cpus') }}</p>
|
||||
<p class="footer-value">{{ nPCpu }}</p>
|
||||
</template>
|
||||
</UiCardFooter>
|
||||
</div>
|
||||
<UiCardSpinner v-else />
|
||||
<UiCardTitle>{{ t('cpu-provisioning') }}</UiCardTitle>
|
||||
<VtsStateHero v-if="!isReady" format="card" busy size="medium" />
|
||||
<VtsStateHero v-else-if="hasError" format="card" type="error" size="medium">
|
||||
{{ t('error-no-data') }}
|
||||
</VtsStateHero>
|
||||
<template v-else>
|
||||
<VtsProgressBar
|
||||
:current="nVcpuAssigned"
|
||||
:total="nPCpu"
|
||||
:label="t('vcpus')"
|
||||
:thresholds="cpuProgressThresholds(t('cpu-provisioning-warning'))"
|
||||
legend-type="percent"
|
||||
/>
|
||||
<div class="cpu-provisioning-numbers">
|
||||
<UiCardNumbers :label="t('vcpus-assigned')" :value="nVcpuAssigned" size="medium" />
|
||||
<UiCardNumbers :label="t('total-cpus')" :value="nPCpu" size="medium" />
|
||||
</div>
|
||||
</template>
|
||||
</UiCard>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import NoDataError from '@/components/NoDataError.vue'
|
||||
import UiStatusIcon from '@/components/ui/icon/UiStatusIcon.vue'
|
||||
import UiProgressBar from '@/components/ui/progress/UiProgressBar.vue'
|
||||
import UiProgressLegend from '@/components/ui/progress/UiProgressLegend.vue'
|
||||
import UiProgressScale from '@/components/ui/progress/UiProgressScale.vue'
|
||||
import UiCard from '@/components/ui/UiCard.vue'
|
||||
import UiCardFooter from '@/components/ui/UiCardFooter.vue'
|
||||
import UiCardSpinner from '@/components/ui/UiCardSpinner.vue'
|
||||
import UiCardTitle from '@/components/ui/UiCardTitle.vue'
|
||||
import { ACTIVE_STATES, percent } from '@/libs/utils'
|
||||
import { ACTIVE_STATES } from '@/libs/utils'
|
||||
import { useHostStore } from '@/stores/xen-api/host.store'
|
||||
import { useVmMetricsStore } from '@/stores/xen-api/vm-metrics.store'
|
||||
import { useVmStore } from '@/stores/xen-api/vm.store'
|
||||
import { vTooltip } from '@core/directives/tooltip.directive'
|
||||
import VtsProgressBar from '@core/components/progress-bar/VtsProgressBar.vue'
|
||||
import VtsStateHero from '@core/components/state-hero/VtsStateHero.vue'
|
||||
import UiCardNumbers from '@core/components/ui/card-numbers/UiCardNumbers.vue'
|
||||
import { cpuProgressThresholds } from '@core/utils/progress.util.ts'
|
||||
import { logicAnd } from '@vueuse/math'
|
||||
import { computed } from 'vue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
|
||||
const { t, n } = useI18n()
|
||||
const { t } = useI18n()
|
||||
|
||||
const { hasError: hostStoreHasError, isReady: isHostStoreReady, runningHosts } = useHostStore().subscribe()
|
||||
|
||||
@@ -77,9 +61,6 @@ const nVcpuAssigned = computed(() => {
|
||||
return total + vm.VCPUs_at_startup
|
||||
}, 0)
|
||||
})
|
||||
const value = computed(() => Math.round(percent(nVcpuAssigned.value, nPCpu.value)))
|
||||
const maxValue = computed(() => Math.ceil(value.value / 100) * 100)
|
||||
const state = computed(() => (value.value > 100 ? 'warning' : 'success'))
|
||||
|
||||
const hasError = computed(() => hostStoreHasError.value || vmStoreHasError.value)
|
||||
</script>
|
||||
@@ -104,4 +85,10 @@ const hasError = computed(() => hostStoreHasError.value || vmStoreHasError.value
|
||||
.ui-card-footer {
|
||||
margin-top: 2rem;
|
||||
}
|
||||
|
||||
.cpu-provisioning-numbers {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
margin-block-start: auto;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -4,16 +4,19 @@
|
||||
<UiCardTitle :level="UiCardTitleLevel.Subtitle">
|
||||
{{ t('last-week') }}
|
||||
</UiCardTitle>
|
||||
<NoDataError v-if="hasError" />
|
||||
<UiCardSpinner v-else-if="isLoading" />
|
||||
<VtsStateHero v-if="isLoading" format="card" busy size="medium" />
|
||||
<VtsStateHero v-else-if="hasError" format="card" type="error" size="medium">
|
||||
{{ t('error-no-data') }}
|
||||
</VtsStateHero>
|
||||
<VtsStateHero v-else-if="data.length === 0" format="card" type="no-data" size="medium">
|
||||
{{ t('no-data-to-calculate') }}
|
||||
</VtsStateHero>
|
||||
<VtsLinearChart v-else :data :max-value="customMaxValue" :value-formatter="customValueFormatter" />
|
||||
</UiCard>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import NoDataError from '@/components/NoDataError.vue'
|
||||
import UiCard from '@/components/ui/UiCard.vue'
|
||||
import UiCardSpinner from '@/components/ui/UiCardSpinner.vue'
|
||||
import UiCardTitle from '@/components/ui/UiCardTitle.vue'
|
||||
import { formatSize } from '@/libs/utils'
|
||||
import { RRD_STEP_FROM_STRING } from '@/libs/xapi-stats'
|
||||
@@ -21,6 +24,7 @@ import { useHostStore } from '@/stores/xen-api/host.store'
|
||||
import { UiCardTitleLevel } from '@/types/enums'
|
||||
import { IK_HOST_LAST_WEEK_STATS } from '@/types/injection-keys'
|
||||
import type { LinearChartData } from '@core/types/chart'
|
||||
import VtsStateHero from '@core/components/state-hero/VtsStateHero.vue'
|
||||
import type { XapiHostStatsRaw } from '@vates/types'
|
||||
import { computed, defineAsyncComponent, inject } from 'vue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<template>
|
||||
<UiCard class="pool-dashboard-status" :color="hasError ? 'error' : undefined">
|
||||
<UiCardTitle>{{ t('status') }}</UiCardTitle>
|
||||
<NoDataError v-if="hasError" />
|
||||
<UiCardSpinner v-else-if="!isReady" />
|
||||
<VtsStateHero v-if="!isReady" format="card" busy size="medium" />
|
||||
<VtsStateHero v-else-if="hasError" format="card" type="error" size="medium">{{ t('error-no-data') }}</VtsStateHero>
|
||||
<template v-else>
|
||||
<PoolDashboardStatusItem
|
||||
:active="activeHostsCount"
|
||||
@@ -24,14 +24,13 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import NoDataError from '@/components/NoDataError.vue'
|
||||
import PoolDashboardStatusItem from '@/components/pool/dashboard/PoolDashboardStatusItem.vue'
|
||||
import UiCard from '@/components/ui/UiCard.vue'
|
||||
import UiCardSpinner from '@/components/ui/UiCardSpinner.vue'
|
||||
import UiCardTitle from '@/components/ui/UiCardTitle.vue'
|
||||
import UiSeparator from '@/components/ui/UiSeparator.vue'
|
||||
import { useHostMetricsStore } from '@/stores/xen-api/host-metrics.store'
|
||||
import { useVmStore } from '@/stores/xen-api/vm.store'
|
||||
import VtsStateHero from '@core/components/state-hero/VtsStateHero.vue'
|
||||
import { computed } from 'vue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
|
||||
|
||||
@@ -1,25 +1,35 @@
|
||||
<template>
|
||||
<UiCard :color="hasError ? 'error' : undefined">
|
||||
<UiCardTitle :left="t('storage-usage')" :right="t('top-#', { n: N_ITEMS })" />
|
||||
<NoDataError v-if="hasError" />
|
||||
<UiCardSpinner v-else-if="!isReady" />
|
||||
<UsageBar v-else :data="data.result" :n-items="N_ITEMS">
|
||||
<template #footer>
|
||||
<SizeStatsSummary :size="data.maxSize" :usage="data.usedSize" />
|
||||
</template>
|
||||
</UsageBar>
|
||||
<VtsStateHero v-if="!isReady" format="card" busy size="medium" />
|
||||
<VtsStateHero v-else-if="hasError" format="card" type="error" size="medium">
|
||||
{{ t('error-no-data') }}
|
||||
</VtsStateHero>
|
||||
<template v-else>
|
||||
<VtsProgressBarGroup :items="data.progressBarItems" :n-items="N_ITEMS" legend-type="percent" />
|
||||
<div>
|
||||
<UiCardNumbers
|
||||
:label="t('total-used')"
|
||||
:unit="data.usedSize.prefix"
|
||||
:value="data.usedSize.value"
|
||||
size="medium"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
</UiCard>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import NoDataError from '@/components/NoDataError.vue'
|
||||
import SizeStatsSummary from '@/components/ui/SizeStatsSummary.vue'
|
||||
import UiCard from '@/components/ui/UiCard.vue'
|
||||
import UiCardSpinner from '@/components/ui/UiCardSpinner.vue'
|
||||
import UiCardTitle from '@/components/ui/UiCardTitle.vue'
|
||||
import UsageBar from '@/components/UsageBar.vue'
|
||||
import { N_ITEMS } from '@/pages/pool/[uuid]/dashboard.vue'
|
||||
import { useSrStore } from '@/stores/xen-api/sr.store'
|
||||
import VtsProgressBarGroup, {
|
||||
type ProgressBarGroupItem,
|
||||
} from '@core/components/progress-bar-group/VtsProgressBarGroup.vue'
|
||||
import VtsStateHero from '@core/components/state-hero/VtsStateHero.vue'
|
||||
import UiCardNumbers from '@core/components/ui/card-numbers/UiCardNumbers.vue'
|
||||
import { formatSizeRaw } from '@core/utils/size.util.ts'
|
||||
import { computed } from 'vue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
|
||||
@@ -27,12 +37,8 @@ const { t } = useI18n()
|
||||
|
||||
const { records: srs, isReady, hasError } = useSrStore().subscribe()
|
||||
|
||||
const data = computed<{
|
||||
result: { id: string; label: string; value: number }[]
|
||||
maxSize: number
|
||||
usedSize: number
|
||||
}>(() => {
|
||||
const result: { id: string; label: string; value: number }[] = []
|
||||
const data = computed(() => {
|
||||
const progressBarItems: ProgressBarGroupItem[] = []
|
||||
let maxSize = 0
|
||||
let usedSize = 0
|
||||
|
||||
@@ -50,12 +56,18 @@ const data = computed<{
|
||||
return
|
||||
}
|
||||
|
||||
result.push({
|
||||
progressBarItems.push({
|
||||
id: uuid,
|
||||
label: name_label,
|
||||
value: percent,
|
||||
current: percent,
|
||||
total: 100,
|
||||
})
|
||||
})
|
||||
return { result, maxSize, usedSize }
|
||||
|
||||
return {
|
||||
progressBarItems,
|
||||
maxSize: formatSizeRaw(maxSize, 0),
|
||||
usedSize: formatSizeRaw(usedSize, 0),
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
@@ -1,17 +1,15 @@
|
||||
<template>
|
||||
<UiCardTitle :left="t('hosts')" :level="UiCardTitleLevel.SubtitleWithUnderline" :right="t('top-#', { n: N_ITEMS })" />
|
||||
<NoDataError v-if="hasError" />
|
||||
<UiCardSpinner v-else-if="isLoading" />
|
||||
<NoResult v-else-if="isStatEmpty" />
|
||||
<UsageBar v-else :data :n-items="N_ITEMS" />
|
||||
<VtsStateHero v-if="isLoading" format="card" busy size="medium" />
|
||||
<VtsStateHero v-else-if="hasError" format="card" type="error" size="medium">{{ t('error-no-data') }}</VtsStateHero>
|
||||
<VtsStateHero v-else-if="isStatEmpty" format="card" type="no-data" size="medium">
|
||||
{{ t('no-data-to-calculate') }}
|
||||
</VtsStateHero>
|
||||
<VtsProgressBarGroup v-else :items="data" :n-items="N_ITEMS" legend-type="percent" />
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import NoDataError from '@/components/NoDataError.vue'
|
||||
import NoResult from '@/components/NoResult.vue'
|
||||
import UiCardSpinner from '@/components/ui/UiCardSpinner.vue'
|
||||
import UiCardTitle from '@/components/ui/UiCardTitle.vue'
|
||||
import UsageBar from '@/components/UsageBar.vue'
|
||||
import { useStatStatus } from '@/composables/stat-status.composable'
|
||||
import { getAvgCpuUsage } from '@/libs/utils'
|
||||
import { N_ITEMS } from '@/pages/pool/[uuid]/dashboard.vue'
|
||||
@@ -19,6 +17,8 @@ import { useHostStore } from '@/stores/xen-api/host.store'
|
||||
import { UiCardTitleLevel } from '@/types/enums'
|
||||
import { IK_HOST_STATS } from '@/types/injection-keys'
|
||||
import type { StatData } from '@/types/stat'
|
||||
import VtsProgressBarGroup from '@core/components/progress-bar-group/VtsProgressBarGroup.vue'
|
||||
import VtsStateHero from '@core/components/state-hero/VtsStateHero.vue'
|
||||
import { computed, inject } from 'vue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
|
||||
@@ -48,7 +48,8 @@ const data = computed<StatData[]>(() => {
|
||||
result.push({
|
||||
id: stat.id,
|
||||
label: stat.name,
|
||||
value: avgCpuUsage,
|
||||
current: avgCpuUsage,
|
||||
total: 100,
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
@@ -4,22 +4,26 @@
|
||||
<UiCardTitle :level="UiCardTitleLevel.Subtitle">
|
||||
{{ t('last-week') }}
|
||||
</UiCardTitle>
|
||||
<NoDataError v-if="hasError" />
|
||||
<UiCardSpinner v-else-if="isLoading" />
|
||||
<VtsStateHero v-if="isLoading" format="card" busy size="medium" />
|
||||
<VtsStateHero v-else-if="hasError" format="card" type="error" size="medium">
|
||||
{{ t('error-no-data') }}
|
||||
</VtsStateHero>
|
||||
<VtsStateHero v-else-if="data.length === 0" format="card" type="no-data" size="medium">
|
||||
{{ t('no-data-to-calculate') }}
|
||||
</VtsStateHero>
|
||||
<VtsLinearChart v-else :data :max-value="customMaxValue" :value-formatter="customValueFormatter" />
|
||||
</UiCard>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import NoDataError from '@/components/NoDataError.vue'
|
||||
import UiCard from '@/components/ui/UiCard.vue'
|
||||
import UiCardSpinner from '@/components/ui/UiCardSpinner.vue'
|
||||
import UiCardTitle from '@/components/ui/UiCardTitle.vue'
|
||||
import { RRD_STEP_FROM_STRING } from '@/libs/xapi-stats'
|
||||
import { useHostStore } from '@/stores/xen-api/host.store'
|
||||
import { UiCardTitleLevel } from '@/types/enums'
|
||||
import { IK_HOST_LAST_WEEK_STATS } from '@/types/injection-keys'
|
||||
import type { LinearChartData, ValueFormatter } from '@core/types/chart'
|
||||
import VtsStateHero from '@core/components/state-hero/VtsStateHero.vue'
|
||||
import type { XapiHostStatsRaw } from '@vates/types/common'
|
||||
import { sumBy } from 'lodash-es'
|
||||
import { computed, defineAsyncComponent, inject } from 'vue'
|
||||
|
||||
@@ -4,18 +4,16 @@
|
||||
:level="UiCardTitleLevel.SubtitleWithUnderline"
|
||||
:right="t('top-#', { n: N_ITEMS })"
|
||||
/>
|
||||
<NoDataError v-if="hasError" />
|
||||
<UiCardSpinner v-else-if="isLoading" />
|
||||
<NoResult v-else-if="isStatEmpty" />
|
||||
<UsageBar v-else :data :n-items="N_ITEMS" />
|
||||
<VtsStateHero v-if="isLoading" format="card" busy size="medium" />
|
||||
<VtsStateHero v-else-if="hasError" format="card" type="error" size="medium">{{ t('error-no-data') }}</VtsStateHero>
|
||||
<VtsStateHero v-else-if="isStatEmpty" format="card" type="no-data" size="medium">
|
||||
{{ t('no-data-to-calculate') }}
|
||||
</VtsStateHero>
|
||||
<VtsProgressBarGroup v-else :items="data" :n-items="N_ITEMS" legend-type="percent" />
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import NoDataError from '@/components/NoDataError.vue'
|
||||
import NoResult from '@/components/NoResult.vue'
|
||||
import UiCardSpinner from '@/components/ui/UiCardSpinner.vue'
|
||||
import UiCardTitle from '@/components/ui/UiCardTitle.vue'
|
||||
import UsageBar from '@/components/UsageBar.vue'
|
||||
import { useStatStatus } from '@/composables/stat-status.composable'
|
||||
import { getAvgCpuUsage } from '@/libs/utils'
|
||||
import { N_ITEMS } from '@/pages/pool/[uuid]/dashboard.vue'
|
||||
@@ -23,6 +21,8 @@ import { useVmStore } from '@/stores/xen-api/vm.store'
|
||||
import { UiCardTitleLevel } from '@/types/enums'
|
||||
import { IK_VM_STATS } from '@/types/injection-keys'
|
||||
import type { StatData } from '@/types/stat'
|
||||
import VtsProgressBarGroup from '@core/components/progress-bar-group/VtsProgressBarGroup.vue'
|
||||
import VtsStateHero from '@core/components/state-hero/VtsStateHero.vue'
|
||||
import { computed, inject } from 'vue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
|
||||
@@ -52,7 +52,8 @@ const data = computed<StatData[]>(() => {
|
||||
result.push({
|
||||
id: stat.id,
|
||||
label: stat.name,
|
||||
value: avgCpuUsage,
|
||||
current: avgCpuUsage,
|
||||
total: 100,
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
@@ -1,24 +1,24 @@
|
||||
<template>
|
||||
<UiCardTitle :left="t('hosts')" :level="UiCardTitleLevel.SubtitleWithUnderline" :right="t('top-#', { n: N_ITEMS })" />
|
||||
<NoDataError v-if="hasError" />
|
||||
<UiCardSpinner v-else-if="isLoading" />
|
||||
<NoResult v-else-if="isStatEmpty" />
|
||||
<UsageBar v-else :data :n-items="N_ITEMS" />
|
||||
<VtsStateHero v-if="hasError" format="card" type="error" size="medium">{{ t('error-no-data') }}</VtsStateHero>
|
||||
<VtsStateHero v-else-if="isLoading" format="card" busy size="medium" />
|
||||
<VtsStateHero v-else-if="isStatEmpty" format="card" type="no-data" size="medium">
|
||||
{{ t('no-data-to-calculate') }}
|
||||
</VtsStateHero>
|
||||
<VtsProgressBarGroup v-else :items="data" :n-items="N_ITEMS" legend-type="bytes-with-total" />
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import NoDataError from '@/components/NoDataError.vue'
|
||||
import NoResult from '@/components/NoResult.vue'
|
||||
import UiCardSpinner from '@/components/ui/UiCardSpinner.vue'
|
||||
import UiCardTitle from '@/components/ui/UiCardTitle.vue'
|
||||
import UsageBar from '@/components/UsageBar.vue'
|
||||
import { useStatStatus } from '@/composables/stat-status.composable'
|
||||
import { formatSize, parseRamUsage } from '@/libs/utils'
|
||||
import { parseRamUsage } from '@/libs/utils'
|
||||
import { N_ITEMS } from '@/pages/pool/[uuid]/dashboard.vue'
|
||||
import { useHostStore } from '@/stores/xen-api/host.store'
|
||||
import { UiCardTitleLevel } from '@/types/enums'
|
||||
import { IK_HOST_STATS } from '@/types/injection-keys'
|
||||
import type { StatData } from '@/types/stat'
|
||||
import VtsProgressBarGroup from '@core/components/progress-bar-group/VtsProgressBarGroup.vue'
|
||||
import VtsStateHero from '@core/components/state-hero/VtsStateHero.vue'
|
||||
import { computed, inject } from 'vue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
|
||||
@@ -39,12 +39,12 @@ const data = computed(() => {
|
||||
return
|
||||
}
|
||||
|
||||
const { percentUsed, total, used } = parseRamUsage(stat.stats)
|
||||
const { total, used } = parseRamUsage(stat.stats)
|
||||
result.push({
|
||||
id: stat.id,
|
||||
label: stat.name,
|
||||
value: percentUsed,
|
||||
badgeLabel: `${formatSize(used)}/${formatSize(total)}`,
|
||||
current: used,
|
||||
total,
|
||||
})
|
||||
})
|
||||
return result
|
||||
|
||||
@@ -4,18 +4,21 @@
|
||||
<UiCardTitle :level="UiCardTitleLevel.Subtitle">
|
||||
{{ t('last-week') }}
|
||||
</UiCardTitle>
|
||||
<NoDataError v-if="hasError" />
|
||||
<UiCardSpinner v-else-if="isLoading" />
|
||||
<VtsStateHero v-if="isLoading" format="card" busy size="medium" />
|
||||
<VtsStateHero v-else-if="hasError" format="card" type="error" size="medium">
|
||||
{{ t('error-no-data') }}
|
||||
</VtsStateHero>
|
||||
<VtsStateHero v-else-if="data.length === 0" format="card" type="no-data" size="medium">
|
||||
{{ t('no-data-to-calculate') }}
|
||||
</VtsStateHero>
|
||||
<VtsLinearChart v-else :data :max-value="customMaxValue" :value-formatter="customValueFormatter" />
|
||||
<SizeStatsSummary :size="currentData.size" :usage="currentData.usage" />
|
||||
</UiCard>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import NoDataError from '@/components/NoDataError.vue'
|
||||
import SizeStatsSummary from '@/components/ui/SizeStatsSummary.vue'
|
||||
import UiCard from '@/components/ui/UiCard.vue'
|
||||
import UiCardSpinner from '@/components/ui/UiCardSpinner.vue'
|
||||
import UiCardTitle from '@/components/ui/UiCardTitle.vue'
|
||||
import { formatSize } from '@/libs/utils'
|
||||
import { RRD_STEP_FROM_STRING } from '@/libs/xapi-stats'
|
||||
@@ -24,6 +27,7 @@ import { useHostStore } from '@/stores/xen-api/host.store'
|
||||
import { UiCardTitleLevel } from '@/types/enums'
|
||||
import { IK_HOST_LAST_WEEK_STATS } from '@/types/injection-keys'
|
||||
import type { LinearChartData } from '@core/types/chart'
|
||||
import VtsStateHero from '@core/components/state-hero/VtsStateHero.vue'
|
||||
import { sumBy } from 'lodash-es'
|
||||
import { computed, defineAsyncComponent, inject } from 'vue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
@@ -4,25 +4,25 @@
|
||||
:level="UiCardTitleLevel.SubtitleWithUnderline"
|
||||
:right="t('top-#', { n: N_ITEMS })"
|
||||
/>
|
||||
<NoDataError v-if="hasError" />
|
||||
<UiCardSpinner v-else-if="isLoading" />
|
||||
<NoResult v-else-if="isStatEmpty" />
|
||||
<UsageBar v-else :data :n-items="N_ITEMS" />
|
||||
<VtsStateHero v-if="hasError" format="card" type="error" size="medium">{{ t('error-no-data') }}</VtsStateHero>
|
||||
<VtsStateHero v-else-if="isLoading" format="card" busy size="medium" />
|
||||
<VtsStateHero v-else-if="isStatEmpty" format="card" type="no-data" size="medium">
|
||||
{{ t('no-data-to-calculate') }}
|
||||
</VtsStateHero>
|
||||
<VtsProgressBarGroup v-else :items="data" :n-items="N_ITEMS" legend-type="bytes-with-total" />
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import NoDataError from '@/components/NoDataError.vue'
|
||||
import NoResult from '@/components/NoResult.vue'
|
||||
import UiCardSpinner from '@/components/ui/UiCardSpinner.vue'
|
||||
import UiCardTitle from '@/components/ui/UiCardTitle.vue'
|
||||
import UsageBar from '@/components/UsageBar.vue'
|
||||
import { useStatStatus } from '@/composables/stat-status.composable'
|
||||
import { formatSize, parseRamUsage } from '@/libs/utils'
|
||||
import { parseRamUsage } from '@/libs/utils'
|
||||
import { N_ITEMS } from '@/pages/pool/[uuid]/dashboard.vue'
|
||||
import { useVmStore } from '@/stores/xen-api/vm.store'
|
||||
import { UiCardTitleLevel } from '@/types/enums'
|
||||
import { IK_VM_STATS } from '@/types/injection-keys'
|
||||
import type { StatData } from '@/types/stat'
|
||||
import VtsProgressBarGroup from '@core/components/progress-bar-group/VtsProgressBarGroup.vue'
|
||||
import VtsStateHero from '@core/components/state-hero/VtsStateHero.vue'
|
||||
import { computed, inject } from 'vue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
|
||||
@@ -43,12 +43,13 @@ const data = computed(() => {
|
||||
return
|
||||
}
|
||||
|
||||
const { percentUsed, total, used } = parseRamUsage(stat.stats)
|
||||
const { total, used } = parseRamUsage(stat.stats)
|
||||
|
||||
result.push({
|
||||
id: stat.id,
|
||||
label: stat.name,
|
||||
value: percentUsed,
|
||||
badgeLabel: `${formatSize(used)}/${formatSize(total)}`,
|
||||
current: used,
|
||||
total,
|
||||
})
|
||||
})
|
||||
return result
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<UiButton
|
||||
v-tooltip="t('coming-soon')"
|
||||
disabled
|
||||
:left-icon="faPlus"
|
||||
left-icon="fa:plus"
|
||||
variant="secondary"
|
||||
accent="brand"
|
||||
size="medium"
|
||||
@@ -22,7 +22,7 @@
|
||||
<UiButton
|
||||
v-tooltip="t('coming-soon')"
|
||||
disabled
|
||||
:left-icon="faEdit"
|
||||
left-icon="fa:edit"
|
||||
variant="tertiary"
|
||||
accent="brand"
|
||||
size="medium"
|
||||
@@ -32,7 +32,7 @@
|
||||
<UiButton
|
||||
v-tooltip="t('coming-soon')"
|
||||
disabled
|
||||
:left-icon="faTrash"
|
||||
left-icon="fa:trash"
|
||||
variant="tertiary"
|
||||
accent="danger"
|
||||
size="medium"
|
||||
@@ -58,11 +58,11 @@
|
||||
</div>
|
||||
</th>
|
||||
<th v-else-if="column.id === 'more'" class="more">
|
||||
<UiButtonIcon v-tooltip="t('coming-soon')" :icon="faEllipsis" accent="brand" disabled size="small" />
|
||||
<UiButtonIcon v-tooltip="t('coming-soon')" icon="fa:ellipsis" accent="brand" disabled size="small" />
|
||||
</th>
|
||||
<th v-else>
|
||||
<div v-tooltip class="text-ellipsis">
|
||||
<VtsIcon accent="brand" :icon="headerIcon[column.id]" />
|
||||
<VtsIcon :name="headerIcon[column.id]" size="medium" />
|
||||
{{ column.label }}
|
||||
</div>
|
||||
</th>
|
||||
@@ -88,7 +88,7 @@
|
||||
<UiButtonIcon
|
||||
v-else-if="column.id === 'more'"
|
||||
v-tooltip="t('coming-soon')"
|
||||
:icon="faEllipsis"
|
||||
icon="fa:ellipsis"
|
||||
accent="brand"
|
||||
disabled
|
||||
size="small"
|
||||
@@ -100,7 +100,7 @@
|
||||
</tr>
|
||||
</template>
|
||||
</VtsDataTable>
|
||||
<VtsStateHero v-if="searchQuery && filteredNetworks.length === 0" type="table" image="no-result">
|
||||
<VtsStateHero v-if="searchQuery && filteredNetworks.length === 0" format="table" type="no-result" size="small">
|
||||
<div>{{ t('no-result') }}</div>
|
||||
</VtsStateHero>
|
||||
<UiTopBottomTable :selected-items="0" :total-items="0" @toggle-select-all="toggleSelect">
|
||||
@@ -114,6 +114,7 @@
|
||||
import useMultiSelect from '@/composables/multi-select.composable'
|
||||
import type { XenApiNetwork } from '@/libs/xen-api/xen-api.types'
|
||||
import { useNetworkStore } from '@/stores/xen-api/network.store'
|
||||
import type { IconName } from '@core/icons'
|
||||
import VtsDataTable from '@core/components/data-table/VtsDataTable.vue'
|
||||
import VtsIcon from '@core/components/icon/VtsIcon.vue'
|
||||
import VtsStateHero from '@core/components/state-hero/VtsStateHero.vue'
|
||||
@@ -129,16 +130,6 @@ import { usePagination } from '@core/composables/pagination.composable'
|
||||
import { useRouteQuery } from '@core/composables/route-query.composable'
|
||||
import { useTable } from '@core/composables/table.composable'
|
||||
import { vTooltip } from '@core/directives/tooltip.directive'
|
||||
import type { IconDefinition } from '@fortawesome/fontawesome-common-types'
|
||||
import {
|
||||
faAlignLeft,
|
||||
faCaretDown,
|
||||
faEdit,
|
||||
faEllipsis,
|
||||
faHashtag,
|
||||
faPlus,
|
||||
faTrash,
|
||||
} from '@fortawesome/free-solid-svg-icons'
|
||||
import { noop } from '@vueuse/shared'
|
||||
import { computed, ref } from 'vue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
@@ -195,11 +186,11 @@ const { pageRecords: networksRecords, paginationBindings } = usePagination('inte
|
||||
|
||||
type NetworkHeader = 'name_label' | 'name_description' | 'MTU' | 'default_locking_mode'
|
||||
|
||||
const headerIcon: Record<NetworkHeader, IconDefinition> = {
|
||||
name_label: faAlignLeft,
|
||||
name_description: faAlignLeft,
|
||||
MTU: faHashtag,
|
||||
default_locking_mode: faCaretDown,
|
||||
const headerIcon: Record<NetworkHeader, IconName> = {
|
||||
name_label: 'fa:align-left',
|
||||
name_description: 'fa:align-left',
|
||||
MTU: 'fa:hashtag',
|
||||
default_locking_mode: 'fa:caret-down',
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
size="medium"
|
||||
variant="tertiary"
|
||||
accent="brand"
|
||||
:icon="faAngleLeft"
|
||||
icon="fa:angle-left"
|
||||
@click="emit('close')"
|
||||
/>
|
||||
<div class="action-buttons">
|
||||
@@ -18,7 +18,7 @@
|
||||
size="medium"
|
||||
variant="tertiary"
|
||||
accent="brand"
|
||||
:left-icon="faEdit"
|
||||
left-icon="fa:edit"
|
||||
>
|
||||
{{ t('edit') }}
|
||||
</UiButton>
|
||||
@@ -28,11 +28,11 @@
|
||||
size="medium"
|
||||
variant="tertiary"
|
||||
accent="danger"
|
||||
:left-icon="faTrash"
|
||||
left-icon="fa:trash"
|
||||
>
|
||||
{{ t('delete') }}
|
||||
</UiButton>
|
||||
<UiButtonIcon v-tooltip="t('coming-soon')" disabled accent="brand" size="medium" :icon="faEllipsis" />
|
||||
<UiButtonIcon v-tooltip="t('coming-soon')" disabled accent="brand" size="medium" icon="fa:ellipsis" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -138,7 +138,6 @@ import UiCounter from '@core/components/ui/counter/UiCounter.vue'
|
||||
import UiPanel from '@core/components/ui/panel/UiPanel.vue'
|
||||
import { vTooltip } from '@core/directives/tooltip.directive'
|
||||
import { useUiStore } from '@core/stores/ui.store.ts'
|
||||
import { faAngleLeft, faEdit, faEllipsis, faTrash } from '@fortawesome/free-solid-svg-icons'
|
||||
import { computed } from 'vue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
<UiButton
|
||||
v-tooltip="t('coming-soon')"
|
||||
disabled
|
||||
:left-icon="faEdit"
|
||||
left-icon="fa:edit"
|
||||
variant="tertiary"
|
||||
accent="brand"
|
||||
size="medium"
|
||||
@@ -25,7 +25,7 @@
|
||||
<UiButton
|
||||
v-tooltip="t('coming-soon')"
|
||||
disabled
|
||||
:left-icon="faCopy"
|
||||
left-icon="fa:copy"
|
||||
variant="tertiary"
|
||||
accent="brand"
|
||||
size="medium"
|
||||
@@ -35,7 +35,7 @@
|
||||
<UiButton
|
||||
v-tooltip="t('coming-soon')"
|
||||
disabled
|
||||
:left-icon="faTrash"
|
||||
left-icon="fa:trash"
|
||||
variant="tertiary"
|
||||
accent="danger"
|
||||
size="medium"
|
||||
@@ -61,11 +61,11 @@
|
||||
</div>
|
||||
</th>
|
||||
<th v-else-if="column.id === 'more'" class="more">
|
||||
<UiButtonIcon v-tooltip="t('coming-soon')" :icon="faEllipsis" accent="brand" disabled size="small" />
|
||||
<UiButtonIcon v-tooltip="t('coming-soon')" icon="fa:ellipsis" accent="brand" disabled size="small" />
|
||||
</th>
|
||||
<th v-else>
|
||||
<div v-tooltip class="text-ellipsis">
|
||||
<VtsIcon accent="brand" :icon="headerIcon[column.id]" />
|
||||
<VtsIcon :name="headerIcon[column.id]" size="medium" />
|
||||
{{ column.label }}
|
||||
</div>
|
||||
</th>
|
||||
@@ -91,7 +91,7 @@
|
||||
<UiButtonIcon
|
||||
v-else-if="column.id === 'more'"
|
||||
v-tooltip="t('coming-soon')"
|
||||
:icon="faEllipsis"
|
||||
icon="fa:ellipsis"
|
||||
accent="brand"
|
||||
disabled
|
||||
size="small"
|
||||
@@ -104,7 +104,7 @@
|
||||
</tr>
|
||||
</template>
|
||||
</VtsDataTable>
|
||||
<VtsStateHero v-if="searchQuery && filteredNetworks.length === 0" type="table" image="no-result">
|
||||
<VtsStateHero v-if="searchQuery && filteredNetworks.length === 0" format="table" type="no-result" size="small">
|
||||
<div>{{ t('no-result') }}</div>
|
||||
</VtsStateHero>
|
||||
<UiTopBottomTable :selected-items="0" :total-items="0" @toggle-select-all="toggleSelect">
|
||||
@@ -120,6 +120,7 @@ import type { XenApiNetwork } from '@/libs/xen-api/xen-api.types'
|
||||
import { useNetworkStore } from '@/stores/xen-api/network.store'
|
||||
import { usePifMetricsStore } from '@/stores/xen-api/pif-metrics.store'
|
||||
import { usePifStore } from '@/stores/xen-api/pif.store'
|
||||
import type { IconName } from '@core/icons'
|
||||
import VtsConnectionStatus from '@core/components/connection-status/VtsConnectionStatus.vue'
|
||||
import VtsDataTable from '@core/components/data-table/VtsDataTable.vue'
|
||||
import VtsIcon from '@core/components/icon/VtsIcon.vue'
|
||||
@@ -137,17 +138,6 @@ import { usePagination } from '@core/composables/pagination.composable'
|
||||
import { useRouteQuery } from '@core/composables/route-query.composable'
|
||||
import { useTable } from '@core/composables/table.composable'
|
||||
import { vTooltip } from '@core/directives/tooltip.directive'
|
||||
import type { IconDefinition } from '@fortawesome/fontawesome-common-types'
|
||||
import {
|
||||
faAlignLeft,
|
||||
faCaretDown,
|
||||
faCopy,
|
||||
faEdit,
|
||||
faEllipsis,
|
||||
faHashtag,
|
||||
faPowerOff,
|
||||
faTrash,
|
||||
} from '@fortawesome/free-solid-svg-icons'
|
||||
import { noop } from '@vueuse/shared'
|
||||
import { computed, ref } from 'vue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
@@ -235,13 +225,13 @@ const { pageRecords: networksRecords, paginationBindings } = usePagination('netw
|
||||
|
||||
type NetworkHeader = 'name_label' | 'name_description' | 'status' | 'vlan' | 'MTU' | 'default_locking_mode'
|
||||
|
||||
const headerIcon: Record<NetworkHeader, IconDefinition> = {
|
||||
name_label: faAlignLeft,
|
||||
name_description: faAlignLeft,
|
||||
status: faPowerOff,
|
||||
vlan: faAlignLeft,
|
||||
MTU: faHashtag,
|
||||
default_locking_mode: faCaretDown,
|
||||
const headerIcon: Record<NetworkHeader, IconName> = {
|
||||
name_label: 'fa:align-left',
|
||||
name_description: 'fa:align-left',
|
||||
status: 'fa:power-off',
|
||||
vlan: 'fa:align-left',
|
||||
MTU: 'fa:hashtag',
|
||||
default_locking_mode: 'fa:caret-down',
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@@ -3,11 +3,11 @@
|
||||
<UiTitle>
|
||||
{{ t('pool-management') }}
|
||||
</UiTitle>
|
||||
<VtsLoadingHero v-if="!isReady" type="card" />
|
||||
<VtsStateHero v-if="!isReady" format="card" busy size="medium" />
|
||||
<template v-else>
|
||||
<VtsQuickInfoRow :label="t('master')">
|
||||
<template #value>
|
||||
<UiLink v-if="masterHost" :icon="faServer" :to="`/host/${masterHost.uuid}/`" size="medium">
|
||||
<UiLink v-if="masterHost" icon="fa:server" :to="`/host/${masterHost.uuid}/`" size="medium">
|
||||
{{ masterHost.name_label }}
|
||||
</UiLink>
|
||||
<template v-else>
|
||||
@@ -39,11 +39,10 @@ import type { XenApiPool } from '@/libs/xen-api/xen-api.types'
|
||||
import { usePoolStore } from '@/stores/xen-api/pool.store'
|
||||
import VtsEnabledState from '@core/components/enabled-state/VtsEnabledState.vue'
|
||||
import VtsQuickInfoRow from '@core/components/quick-info-row/VtsQuickInfoRow.vue'
|
||||
import VtsLoadingHero from '@core/components/state-hero/VtsLoadingHero.vue'
|
||||
import VtsStateHero from '@core/components/state-hero/VtsStateHero.vue'
|
||||
import UiCard from '@core/components/ui/card/UiCard.vue'
|
||||
import UiLink from '@core/components/ui/link/UiLink.vue'
|
||||
import UiTitle from '@core/components/ui/title/UiTitle.vue'
|
||||
import { faServer } from '@fortawesome/free-solid-svg-icons'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
|
||||
defineProps<{
|
||||
|
||||
@@ -3,14 +3,14 @@
|
||||
<UiTitle>
|
||||
{{ t('networking') }}
|
||||
</UiTitle>
|
||||
<VtsLoadingHero v-if="!isReady" type="card" :title="t('networking')" />
|
||||
<VtsStateHero v-if="!isReady" format="card" busy size="medium" />
|
||||
<template v-else>
|
||||
<VtsQuickInfoRow :label="t('backup-network')">
|
||||
<template #value>
|
||||
<UiLink
|
||||
v-if="backupNetwork !== undefined"
|
||||
:to="`/pool/${pool.uuid}/network?id=${backupNetwork.uuid}`"
|
||||
:icon="faNetworkWired"
|
||||
icon="fa:network-wired"
|
||||
size="medium"
|
||||
>
|
||||
{{ backupNetwork.name_label }}
|
||||
@@ -28,11 +28,10 @@
|
||||
import type { XenApiNetwork, XenApiPool } from '@/libs/xen-api/xen-api.types'
|
||||
import { useNetworkStore } from '@/stores/xen-api/network.store'
|
||||
import VtsQuickInfoRow from '@core/components/quick-info-row/VtsQuickInfoRow.vue'
|
||||
import VtsLoadingHero from '@core/components/state-hero/VtsLoadingHero.vue'
|
||||
import VtsStateHero from '@core/components/state-hero/VtsStateHero.vue'
|
||||
import UiCard from '@core/components/ui/card/UiCard.vue'
|
||||
import UiLink from '@core/components/ui/link/UiLink.vue'
|
||||
import UiTitle from '@core/components/ui/title/UiTitle.vue'
|
||||
import { faNetworkWired } from '@fortawesome/free-solid-svg-icons'
|
||||
import { computed } from 'vue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
|
||||
|
||||
@@ -3,12 +3,12 @@
|
||||
<UiTitle>
|
||||
{{ t('storage-configuration') }}
|
||||
</UiTitle>
|
||||
<VtsLoadingHero v-if="!isReady" type="card" :title="t('storage-configuration')" />
|
||||
<VtsStateHero v-if="!isReady" format="card" busy size="medium" />
|
||||
<template v-else>
|
||||
<VtsQuickInfoRow :label="t('default-storage-repository')">
|
||||
<template #value>
|
||||
<template v-if="defaultSr">
|
||||
<VtsIcon :icon="faDatabase" accent="current" />
|
||||
<VtsIcon name="fa:database" size="medium" />
|
||||
{{ defaultSr.name_label }}
|
||||
</template>
|
||||
<template v-else>
|
||||
@@ -19,7 +19,7 @@
|
||||
<VtsQuickInfoRow :label="t('suspend-storage-repository')">
|
||||
<template #value>
|
||||
<template v-if="suspendSr">
|
||||
<VtsIcon :icon="faDatabase" accent="current" />
|
||||
<VtsIcon name="fa:database" size="medium" />
|
||||
{{ suspendSr.name_label }}
|
||||
</template>
|
||||
<template v-else>
|
||||
@@ -30,7 +30,7 @@
|
||||
<VtsQuickInfoRow :label="t('crash-dump-storage-repository')">
|
||||
<template #value>
|
||||
<template v-if="crashDumpSr">
|
||||
<VtsIcon :icon="faDatabase" accent="current" />
|
||||
<VtsIcon name="fa:database" size="medium" />
|
||||
{{ crashDumpSr.name_label }}
|
||||
</template>
|
||||
<template v-else>
|
||||
@@ -42,7 +42,7 @@
|
||||
<template #value>
|
||||
<ul v-if="haSrs !== undefined && haSrs.length > 0">
|
||||
<li v-for="haSr in haSrs" :key="haSr.uuid">
|
||||
<VtsIcon :icon="faDatabase" accent="current" />
|
||||
<VtsIcon name="fa:database" size="medium" />
|
||||
{{ haSr.name_label }}
|
||||
</li>
|
||||
</ul>
|
||||
@@ -61,10 +61,9 @@ import { useSrStore } from '@/stores/xen-api/sr.store'
|
||||
import { useVdiStore } from '@/stores/xen-api/vdi.store'
|
||||
import VtsIcon from '@core/components/icon/VtsIcon.vue'
|
||||
import VtsQuickInfoRow from '@core/components/quick-info-row/VtsQuickInfoRow.vue'
|
||||
import VtsLoadingHero from '@core/components/state-hero/VtsLoadingHero.vue'
|
||||
import VtsStateHero from '@core/components/state-hero/VtsStateHero.vue'
|
||||
import UiCard from '@core/components/ui/card/UiCard.vue'
|
||||
import UiTitle from '@core/components/ui/title/UiTitle.vue'
|
||||
import { faDatabase } from '@fortawesome/free-solid-svg-icons'
|
||||
import { computed } from 'vue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
</RouterLink>
|
||||
</td>
|
||||
<td>
|
||||
<UiProgressBar v-if="isPending" :max-value="1" :value="task.progress" />
|
||||
<UiProgressBar v-if="isPending" :fill-width accent="info" />
|
||||
</td>
|
||||
<td>
|
||||
<RelativeTime v-if="isPending" :date="createdAt" />
|
||||
@@ -30,29 +30,32 @@
|
||||
|
||||
<script lang="ts" setup>
|
||||
import RelativeTime from '@/components/RelativeTime.vue'
|
||||
import UiProgressBar from '@/components/ui/progress/UiProgressBar.vue'
|
||||
import { parseDateTime } from '@/libs/utils'
|
||||
import type { XenApiTask } from '@/libs/xen-api/xen-api.types'
|
||||
import { useHostStore } from '@/stores/xen-api/host.store'
|
||||
import UiProgressBar from '@core/components/ui/progress-bar/UiProgressBar.vue'
|
||||
import { useProgress } from '@core/packages/progress/use-progress.ts'
|
||||
import { computed } from 'vue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
|
||||
const props = defineProps<{
|
||||
const { task, isPending } = defineProps<{
|
||||
isPending?: boolean
|
||||
task: XenApiTask
|
||||
}>()
|
||||
|
||||
const { fillWidth } = useProgress(() => task.progress, 1)
|
||||
|
||||
const { d } = useI18n()
|
||||
|
||||
const { getByOpaqueRef: getHost } = useHostStore().subscribe()
|
||||
|
||||
const createdAt = computed(() => parseDateTime(props.task.created))
|
||||
const createdAt = computed(() => parseDateTime(task.created))
|
||||
|
||||
const host = computed(() => getHost(props.task.resident_on))
|
||||
const host = computed(() => getHost(task.resident_on))
|
||||
|
||||
const estimatedEndAt = computed(() => createdAt.value + (new Date().getTime() - createdAt.value) / props.task.progress)
|
||||
const estimatedEndAt = computed(() => createdAt.value + (new Date().getTime() - createdAt.value) / task.progress)
|
||||
|
||||
const finishedAt = computed(() => (props.isPending ? undefined : parseDateTime(props.task.finished)))
|
||||
const finishedAt = computed(() => (isPending ? undefined : parseDateTime(task.finished)))
|
||||
</script>
|
||||
|
||||
<style lang="postcss" scoped>
|
||||
|
||||
@@ -10,20 +10,20 @@
|
||||
class="ui-action-button"
|
||||
type="button"
|
||||
>
|
||||
<UiIcon :busy :icon />
|
||||
<VtsIcon :busy :name="icon" size="medium" />
|
||||
<slot />
|
||||
</button>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import UiIcon from '@/components/ui/icon/UiIcon.vue'
|
||||
import type { IconName } from '@core/icons'
|
||||
import VtsIcon from '@core/components/icon/VtsIcon.vue'
|
||||
import { useDisabled } from '@core/composables/disabled.composable'
|
||||
import type { IconDefinition } from '@fortawesome/fontawesome-common-types'
|
||||
|
||||
const props = defineProps<{
|
||||
busy?: boolean
|
||||
disabled?: boolean
|
||||
icon?: IconDefinition
|
||||
icon?: IconName
|
||||
active?: boolean
|
||||
}>()
|
||||
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
<template>
|
||||
<span class="ui-badge typo-body-bold-small">
|
||||
<UiIcon :icon />
|
||||
<VtsIcon :name="icon" size="medium" />
|
||||
<slot />
|
||||
</span>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import UiIcon from '@/components/ui/icon/UiIcon.vue'
|
||||
import type { IconDefinition } from '@fortawesome/fontawesome-common-types'
|
||||
import type { IconName } from '@core/icons'
|
||||
import VtsIcon from '@core/components/icon/VtsIcon.vue'
|
||||
|
||||
defineProps<{
|
||||
icon?: IconDefinition
|
||||
icon?: IconName
|
||||
}>()
|
||||
</script>
|
||||
|
||||
|
||||
@@ -4,14 +4,13 @@
|
||||
<slot />
|
||||
</span>
|
||||
<span class="remove" @click.stop="emit('remove')">
|
||||
<UiIcon :icon="faRemove" />
|
||||
<VtsIcon name="fa:remove" size="medium" />
|
||||
</span>
|
||||
</span>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import UiIcon from '@/components/ui/icon/UiIcon.vue'
|
||||
import { faRemove } from '@fortawesome/free-solid-svg-icons'
|
||||
import VtsIcon from '@core/components/icon/VtsIcon.vue'
|
||||
|
||||
const emit = defineEmits<{
|
||||
edit: []
|
||||
|
||||
@@ -1,43 +0,0 @@
|
||||
<template>
|
||||
<div class="ui-status-panel">
|
||||
<img :src="imageSource" alt="" class="image" />
|
||||
<p v-if="title !== undefined" class="title typo-h2">{{ title }}</p>
|
||||
<p v-if="subtitle !== undefined" class="subtitle typo-h3">{{ subtitle }}</p>
|
||||
<slot />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
defineProps<{
|
||||
imageSource: string
|
||||
title?: string
|
||||
subtitle?: string
|
||||
}>()
|
||||
</script>
|
||||
|
||||
<style lang="postcss" scoped>
|
||||
.ui-status-panel {
|
||||
width: 100%;
|
||||
min-height: 76.5vh;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
color: var(--color-brand-txt-base);
|
||||
}
|
||||
|
||||
.title {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.subtitle {
|
||||
margin: 21px 0;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.image {
|
||||
margin-bottom: 40px;
|
||||
width: 30%;
|
||||
}
|
||||
</style>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user