mirror of
https://github.com/vatesfr/xen-orchestra.git
synced 2026-11-30 10:48:06 -06:00
Compare commits
8 Commits
docs/incre
...
rest-api/p
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
23a121e285 | ||
|
|
2a678eb6d6 | ||
|
|
b237144bb5 | ||
|
|
ed8cc840f8 | ||
|
|
33b20e6876 | ||
|
|
918ef1198a | ||
|
|
acefda0a7b | ||
|
|
a890cdf73d |
@@ -13,7 +13,7 @@
|
||||
"url": "https://vates.fr"
|
||||
},
|
||||
"license": "ISC",
|
||||
"version": "3.7.2",
|
||||
"version": "3.7.1",
|
||||
"engines": {
|
||||
"node": ">=14.0"
|
||||
},
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@vates/types",
|
||||
"private": false,
|
||||
"version": "3.1.0",
|
||||
"version": "3.0.0",
|
||||
"main": "./dist/index.mjs",
|
||||
"exports": {
|
||||
".": {
|
||||
|
||||
@@ -822,16 +822,3 @@ export type RPU_RECOVERY_STEP_NAME = (typeof RPU_RECOVERY_STEP_NAMES)[number]
|
||||
export const COMMON_TAG = {
|
||||
NOBAK: 'xo:no-bak',
|
||||
} as const
|
||||
|
||||
/**
|
||||
* a package of the XO appliance with another version available
|
||||
*
|
||||
* Returned by `xoa-updater` as `upgradablePackages` at the end of an update check.
|
||||
*/
|
||||
export type XoaPackageUpdate = {
|
||||
name: string
|
||||
/** version which will be installed */
|
||||
version: string
|
||||
/** undefined: the package is not installed yet */
|
||||
installedVersion?: string
|
||||
}
|
||||
|
||||
@@ -462,7 +462,6 @@ export interface Xapi {
|
||||
stream: Readable | Buffer,
|
||||
opts: { signal?: AbortSignal; format: SUPPORTED_VDI_FORMAT }
|
||||
): Promise<void>
|
||||
VDI_resize(vdiRef: XenApiVdi['$ref'], size: number): Promise<void>
|
||||
VIF_create(
|
||||
options: {
|
||||
currently_attached?: boolean
|
||||
|
||||
@@ -760,6 +760,8 @@ export type XoApp = EventEmitter & {
|
||||
url?: string
|
||||
}
|
||||
): Promise<XoBackupRepository>
|
||||
/** Throw if backup jobs are running on the proxy, unless ignored; `force` reboots the proxy VM */
|
||||
upgradeProxyAppliance(id: XoProxy['id'], opts: { force?: boolean; ignoreRunningJobs?: boolean }): Promise<void>
|
||||
getAllXapis(): Record<string, Xapi>
|
||||
getObjects(opts?: { filter?: Record<string, unknown>; limit?: number }): Record<string, XapiXoRecord>
|
||||
getLicenses(params?: { productType?: LicenseProductType }): Promise<License[]>
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@eslint/js": "^9.19.0",
|
||||
"@vates/types": "^3.1.0",
|
||||
"@vates/types": "^3.0.0",
|
||||
"rimraf": "^6.0.1",
|
||||
"typescript": "~5.6",
|
||||
"typescript-eslint": "^8.61.0"
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
export default {
|
||||
read: true,
|
||||
upgrade: true,
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
"tar-stream": "^3.1.8",
|
||||
"@types/tar-stream": "^3.1.4",
|
||||
"tmp": "^0.2.1",
|
||||
"@vates/types": "^3.1.0"
|
||||
"@vates/types": "^3.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@xen-orchestra/log": "^1.0.0",
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
"dependencies": {
|
||||
"@vates/async-each": "^1.0.3",
|
||||
"@xen-orchestra/async-map": "^0.1.5",
|
||||
"@xen-orchestra/backups": "^1.0.1",
|
||||
"@xen-orchestra/backups": "^1.0.0",
|
||||
"@xen-orchestra/fs": "^4.11.0",
|
||||
"filenamify": "^6.0.0",
|
||||
"getopts": "^2.2.5",
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
"type": "git",
|
||||
"url": "https://github.com/vatesfr/xen-orchestra.git"
|
||||
},
|
||||
"version": "1.0.1",
|
||||
"version": "1.0.0",
|
||||
"engines": {
|
||||
"node": ">=22.19"
|
||||
},
|
||||
@@ -27,10 +27,10 @@
|
||||
"@vates/disposable": "^0.1.7",
|
||||
"@vates/fuse-vhd": "^2.1.4",
|
||||
"@vates/generator-toolbox": "^1.1.3",
|
||||
"@vates/nbd-client": "^3.7.2",
|
||||
"@vates/nbd-client": "^3.7.1",
|
||||
"@vates/parse-duration": "^0.1.1",
|
||||
"@vates/task": "^0.7.0",
|
||||
"@vates/types": "^3.1.0",
|
||||
"@vates/types": "^3.0.0",
|
||||
"@xen-orchestra/async-map": "^0.1.5",
|
||||
"@xen-orchestra/disk-transform": "^1.3.4",
|
||||
"@xen-orchestra/fs": "^4.11.0",
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@vates/async-each": "^1.0.3",
|
||||
"@xen-orchestra/backups": "^1.0.1",
|
||||
"@xen-orchestra/backups": "^1.0.0",
|
||||
"@xen-orchestra/backup-archive": "^1.2.1",
|
||||
"@xen-orchestra/disk-transform": "^1.3.4",
|
||||
"@xen-orchestra/fs": "^4.11.0",
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@vates/async-each": "^1.0.3",
|
||||
"@xen-orchestra/backups": "^1.0.1",
|
||||
"@xen-orchestra/backups": "^1.0.0",
|
||||
"@xen-orchestra/log": "^1.0.0",
|
||||
"app-conf": "^3.0.0",
|
||||
"execa": "^5.0.0",
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
## **next**
|
||||
|
||||
- [VDIs] The used space of a VDI now includes its whole snapshot chain instead of only its last layer, which showed almost 0% for disks with snapshots. It is shown as a size, without usage bar or free space (PR [#10116](https://github.com/vatesfr/xen-orchestra/pull/10116))
|
||||
- [Web-Core/UiCircleProgressBar] Add a brand accent and an option to hide the value (PR [#10849](https://github.com/vatesfr/xen-orchestra/pull/10849))
|
||||
- [Tables] Cells fit on one line: long names are cut in the middle, extra tags go under "+N" and long texts end with "…" (PR [#10850](https://github.com/vatesfr/xen-orchestra/pull/10850))
|
||||
- [Pages] The page header and tabs now stay in place on every page: dashboards, System tabs, consoles, tasks, settings and creation forms scroll under them instead of scrolling with them (PR [#10822](https://github.com/vatesfr/xen-orchestra/pull/10822))
|
||||
@@ -17,8 +16,6 @@
|
||||
- [Side panels] Fix the double scrollbar when the side panel content is taller than the screen: the page header now stays in place, and the list and the side panel each scroll on their own. All scrollbars are now thin, like the side panel one (PR [#10807](https://github.com/vatesfr/xen-orchestra/pull/10807))
|
||||
- [Mobile] Searchable dropdown lists no longer overflow the screen (PR [#10854](https://github.com/vatesfr/xen-orchestra/pull/10854))
|
||||
- [New/VM] Fix the storage table overflowing horizontally, which hid part of the delete button (PR [#10851](https://github.com/vatesfr/xen-orchestra/pull/10851))
|
||||
- [New/VM] Fix template disk settings being applied to every disk of the new VM: each disk now keeps its own name, description and SR (PR [#10898](https://github.com/vatesfr/xen-orchestra/pull/10898))
|
||||
- [VM/System] Display the default 4 MiB video RAM for HVM VMs that don't define it, as XO 6 does (PR [#10901](https://github.com/vatesfr/xen-orchestra/pull/10901))
|
||||
|
||||
## **0.27.0** (2026-10-29)
|
||||
|
||||
|
||||
@@ -27,13 +27,13 @@
|
||||
"@types/file-saver": "^2.0.7",
|
||||
"@types/lodash-es": "^4.17.12",
|
||||
"@types/node": "^18.19.80",
|
||||
"@vates/types": "^3.1.0",
|
||||
"@vates/types": "^3.0.0",
|
||||
"@vitejs/plugin-vue": "^6.0.0",
|
||||
"@vue/tsconfig": "^0.9.0",
|
||||
"@vueuse/core": "^14.0.0",
|
||||
"@vueuse/math": "^14.0.0",
|
||||
"@vueuse/shared": "^14.0.0",
|
||||
"@xen-orchestra/web-core": "^0.66.1",
|
||||
"@xen-orchestra/web-core": "^0.66.0",
|
||||
"complex-matcher": "^1.1.1",
|
||||
"d3-time-format": "^4.1.0",
|
||||
"decorator-synchronized": "^0.6.0",
|
||||
|
||||
@@ -42,7 +42,7 @@ const progress = computed(() => {
|
||||
.progress-circle-fill {
|
||||
animation: progress 1s ease-out forwards;
|
||||
fill: none;
|
||||
stroke: var(--color-success-data);
|
||||
stroke: var(--color-success-item-base);
|
||||
stroke-width: 1.2;
|
||||
stroke-linecap: round;
|
||||
stroke-dasharray: v-bind(progress), 100;
|
||||
|
||||
@@ -68,11 +68,11 @@ const hasError = computed(() => hostStoreHasError.value || vmStoreHasError.value
|
||||
<style lang="postcss" scoped>
|
||||
.progress-item {
|
||||
--progress-bar-height: 1.2rem;
|
||||
--progress-bar-color: var(--color-brand-data);
|
||||
--progress-bar-color: var(--color-brand-item-base);
|
||||
--progress-bar-background-color: var(--color-neutral-background-disabled);
|
||||
|
||||
&.warning {
|
||||
--progress-bar-color: var(--color-warning-data);
|
||||
--progress-bar-color: var(--color-warning-item-base);
|
||||
--footer-value-color: var(--color-warning-item-base);
|
||||
}
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@ const inactive = computed(() => props.total - props.active)
|
||||
width: 1.3rem;
|
||||
height: 1.3rem;
|
||||
border-radius: 0.65rem;
|
||||
background-color: var(--color-success-data);
|
||||
background-color: var(--color-success-item-base);
|
||||
|
||||
&.inactive {
|
||||
background-color: var(--color-neutral-background-disabled);
|
||||
|
||||
@@ -57,7 +57,6 @@
|
||||
import type { XenApiVm } from '@/libs/xen-api/xen-api.types.ts'
|
||||
import { getHostIcon } from '@/modules/host/utils/host.util.ts'
|
||||
import { useVmUtils } from '@/modules/vm/composables/vm-utils.composable.ts'
|
||||
import { getVmDomainType } from '@/modules/vm/utils/vm.util.ts'
|
||||
import { useHostMetricsStore } from '@/stores/xen-api/host-metrics.store.ts'
|
||||
import { usePoolStore } from '@/stores/xen-api/pool.store.ts'
|
||||
import { useVmGuestMetricsStore } from '@/stores/xen-api/vm-guest-metrics.store.ts'
|
||||
@@ -134,7 +133,16 @@ const ram = computed(() => formatSizeRaw(vm.memory_dynamic_max, 0))
|
||||
|
||||
const osVersion = computed(() => guestMetrics.value?.os_version.name)
|
||||
|
||||
const domainType = computed(() => getVmDomainType(vm))
|
||||
const domainType = computed(() => {
|
||||
if (
|
||||
vm.domain_type !== undefined && // XS < 7.5
|
||||
vm.domain_type !== 'unspecified' // detection failed
|
||||
) {
|
||||
return vm.domain_type
|
||||
}
|
||||
|
||||
return vm.HVM_boot_policy === '' ? 'pv' : 'hvm'
|
||||
})
|
||||
|
||||
const virtualizationType = computed(() =>
|
||||
domainType.value === 'hvm' && guestMetrics.value?.PV_drivers_detected ? 'pvhvm' : domainType.value
|
||||
|
||||
@@ -10,8 +10,8 @@
|
||||
</template>
|
||||
</VtsTabularKeyValueRow>
|
||||
<VtsTabularKeyValueRow :label="t('video-ram')">
|
||||
<template v-if="videoRam" #value>
|
||||
{{ `${videoRam} ${t('bytes:mi')}` }}
|
||||
<template v-if="vm.platform.videoram" #value>
|
||||
{{ `${vm.platform.videoram} ${t('bytes:mi')}` }}
|
||||
</template>
|
||||
</VtsTabularKeyValueRow>
|
||||
</VtsTabularKeyValueList>
|
||||
@@ -20,18 +20,14 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import type { XenApiVm } from '@/libs/xen-api/xen-api.types.ts'
|
||||
import { getVmDomainType } from '@/modules/vm/utils/vm.util.ts'
|
||||
import VtsStatus from '@core/components/status/VtsStatus.vue'
|
||||
import VtsTabularKeyValueList from '@core/components/tabular-key-value-list/VtsTabularKeyValueList.vue'
|
||||
import VtsTabularKeyValueRow from '@core/components/tabular-key-value-row/VtsTabularKeyValueRow.vue'
|
||||
import UiCard from '@core/components/ui/card/UiCard.vue'
|
||||
import UiTitle from '@core/components/ui/title/UiTitle.vue'
|
||||
import { computed } from 'vue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
|
||||
const { vm } = defineProps<{ vm: XenApiVm }>()
|
||||
defineProps<{ vm: XenApiVm }>()
|
||||
|
||||
const { t } = useI18n()
|
||||
|
||||
const videoRam = computed(() => (getVmDomainType(vm) === 'hvm' ? Number(vm.platform.videoram ?? 4) : undefined))
|
||||
</script>
|
||||
|
||||
@@ -35,7 +35,6 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import type { XenApiVm } from '@/libs/xen-api/xen-api.types.ts'
|
||||
import { getVmDomainType } from '@/modules/vm/utils/vm.util.ts'
|
||||
import { useHostStore } from '@/stores/xen-api/host.store.ts'
|
||||
import { usePoolStore } from '@/stores/xen-api/pool.store.ts'
|
||||
import { useVtpmStore } from '@/stores/xen-api/vtpm.store.ts'
|
||||
@@ -56,7 +55,16 @@ const { pool } = usePoolStore().subscribe()
|
||||
const { getByOpaqueRef: getHostOpaqueRef } = useHostStore().subscribe()
|
||||
const { getByOpaqueRef: getVtpmOpaqueRef } = useVtpmStore().subscribe()
|
||||
|
||||
const virtualizationMode = computed(() => getVmDomainType(vm))
|
||||
/**
|
||||
* @see `packages/xo-server/src/xapi/utils.mjs`:57
|
||||
**/
|
||||
const virtualizationMode = computed(() =>
|
||||
vm.domain_type !== undefined && vm.domain_type !== 'unspecified'
|
||||
? vm.domain_type
|
||||
: vm.HVM_boot_policy === ''
|
||||
? 'pv'
|
||||
: 'hvm'
|
||||
)
|
||||
|
||||
const isNestedVirtualizationEnabled = computed(() => {
|
||||
const poolMaster = pool.value !== undefined ? getHostOpaqueRef(pool.value.master) : undefined
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
<script lang="ts" setup>
|
||||
import type { XenApiVbd, XenApiVdi } from '@/libs/xen-api/xen-api.types.ts'
|
||||
import { getVdiFormat, getVdiIcon } from '@/modules/vdi/utils/vdi.util.ts'
|
||||
import { useVdiStore } from '@/stores/xen-api/vdi.store.ts'
|
||||
import VtsRow from '@core/components/table/VtsRow.vue'
|
||||
import VtsTable from '@core/components/table/VtsTable.vue'
|
||||
import UiQuerySearchBar from '@core/components/ui/query-search-bar/UiQuerySearchBar.vue'
|
||||
@@ -44,7 +43,6 @@ const { vdis, vbds, busy, error } = defineProps<{
|
||||
error?: boolean
|
||||
}>()
|
||||
const { t } = useI18n()
|
||||
const { getChainPhysicalUsage } = useVdiStore().subscribe()
|
||||
const selectedVdiId = useRouteQuery('id')
|
||||
const { items: filteredVdis, searchBindings } = useSearchFilter(() => vdis)
|
||||
const state = useTableState({
|
||||
@@ -58,7 +56,6 @@ const { HeadCells, BodyCells } = useVdiColumns({
|
||||
exclude: ['actions'],
|
||||
body: (vdi: XenApiVdi) => {
|
||||
const vdiVbds = computed(() => vbds.filter(vbd => vbd.VDI === vdi.$ref))
|
||||
const usedSpace = computed(() => formatSizeRaw(getChainPhysicalUsage(vdi), 2))
|
||||
const size = computed(() => formatSizeRaw(vdi.virtual_size, 2))
|
||||
const format = computed(() => getVdiFormat(vdi.sm_config['image-format']))
|
||||
return {
|
||||
@@ -68,7 +65,7 @@ const { HeadCells, BodyCells } = useVdiColumns({
|
||||
icon: getVdiIcon(vdiVbds.value),
|
||||
}),
|
||||
description: r => r(vdi.name_description),
|
||||
usedSpace: r => r(usedSpace.value.value, usedSpace.value.prefix),
|
||||
usedSpace: r => r(vdi.physical_utilisation, vdi.virtual_size),
|
||||
size: r => r(size.value.value, size.value.prefix),
|
||||
format: r => r(format.value),
|
||||
selectItem: r => r(() => (selectedVdiId.value = vdi.uuid)),
|
||||
|
||||
@@ -1,48 +1,12 @@
|
||||
<template>
|
||||
<UiPanelCard>
|
||||
<UiPanelCardTitle size="medium" :label="t('space')" />
|
||||
<VtsCardRowList>
|
||||
<VtsCardRowKeyValue>
|
||||
<template #key>{{ t('used-space') }}</template>
|
||||
<template #value>{{ usedSpace }}</template>
|
||||
<template v-if="chainPhysicalUsage > 0" #addons>
|
||||
<VtsCopyButton :value="usedSpace" />
|
||||
</template>
|
||||
</VtsCardRowKeyValue>
|
||||
<VtsCardRowKeyValue>
|
||||
<template #key>{{ t('size') }}</template>
|
||||
<template #value>{{ size }}</template>
|
||||
<template v-if="vdi.virtual_size > 0" #addons>
|
||||
<VtsCopyButton :value="size" />
|
||||
</template>
|
||||
</VtsCardRowKeyValue>
|
||||
</VtsCardRowList>
|
||||
</UiPanelCard>
|
||||
<VtsSpaceCard :used="vdi.physical_utilisation" :total="vdi.virtual_size" :label="vdi.name_label" />
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import type { XenApiVdi } from '@/libs/xen-api/xen-api.types.ts'
|
||||
import { useVdiStore } from '@/stores/xen-api/vdi.store.ts'
|
||||
import VtsCardRowKeyValue from '@core/components/card/VtsCardRowKeyValue.vue'
|
||||
import VtsCardRowList from '@core/components/card/VtsCardRowList.vue'
|
||||
import VtsCopyButton from '@core/components/copy-button/VtsCopyButton.vue'
|
||||
import UiPanelCard from '@core/components/ui/panel-card/UiPanelCard.vue'
|
||||
import UiPanelCardTitle from '@core/components/ui/panel-card-title/UiPanelCardTitle.vue'
|
||||
import { formatSize } from '@core/utils/size.util.ts'
|
||||
import { computed } from 'vue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import VtsSpaceCard from '@core/components/space-card/VtsSpaceCard.vue'
|
||||
|
||||
const { vdi } = defineProps<{
|
||||
defineProps<{
|
||||
vdi: XenApiVdi
|
||||
}>()
|
||||
|
||||
const { t } = useI18n()
|
||||
|
||||
const { getChainPhysicalUsage } = useVdiStore().subscribe()
|
||||
|
||||
const chainPhysicalUsage = computed(() => getChainPhysicalUsage(vdi))
|
||||
|
||||
const usedSpace = computed(() => formatSize(chainPhysicalUsage.value, 2))
|
||||
|
||||
const size = computed(() => formatSize(vdi.virtual_size, 2))
|
||||
</script>
|
||||
|
||||
@@ -43,20 +43,6 @@ export function areVmToolsDetected(guestMetrics: XenApiVmGuestMetrics | undefine
|
||||
return managementAgentDetected && pvDriversDetected
|
||||
}
|
||||
|
||||
/**
|
||||
* @see `packages/xo-server/src/xapi/utils.mjs`:57
|
||||
**/
|
||||
export function getVmDomainType(vm: XenApiVm) {
|
||||
if (
|
||||
vm.domain_type !== undefined && // XS < 7.5
|
||||
vm.domain_type !== 'unspecified' // detection failed
|
||||
) {
|
||||
return vm.domain_type
|
||||
}
|
||||
|
||||
return vm.HVM_boot_policy === '' ? 'pv' : 'hvm'
|
||||
}
|
||||
|
||||
export type VmPowerStateAction =
|
||||
| 'start'
|
||||
| 'pause'
|
||||
|
||||
@@ -512,7 +512,6 @@ const getExistingVdis = (template: XenApiVm) => {
|
||||
|
||||
acc.push({
|
||||
id: vdi.$ref,
|
||||
userdevice: vbd.userdevice,
|
||||
name_label: vdi.name_label,
|
||||
name_description: vdi.name_description,
|
||||
size: bytesToGiB(vdi.virtual_size),
|
||||
@@ -699,7 +698,6 @@ const _createVm = defer(async ($defer: Defer) => {
|
||||
const vdiRef = await xapi.getField<XenApiVdi['$ref']>('VBD', vbdRef, 'VDI')
|
||||
const type = await xapi.getField<VBD_TYPE>('VBD', vbdRef, 'type')
|
||||
const bootable = await xapi.getField<boolean>('VBD', vbdRef, 'bootable')
|
||||
const userdevice = await xapi.getField<XenApiVbd['userdevice']>('VBD', vbdRef, 'userdevice')
|
||||
|
||||
if (!hasBootableDisk) {
|
||||
hasBootableDisk = bootable
|
||||
@@ -709,49 +707,45 @@ const _createVm = defer(async ($defer: Defer) => {
|
||||
continue
|
||||
}
|
||||
|
||||
const vdi = existingVdis.find(vdi => vdi.userdevice === userdevice)
|
||||
for (const vdi of existingVdis) {
|
||||
const srRef = await xapi.getField<XenApiSr['$ref']>('VDI', vdiRef, 'SR')
|
||||
const vbdRefs = await xapi.getField<XenApiVbd['$ref'][]>('VDI', vdiRef, 'VBDs')
|
||||
|
||||
if (vdi === undefined) {
|
||||
continue
|
||||
}
|
||||
await xapi.vdi.setNameLabel(vdiRef, vdi.name_label)
|
||||
await xapi.vdi.setNameDescription(vdiRef, vdi.name_description)
|
||||
|
||||
const srRef = await xapi.getField<XenApiSr['$ref']>('VDI', vdiRef, 'SR')
|
||||
const vbdRefs = await xapi.getField<XenApiVbd['$ref'][]>('VDI', vdiRef, 'VBDs')
|
||||
|
||||
await xapi.vdi.setNameLabel(vdiRef, vdi.name_label)
|
||||
await xapi.vdi.setNameDescription(vdiRef, vdi.name_description)
|
||||
|
||||
// EDIT SR: Migrate VDI or create new one
|
||||
if (vdi.SR !== srRef) {
|
||||
try {
|
||||
await xapi.vdi.poolMigrate(vdiRef, vdi.SR)
|
||||
} catch (error) {
|
||||
if (!(error instanceof Error)) {
|
||||
throw error
|
||||
}
|
||||
|
||||
const { message } = error
|
||||
|
||||
if (
|
||||
message !== 'NO_HOSTS_AVAILABLE' &&
|
||||
message !== 'LICENCE_RESTRICTION' &&
|
||||
message !== 'VDI_NEEDS_VM_FOR_MIGRATE'
|
||||
) {
|
||||
throw error
|
||||
}
|
||||
|
||||
const newVdiRef = await xapi.vdi.copy(vdiRef, vdi.SR)
|
||||
|
||||
if (vbdRefs) {
|
||||
for (const vbdRef of vbdRefs) {
|
||||
const vbd = await xapi.getField<XenApiVbd>('VBD', vbdRef, 'record')
|
||||
|
||||
await xapi.vbd.delete(vbdRef)
|
||||
await xapi.vbd.create({ ...vbd, vmRefs, vdiRef: newVdiRef[0] })
|
||||
// EDIT SR: Migrate VDI or create new one
|
||||
if (vdi.SR !== srRef) {
|
||||
try {
|
||||
await xapi.vdi.poolMigrate(vdiRef, vdi.SR)
|
||||
} catch (error) {
|
||||
if (!(error instanceof Error)) {
|
||||
throw error
|
||||
}
|
||||
}
|
||||
|
||||
await xapi.vdi.delete(vdiRef)
|
||||
const { message } = error
|
||||
|
||||
if (
|
||||
message !== 'NO_HOSTS_AVAILABLE' &&
|
||||
message !== 'LICENCE_RESTRICTION' &&
|
||||
message !== 'VDI_NEEDS_VM_FOR_MIGRATE'
|
||||
) {
|
||||
throw error
|
||||
}
|
||||
|
||||
const newVdiRef = await xapi.vdi.copy(vdiRef, vdi.SR)
|
||||
|
||||
if (vbdRefs) {
|
||||
for (const vbdRef of vbdRefs) {
|
||||
const vbd = await xapi.getField<XenApiVbd>('VBD', vbdRef, 'record')
|
||||
|
||||
await xapi.vbd.delete(vbdRef)
|
||||
await xapi.vbd.create({ ...vbd, vmRefs, vdiRef: newVdiRef[0] })
|
||||
}
|
||||
}
|
||||
|
||||
await xapi.vdi.delete(vdiRef)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
91
@xen-orchestra/lite/src/route-map.d.ts
vendored
91
@xen-orchestra/lite/src/route-map.d.ts
vendored
@@ -891,13 +891,6 @@ declare module 'vue-router/auto-routes' {
|
||||
Record<never, never>,
|
||||
| never
|
||||
>,
|
||||
'/story/web-core/ui/group-subcategory/ui-group-subcategory': RouteRecordInfo<
|
||||
'/story/web-core/ui/group-subcategory/ui-group-subcategory',
|
||||
'/story/web-core/ui/group-subcategory/ui-group-subcategory',
|
||||
Record<never, never>,
|
||||
Record<never, never>,
|
||||
| never
|
||||
>,
|
||||
'/story/web-core/ui/head-bar/ui-head-bar': RouteRecordInfo<
|
||||
'/story/web-core/ui/head-bar/ui-head-bar',
|
||||
'/story/web-core/ui/head-bar/ui-head-bar',
|
||||
@@ -905,13 +898,6 @@ declare module 'vue-router/auto-routes' {
|
||||
Record<never, never>,
|
||||
| never
|
||||
>,
|
||||
'/story/web-core/ui/image-radio-button/ui-image-radio-button': RouteRecordInfo<
|
||||
'/story/web-core/ui/image-radio-button/ui-image-radio-button',
|
||||
'/story/web-core/ui/image-radio-button/ui-image-radio-button',
|
||||
Record<never, never>,
|
||||
Record<never, never>,
|
||||
| never
|
||||
>,
|
||||
'/story/web-core/ui/info/ui-info': RouteRecordInfo<
|
||||
'/story/web-core/ui/info/ui-info',
|
||||
'/story/web-core/ui/info/ui-info',
|
||||
@@ -1066,20 +1052,6 @@ declare module 'vue-router/auto-routes' {
|
||||
Record<never, never>,
|
||||
| never
|
||||
>,
|
||||
'/story/web-core/ui/rich-checkbox/ui-rich-checkbox': RouteRecordInfo<
|
||||
'/story/web-core/ui/rich-checkbox/ui-rich-checkbox',
|
||||
'/story/web-core/ui/rich-checkbox/ui-rich-checkbox',
|
||||
Record<never, never>,
|
||||
Record<never, never>,
|
||||
| never
|
||||
>,
|
||||
'/story/web-core/ui/rich-checkbox-group/ui-rich-checkbox-group': RouteRecordInfo<
|
||||
'/story/web-core/ui/rich-checkbox-group/ui-rich-checkbox-group',
|
||||
'/story/web-core/ui/rich-checkbox-group/ui-rich-checkbox-group',
|
||||
Record<never, never>,
|
||||
Record<never, never>,
|
||||
| never
|
||||
>,
|
||||
'/story/web-core/ui/rich-radio-button/ui-rich-radio-button': RouteRecordInfo<
|
||||
'/story/web-core/ui/rich-radio-button/ui-rich-radio-button',
|
||||
'/story/web-core/ui/rich-radio-button/ui-rich-radio-button',
|
||||
@@ -1087,13 +1059,6 @@ declare module 'vue-router/auto-routes' {
|
||||
Record<never, never>,
|
||||
| never
|
||||
>,
|
||||
'/story/web-core/ui/rich-radio-button-group/ui-rich-radio-button-group': RouteRecordInfo<
|
||||
'/story/web-core/ui/rich-radio-button-group/ui-rich-radio-button-group',
|
||||
'/story/web-core/ui/rich-radio-button-group/ui-rich-radio-button-group',
|
||||
Record<never, never>,
|
||||
Record<never, never>,
|
||||
| never
|
||||
>,
|
||||
'/story/web-core/ui/stacked-bar/ui-stacked-bar': RouteRecordInfo<
|
||||
'/story/web-core/ui/stacked-bar/ui-stacked-bar',
|
||||
'/story/web-core/ui/stacked-bar/ui-stacked-bar',
|
||||
@@ -1150,13 +1115,6 @@ declare module 'vue-router/auto-routes' {
|
||||
Record<never, never>,
|
||||
| never
|
||||
>,
|
||||
'/story/web-core/ui/tag/ui-label-value-tag': RouteRecordInfo<
|
||||
'/story/web-core/ui/tag/ui-label-value-tag',
|
||||
'/story/web-core/ui/tag/ui-label-value-tag',
|
||||
Record<never, never>,
|
||||
Record<never, never>,
|
||||
| never
|
||||
>,
|
||||
'/story/web-core/ui/tag/ui-tag': RouteRecordInfo<
|
||||
'/story/web-core/ui/tag/ui-tag',
|
||||
'/story/web-core/ui/tag/ui-tag',
|
||||
@@ -1171,6 +1129,13 @@ declare module 'vue-router/auto-routes' {
|
||||
Record<never, never>,
|
||||
| never
|
||||
>,
|
||||
'/story/web-core/ui/tag/ui-tertiary-tag': RouteRecordInfo<
|
||||
'/story/web-core/ui/tag/ui-tertiary-tag',
|
||||
'/story/web-core/ui/tag/ui-tertiary-tag',
|
||||
Record<never, never>,
|
||||
Record<never, never>,
|
||||
| never
|
||||
>,
|
||||
'/story/web-core/ui/task-item/ui-task-item': RouteRecordInfo<
|
||||
'/story/web-core/ui/task-item/ui-task-item',
|
||||
'/story/web-core/ui/task-item/ui-task-item',
|
||||
@@ -2073,24 +2038,12 @@ declare module 'vue-router/auto-routes' {
|
||||
views:
|
||||
| never
|
||||
}
|
||||
'src/stories/web-core/ui/group-subcategory/ui-group-subcategory.story.vue': {
|
||||
routes:
|
||||
| '/story/web-core/ui/group-subcategory/ui-group-subcategory'
|
||||
views:
|
||||
| never
|
||||
}
|
||||
'src/stories/web-core/ui/head-bar/ui-head-bar.story.vue': {
|
||||
routes:
|
||||
| '/story/web-core/ui/head-bar/ui-head-bar'
|
||||
views:
|
||||
| never
|
||||
}
|
||||
'src/stories/web-core/ui/image-radio-button/ui-image-radio-button.story.vue': {
|
||||
routes:
|
||||
| '/story/web-core/ui/image-radio-button/ui-image-radio-button'
|
||||
views:
|
||||
| never
|
||||
}
|
||||
'src/stories/web-core/ui/info/ui-info.story.vue': {
|
||||
routes:
|
||||
| '/story/web-core/ui/info/ui-info'
|
||||
@@ -2223,30 +2176,12 @@ declare module 'vue-router/auto-routes' {
|
||||
views:
|
||||
| never
|
||||
}
|
||||
'src/stories/web-core/ui/rich-checkbox/ui-rich-checkbox.story.vue': {
|
||||
routes:
|
||||
| '/story/web-core/ui/rich-checkbox/ui-rich-checkbox'
|
||||
views:
|
||||
| never
|
||||
}
|
||||
'src/stories/web-core/ui/rich-checkbox-group/ui-rich-checkbox-group.story.vue': {
|
||||
routes:
|
||||
| '/story/web-core/ui/rich-checkbox-group/ui-rich-checkbox-group'
|
||||
views:
|
||||
| never
|
||||
}
|
||||
'src/stories/web-core/ui/rich-radio-button/ui-rich-radio-button.story.vue': {
|
||||
routes:
|
||||
| '/story/web-core/ui/rich-radio-button/ui-rich-radio-button'
|
||||
views:
|
||||
| never
|
||||
}
|
||||
'src/stories/web-core/ui/rich-radio-button-group/ui-rich-radio-button-group.story.vue': {
|
||||
routes:
|
||||
| '/story/web-core/ui/rich-radio-button-group/ui-rich-radio-button-group'
|
||||
views:
|
||||
| never
|
||||
}
|
||||
'src/stories/web-core/ui/stacked-bar/ui-stacked-bar.story.vue': {
|
||||
routes:
|
||||
| '/story/web-core/ui/stacked-bar/ui-stacked-bar'
|
||||
@@ -2295,12 +2230,6 @@ declare module 'vue-router/auto-routes' {
|
||||
views:
|
||||
| never
|
||||
}
|
||||
'src/stories/web-core/ui/tag/ui-label-value-tag.story.vue': {
|
||||
routes:
|
||||
| '/story/web-core/ui/tag/ui-label-value-tag'
|
||||
views:
|
||||
| never
|
||||
}
|
||||
'src/stories/web-core/ui/tag/ui-tag.story.vue': {
|
||||
routes:
|
||||
| '/story/web-core/ui/tag/ui-tag'
|
||||
@@ -2313,6 +2242,12 @@ declare module 'vue-router/auto-routes' {
|
||||
views:
|
||||
| never
|
||||
}
|
||||
'src/stories/web-core/ui/tag/ui-tertiary-tag.story.vue': {
|
||||
routes:
|
||||
| '/story/web-core/ui/tag/ui-tertiary-tag'
|
||||
views:
|
||||
| never
|
||||
}
|
||||
'src/stories/web-core/ui/task-item/ui-task-item.story.vue': {
|
||||
routes:
|
||||
| '/story/web-core/ui/task-item/ui-task-item'
|
||||
|
||||
@@ -1,37 +1,9 @@
|
||||
import type { XenApiVdi } from '@/libs/xen-api/xen-api.types.ts'
|
||||
import { createXapiStoreConfig } from '@/stores/xen-api/create-xapi-store-config.ts'
|
||||
import { createSubscribableStoreContext } from '@core/utils/create-subscribable-store-context.util.ts'
|
||||
import { defineStore } from 'pinia'
|
||||
|
||||
export const useVdiStore = defineStore('xen-api-vdi', () => {
|
||||
const { context: baseContext, ...configRest } = createXapiStoreConfig('vdi')
|
||||
const config = createXapiStoreConfig('vdi')
|
||||
|
||||
const getChainPhysicalUsage = (vdi: XenApiVdi) => {
|
||||
if (vdi.is_a_snapshot || !vdi.managed) {
|
||||
return vdi.physical_utilisation
|
||||
}
|
||||
|
||||
let total = vdi.physical_utilisation
|
||||
let parentUuid = vdi.sm_config['vhd-parent'] as XenApiVdi['uuid'] | undefined
|
||||
|
||||
while (parentUuid !== undefined) {
|
||||
const parent = baseContext.getByUuid(parentUuid)
|
||||
|
||||
if (parent === undefined) {
|
||||
break
|
||||
}
|
||||
|
||||
total += parent.physical_utilisation
|
||||
parentUuid = parent.sm_config['vhd-parent'] as XenApiVdi['uuid'] | undefined
|
||||
}
|
||||
|
||||
return total
|
||||
}
|
||||
|
||||
const context = {
|
||||
...baseContext,
|
||||
getChainPhysicalUsage,
|
||||
}
|
||||
|
||||
return createSubscribableStoreContext({ context, ...configRest }, {})
|
||||
return createSubscribableStoreContext(config, {})
|
||||
})
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
v-slot="{ properties, settings }"
|
||||
:params="[
|
||||
prop('accent').type('CheckboxAccent').required().enum('brand', 'warning', 'danger').preset('brand').widget(),
|
||||
prop('value').str().help('Used when the model is an array'),
|
||||
prop('disabled').bool().widget(),
|
||||
slot(),
|
||||
slot('info'),
|
||||
@@ -11,7 +10,7 @@
|
||||
setting('defaultSlot').widget(text()).preset('Label'),
|
||||
setting('info').widget(text()).preset('Lorem ipsum dolor sit amet, consectetur adipiscing elit.'),
|
||||
setting('message').widget(text()).preset('Lorem ipsum dolor sit amet, consectetur adipiscing elit.'),
|
||||
model().type('boolean | undefined | string[]').preset(undefined).help('undefined means partly checked'),
|
||||
model().type('boolean').preset(undefined),
|
||||
]"
|
||||
>
|
||||
<UiCheckbox v-bind="properties">
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
<template>
|
||||
<ComponentStory
|
||||
v-slot="{ settings }"
|
||||
:params="[
|
||||
slot().help('Meant to receive the subcategory title'),
|
||||
slot('info').help('Meant to receive a short text displayed on the right'),
|
||||
setting('defaultSlot').widget(text()).preset('Into a pool'),
|
||||
setting('info').widget(text()).preset('Writes to a pool'),
|
||||
]"
|
||||
>
|
||||
<UiGroupSubcategory>
|
||||
{{ settings.defaultSlot }}
|
||||
<template v-if="settings.info" #info>{{ settings.info }}</template>
|
||||
</UiGroupSubcategory>
|
||||
</ComponentStory>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import ComponentStory from '@/components/component-story/ComponentStory.vue'
|
||||
import { setting, slot } from '@/libs/story/story-param.ts'
|
||||
import { text } from '@/libs/story/story-widget.ts'
|
||||
import UiGroupSubcategory from '@core/components/ui/group-subcategory/UiGroupSubcategory.vue'
|
||||
</script>
|
||||
@@ -1,39 +0,0 @@
|
||||
<template>
|
||||
<ComponentStory
|
||||
v-slot="{ properties, settings }"
|
||||
:params="[
|
||||
prop('accent').required().enum('brand', 'warning', 'danger').preset('brand').widget(),
|
||||
prop('size').required().enum('small', 'medium').preset('medium').widget(),
|
||||
prop('disabled').bool().widget(),
|
||||
prop('src').required().str().help('Image URL for rich mode'),
|
||||
prop('alt').required().str().help('Alt text for image'),
|
||||
model().type('string').preset(''),
|
||||
setting('defaultSlot').widget(text()).preset('Label'),
|
||||
]"
|
||||
>
|
||||
<div class="radio">
|
||||
<UiImageRadioButton v-model="selectedRadio" value="1" v-bind="properties" :src="imageUrl" :alt="properties.alt">
|
||||
{{ settings.defaultSlot }}
|
||||
</UiImageRadioButton>
|
||||
</div>
|
||||
</ComponentStory>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import ComponentStory from '@/components/component-story/ComponentStory.vue'
|
||||
import { model, prop, setting } from '@/libs/story/story-param.ts'
|
||||
import { text } from '@/libs/story/story-widget.ts'
|
||||
import UiImageRadioButton from '@core/components/ui/image-radio-button/UiImageRadioButton.vue'
|
||||
import { ref } from 'vue'
|
||||
import imageUrl from '../../../../assets/color-mode-dark.svg'
|
||||
|
||||
const selectedRadio = ref('')
|
||||
</script>
|
||||
|
||||
<style lang="postcss" scoped>
|
||||
.radio {
|
||||
display: flex;
|
||||
gap: 1.6rem;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
</style>
|
||||
@@ -10,16 +10,16 @@
|
||||
slot().help('Meant to receive a list of radio button components'),
|
||||
slot('label').help('Meant to receive a label UiLabel component or another component'),
|
||||
slot('info').help('Meant to receive a message info or UiInfo component or another component'),
|
||||
setting('imageRadioButton').widget(boolean()),
|
||||
setting('richRadioButton').widget(boolean()),
|
||||
]"
|
||||
>
|
||||
<UiRadioButtonGroup v-bind="properties">
|
||||
<component
|
||||
:is="settings.imageRadioButton === true ? UiImageRadioButton : UiRadioButton"
|
||||
:is="settings.richRadioButton === true ? UiRichRadioButton : UiRadioButton"
|
||||
v-for="(label, index) in labels"
|
||||
:key="index"
|
||||
v-model="selectedRadio"
|
||||
v-bind="imageButtonProps(properties, settings.imageRadioButton)"
|
||||
v-bind="richButtonProps(properties, settings.richRadioButton)"
|
||||
:value="`radio-${index}`"
|
||||
>
|
||||
{{ label }}
|
||||
@@ -32,9 +32,9 @@
|
||||
import ComponentStory from '@/components/component-story/ComponentStory.vue'
|
||||
import { prop, setting, slot } from '@/libs/story/story-param.ts'
|
||||
import { boolean } from '@/libs/story/story-widget.ts'
|
||||
import UiImageRadioButton from '@core/components/ui/image-radio-button/UiImageRadioButton.vue'
|
||||
import UiRadioButton from '@core/components/ui/radio-button/UiRadioButton.vue'
|
||||
import UiRadioButtonGroup from '@core/components/ui/radio-button-group/UiRadioButtonGroup.vue'
|
||||
import UiRichRadioButton from '@core/components/ui/rich-radio-button/UiRichRadioButton.vue'
|
||||
import { ref } from 'vue'
|
||||
import imageUrl from '../../../../assets/color-mode-dark.svg'
|
||||
|
||||
@@ -42,8 +42,8 @@ const selectedRadio = ref('')
|
||||
|
||||
const labels = ref(['Label 1', 'Label 2', 'Label 3'])
|
||||
|
||||
const imageButtonProps = (properties: any, imageRadioButton: boolean) => {
|
||||
if (imageRadioButton) {
|
||||
const richButtonProps = (properties: any, richRadioButton: boolean) => {
|
||||
if (richRadioButton) {
|
||||
return {
|
||||
...properties,
|
||||
src: imageUrl,
|
||||
|
||||
@@ -1,75 +0,0 @@
|
||||
<template>
|
||||
<ComponentStory
|
||||
v-slot="{ properties }"
|
||||
:params="[
|
||||
prop('accent').type('RichCheckboxAccent').required().enum('brand', 'warning', 'danger').preset('brand').widget(),
|
||||
prop('label').str().widget().preset('Backup repositories'),
|
||||
prop('info').str().widget(),
|
||||
prop('message').str().widget().help('Only displayed when the accent is not brand'),
|
||||
prop('vertical').bool().widget().preset(true),
|
||||
slot().help('Meant to receive UiRichCheckbox components, and UiGroupSubcategory components in vertical mode'),
|
||||
slot('label').help('Meant to receive a UiLabel component or another component'),
|
||||
slot('info').help('Meant to receive a UiInfo component or another component'),
|
||||
slot('message').help('Meant to receive a UiInfo component or another component'),
|
||||
]"
|
||||
>
|
||||
<UiRichCheckboxGroup v-bind="properties">
|
||||
<template v-for="category of properties.vertical ? categories : horizontalCategories" :key="category.title">
|
||||
<UiGroupSubcategory v-if="properties.vertical">
|
||||
{{ category.title }}
|
||||
<template v-if="category.info" #info>{{ category.info }}</template>
|
||||
</UiGroupSubcategory>
|
||||
<UiRichCheckbox
|
||||
v-for="option of category.options"
|
||||
:key="option.value"
|
||||
v-model="selectedRepositories"
|
||||
:accent="properties.accent"
|
||||
:value="option.value"
|
||||
:tag="option.tag"
|
||||
:description="option.description"
|
||||
:disabled="option.disabled"
|
||||
icon="fa:server"
|
||||
>
|
||||
{{ option.label }}
|
||||
</UiRichCheckbox>
|
||||
</template>
|
||||
</UiRichCheckboxGroup>
|
||||
</ComponentStory>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import ComponentStory from '@/components/component-story/ComponentStory.vue'
|
||||
import { prop, slot } from '@/libs/story/story-param.ts'
|
||||
import UiGroupSubcategory from '@core/components/ui/group-subcategory/UiGroupSubcategory.vue'
|
||||
import UiRichCheckbox from '@core/components/ui/rich-checkbox/UiRichCheckbox.vue'
|
||||
import UiRichCheckboxGroup from '@core/components/ui/rich-checkbox-group/UiRichCheckboxGroup.vue'
|
||||
import { ref } from 'vue'
|
||||
|
||||
type StoryOption = {
|
||||
value: string
|
||||
label: string
|
||||
description: string
|
||||
tag?: string
|
||||
disabled?: boolean
|
||||
}
|
||||
|
||||
const selectedRepositories = ref(['nfs-backups', 'smb-archive'])
|
||||
|
||||
const categories: { title: string; info?: string; options: StoryOption[] }[] = [
|
||||
{
|
||||
title: 'Category 1',
|
||||
options: [
|
||||
{ value: 'rd-s3', label: 'RD - S3', description: '3.1 TiB free', tag: 'Source' },
|
||||
{ value: 'nfs-backups', label: 'NFS backups', description: '4.2 TiB free' },
|
||||
{ value: 'local-backups', label: 'Local backups', description: '120 GiB free', disabled: true },
|
||||
],
|
||||
},
|
||||
{
|
||||
title: 'Category 2',
|
||||
info: 'Info',
|
||||
options: [{ value: 'smb-archive', label: 'SMB archive', description: '900 GiB free' }],
|
||||
},
|
||||
]
|
||||
|
||||
const horizontalCategories = categories.slice(0, 1)
|
||||
</script>
|
||||
@@ -1,41 +0,0 @@
|
||||
<template>
|
||||
<ComponentStory
|
||||
v-slot="{ properties, settings }"
|
||||
:params="[
|
||||
prop('accent').type('RichCheckboxAccent').required().enum('brand', 'warning', 'danger').preset('brand').widget(),
|
||||
prop('value').str().help('Used when the model is an array'),
|
||||
iconProp(),
|
||||
prop('tag').str().widget().preset('Label'),
|
||||
prop('description').str().widget().preset('Description'),
|
||||
prop('info').str().widget(),
|
||||
prop('message').str().widget().help('Only displayed when the accent is not brand'),
|
||||
prop('disabled').bool().widget(),
|
||||
model().type('boolean | undefined | string[]').preset(undefined).help('undefined means partly checked'),
|
||||
slot().help('Meant to receive the label'),
|
||||
slot('tag').help('Meant to receive a UiTag component, to use another accent than the default info one'),
|
||||
slot('description'),
|
||||
slot('info'),
|
||||
slot('message'),
|
||||
setting('defaultSlot').widget(text()).preset('Label'),
|
||||
]"
|
||||
>
|
||||
<div class="checkbox">
|
||||
<UiRichCheckbox v-bind="properties">
|
||||
{{ settings.defaultSlot }}
|
||||
</UiRichCheckbox>
|
||||
</div>
|
||||
</ComponentStory>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import ComponentStory from '@/components/component-story/ComponentStory.vue'
|
||||
import { iconProp, model, prop, setting, slot } from '@/libs/story/story-param.ts'
|
||||
import { text } from '@/libs/story/story-widget.ts'
|
||||
import UiRichCheckbox from '@core/components/ui/rich-checkbox/UiRichCheckbox.vue'
|
||||
</script>
|
||||
|
||||
<style lang="postcss" scoped>
|
||||
.checkbox {
|
||||
max-width: 40rem;
|
||||
}
|
||||
</style>
|
||||
@@ -1,125 +0,0 @@
|
||||
<template>
|
||||
<ComponentStory
|
||||
v-slot="{ properties }"
|
||||
:params="[
|
||||
prop('accent')
|
||||
.type('RichRadioButtonAccent')
|
||||
.required()
|
||||
.enum('brand', 'warning', 'danger')
|
||||
.preset('brand')
|
||||
.widget(),
|
||||
prop('label').str().widget().preset('Restore type'),
|
||||
prop('info').str().widget(),
|
||||
prop('message').str().widget().help('Only displayed when the accent is not brand'),
|
||||
prop('vertical').bool().widget().preset(true),
|
||||
slot().help('Meant to receive UiRichRadioButton components, and UiGroupSubcategory components in vertical mode'),
|
||||
slot('label').help('Meant to receive a UiLabel component or another component'),
|
||||
slot('info').help('Meant to receive a UiInfo component or another component'),
|
||||
slot('message').help('Meant to receive a UiInfo component or another component'),
|
||||
]"
|
||||
>
|
||||
<UiRichRadioButtonGroup v-bind="properties">
|
||||
<template v-for="category of properties.vertical ? categories : horizontalCategories" :key="category.title">
|
||||
<UiGroupSubcategory v-if="properties.vertical">
|
||||
{{ category.title }}
|
||||
<template #info>{{ category.info }}</template>
|
||||
</UiGroupSubcategory>
|
||||
<UiRichRadioButton
|
||||
v-for="option of category.options"
|
||||
:key="option.value"
|
||||
v-model="selectedRadio"
|
||||
:accent="properties.accent"
|
||||
:value="option.value"
|
||||
:icon="option.icon"
|
||||
:description="option.description"
|
||||
:disabled="option.disabled"
|
||||
>
|
||||
{{ option.label }}
|
||||
<template v-if="option.tag" #tag>
|
||||
<UiTag :accent="option.tag.accent" variant="secondary">{{ option.tag.label }}</UiTag>
|
||||
</template>
|
||||
</UiRichRadioButton>
|
||||
</template>
|
||||
</UiRichRadioButtonGroup>
|
||||
</ComponentStory>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import ComponentStory from '@/components/component-story/ComponentStory.vue'
|
||||
import { prop, slot } from '@/libs/story/story-param.ts'
|
||||
import type { IconName } from '@core/icons'
|
||||
import UiGroupSubcategory from '@core/components/ui/group-subcategory/UiGroupSubcategory.vue'
|
||||
import UiRichRadioButton from '@core/components/ui/rich-radio-button/UiRichRadioButton.vue'
|
||||
import UiRichRadioButtonGroup from '@core/components/ui/rich-radio-button-group/UiRichRadioButtonGroup.vue'
|
||||
import UiTag, { type TagAccent } from '@core/components/ui/tag/UiTag.vue'
|
||||
import { ref } from 'vue'
|
||||
|
||||
type StoryOption = {
|
||||
value: string
|
||||
label: string
|
||||
description: string
|
||||
icon: IconName
|
||||
tag?: { label: string; accent: TagAccent }
|
||||
disabled?: boolean
|
||||
}
|
||||
|
||||
const selectedRadio = ref('copy-then-start')
|
||||
|
||||
const categories: { title: string; info: string; options: StoryOption[] }[] = [
|
||||
{
|
||||
title: 'Into a pool',
|
||||
info: 'Writes to a pool',
|
||||
options: [
|
||||
{
|
||||
value: 'copy-then-start',
|
||||
label: 'Copy, then start',
|
||||
description:
|
||||
'Copy the disks to a storage of the pool, then start the VM. When a snapshot of the VM is still in the pool, only the blocks that differ are transferred, if possible.',
|
||||
icon: 'action:copy',
|
||||
tag: { label: 'Default', accent: 'info' },
|
||||
},
|
||||
{
|
||||
value: 'start-now',
|
||||
label: 'Start now',
|
||||
description: 'Start the VM right away from the backup. What it writes goes to a cache storage.',
|
||||
icon: 'status:running',
|
||||
tag: { label: 'Live restore', accent: 'neutral' },
|
||||
},
|
||||
{
|
||||
value: 'attach-disk',
|
||||
label: 'Attach a disk to a running VM',
|
||||
description: 'Serve a disk of the backup, read-only, to an existing VM. Nothing is copied.',
|
||||
icon: 'action:attach',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
title: 'Out of the backup',
|
||||
info: 'Nothing written to a pool',
|
||||
options: [
|
||||
{
|
||||
value: 'download-files',
|
||||
label: 'Download files',
|
||||
description:
|
||||
'Browse a partition of a disk and download individual files or folders. Best for a small amount of data.',
|
||||
icon: 'action:download',
|
||||
},
|
||||
{
|
||||
value: 'export-disk',
|
||||
label: 'Export a disk',
|
||||
description: 'Convert one disk to qcow2, vmdk, vhd or raw, then download it.',
|
||||
icon: 'action:download',
|
||||
},
|
||||
{
|
||||
value: 'export-vm',
|
||||
label: 'Export the VM',
|
||||
description: 'Build an XVA from the backup, to import into XCP-ng or XenServer.',
|
||||
icon: 'action:download',
|
||||
disabled: true,
|
||||
},
|
||||
],
|
||||
},
|
||||
]
|
||||
|
||||
const horizontalCategories = categories.slice(0, 1)
|
||||
</script>
|
||||
@@ -2,30 +2,17 @@
|
||||
<ComponentStory
|
||||
v-slot="{ properties, settings }"
|
||||
:params="[
|
||||
prop('accent')
|
||||
.type('RichRadioButtonAccent')
|
||||
.required()
|
||||
.enum('brand', 'warning', 'danger')
|
||||
.preset('brand')
|
||||
.widget(),
|
||||
iconProp(),
|
||||
prop('tag').str().widget().preset('Label'),
|
||||
prop('description').str().widget().preset('Description'),
|
||||
prop('info').str().widget(),
|
||||
prop('accent').required().enum('brand', 'warning', 'danger').preset('brand').widget(),
|
||||
prop('size').required().enum('small', 'medium').preset('medium').widget(),
|
||||
prop('disabled').bool().widget(),
|
||||
model().type('string'),
|
||||
slot().help('Meant to receive the label'),
|
||||
slot('tag').help('Meant to receive a UiTag component, to use another accent than the default info one'),
|
||||
slot('description'),
|
||||
slot('info'),
|
||||
prop('src').required().str().help('Image URL for rich mode'),
|
||||
prop('alt').required().str().help('Alt text for image'),
|
||||
model().type('string').preset(''),
|
||||
setting('defaultSlot').widget(text()).preset('Label'),
|
||||
]"
|
||||
>
|
||||
<div class="radios">
|
||||
<UiRichRadioButton v-model="selectedRadio" v-bind="properties" value="1">
|
||||
{{ settings.defaultSlot }}
|
||||
</UiRichRadioButton>
|
||||
<UiRichRadioButton v-model="selectedRadio" v-bind="properties" value="2">
|
||||
<div class="radio">
|
||||
<UiRichRadioButton v-model="selectedRadio" value="1" v-bind="properties" :src="imageUrl" :alt="properties.alt">
|
||||
{{ settings.defaultSlot }}
|
||||
</UiRichRadioButton>
|
||||
</div>
|
||||
@@ -34,19 +21,19 @@
|
||||
|
||||
<script lang="ts" setup>
|
||||
import ComponentStory from '@/components/component-story/ComponentStory.vue'
|
||||
import { iconProp, model, prop, setting, slot } from '@/libs/story/story-param.ts'
|
||||
import { model, prop, setting } from '@/libs/story/story-param.ts'
|
||||
import { text } from '@/libs/story/story-widget.ts'
|
||||
import UiRichRadioButton from '@core/components/ui/rich-radio-button/UiRichRadioButton.vue'
|
||||
import { ref } from 'vue'
|
||||
import imageUrl from '../../../../assets/color-mode-dark.svg'
|
||||
|
||||
const selectedRadio = ref('')
|
||||
</script>
|
||||
|
||||
<style lang="postcss" scoped>
|
||||
.radios {
|
||||
.radio {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.8rem;
|
||||
max-width: 40rem;
|
||||
gap: 1.6rem;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
.enum('brand', 'info', 'neutral', 'success', 'warning', 'danger', 'muted')
|
||||
.widget(),
|
||||
prop('variant').type('TagVariant').required().preset('primary').enum('primary', 'secondary').widget(),
|
||||
iconProp(),
|
||||
slot(),
|
||||
setting('slot').preset('Label').widget(),
|
||||
]"
|
||||
@@ -22,6 +21,6 @@
|
||||
|
||||
<script lang="ts" setup>
|
||||
import ComponentStory from '@/components/component-story/ComponentStory.vue'
|
||||
import { iconProp, prop, setting, slot } from '@/libs/story/story-param.ts'
|
||||
import { prop, setting, slot } from '@/libs/story/story-param.ts'
|
||||
import UiTag from '@core/components/ui/tag/UiTag.vue'
|
||||
</script>
|
||||
|
||||
@@ -8,18 +8,18 @@
|
||||
<UiTag accent="success" variant="primary">{{ settings.slot }}</UiTag>
|
||||
<UiTag accent="warning" variant="secondary">{{ settings.slot }}</UiTag>
|
||||
<UiTag accent="danger" variant="secondary">{{ settings.slot }}</UiTag>
|
||||
<UiLabelValueTag accent="info">
|
||||
<UiTertiaryTag accent="info">
|
||||
{{ settings.slot }}
|
||||
<template #term>
|
||||
{{ settings.slot }}
|
||||
</template>
|
||||
</UiLabelValueTag>
|
||||
<UiLabelValueTag accent="success">
|
||||
</UiTertiaryTag>
|
||||
<UiTertiaryTag accent="success">
|
||||
{{ settings.slot }}
|
||||
<template #term>
|
||||
{{ settings.slot }}
|
||||
</template>
|
||||
</UiLabelValueTag>
|
||||
</UiTertiaryTag>
|
||||
</UiTagsList>
|
||||
</ComponentStory>
|
||||
</template>
|
||||
@@ -27,7 +27,7 @@
|
||||
<script lang="ts" setup>
|
||||
import ComponentStory from '@/components/component-story/ComponentStory.vue'
|
||||
import { setting, slot } from '@/libs/story/story-param.ts'
|
||||
import UiLabelValueTag from '@core/components/ui/tag/UiLabelValueTag.vue'
|
||||
import UiTag from '@core/components/ui/tag/UiTag.vue'
|
||||
import UiTagsList from '@core/components/ui/tag/UiTagsList.vue'
|
||||
import UiTertiaryTag from '@core/components/ui/tag/UiTertiaryTag.vue'
|
||||
</script>
|
||||
|
||||
@@ -20,15 +20,12 @@
|
||||
setting('maxWidth').widget(number()).help('Maximum width, in rem'),
|
||||
]"
|
||||
>
|
||||
<UiLabelValueTag
|
||||
v-bind="properties"
|
||||
:style="{ maxWidth: settings.maxWidth ? `${settings.maxWidth}rem` : undefined }"
|
||||
>
|
||||
<UiTertiaryTag v-bind="properties" :style="{ maxWidth: settings.maxWidth ? `${settings.maxWidth}rem` : undefined }">
|
||||
{{ settings.slot }}
|
||||
<template #term>
|
||||
{{ settings.term }}
|
||||
</template>
|
||||
</UiLabelValueTag>
|
||||
</UiTertiaryTag>
|
||||
</ComponentStory>
|
||||
</template>
|
||||
|
||||
@@ -36,5 +33,5 @@
|
||||
import ComponentStory from '@/components/component-story/ComponentStory.vue'
|
||||
import { prop, setting, slot } from '@/libs/story/story-param.ts'
|
||||
import { number } from '@/libs/story/story-widget.ts'
|
||||
import UiLabelValueTag from '@core/components/ui/tag/UiLabelValueTag.vue'
|
||||
import UiTertiaryTag from '@core/components/ui/tag/UiTertiaryTag.vue'
|
||||
</script>
|
||||
@@ -1,16 +1,8 @@
|
||||
import type {
|
||||
XenApiHost,
|
||||
XenApiNetwork,
|
||||
XenApiSr,
|
||||
XenApiVbd,
|
||||
XenApiVdi,
|
||||
XenApiVm,
|
||||
} from '@/libs/xen-api/xen-api.types.ts'
|
||||
import type { XenApiHost, XenApiNetwork, XenApiSr, XenApiVdi, XenApiVm } from '@/libs/xen-api/xen-api.types.ts'
|
||||
import { type OPAQUE_REF_NULL, type VDI_TYPE } from '@vates/types/common'
|
||||
|
||||
export interface Vdi {
|
||||
id?: XenApiVdi['$ref'] | undefined
|
||||
userdevice?: XenApiVbd['userdevice']
|
||||
name_label: string
|
||||
name_description: string
|
||||
size: number
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
"devDependencies": {
|
||||
"@eslint/js": "^9.19.0",
|
||||
"@types/node": "^22.3.0",
|
||||
"@vates/types": "^3.1.0",
|
||||
"@vates/types": "^3.0.0",
|
||||
"rimraf": "^6.0.0",
|
||||
"typescript": "~5.6.3",
|
||||
"typescript-eslint": "^8.61.0"
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
"xo-common": "^0.11.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@vates/types": "^3.1.0"
|
||||
"@vates/types": "^3.0.0"
|
||||
},
|
||||
"scripts": {
|
||||
"postversion": "npm publish --access public",
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"private": true,
|
||||
"name": "@xen-orchestra/proxy",
|
||||
"version": "0.35.1",
|
||||
"version": "0.35.0",
|
||||
"license": "AGPL-3.0-or-later",
|
||||
"description": "XO Proxy used to remotely execute backup jobs",
|
||||
"keywords": [
|
||||
@@ -34,7 +34,7 @@
|
||||
"@vates/disposable": "^0.1.7",
|
||||
"@vates/task": "^0.7.0",
|
||||
"@xen-orchestra/async-map": "^0.1.5",
|
||||
"@xen-orchestra/backups": "^1.0.1",
|
||||
"@xen-orchestra/backups": "^1.0.0",
|
||||
"@xen-orchestra/fs": "^4.11.0",
|
||||
"@xen-orchestra/log": "^1.0.0",
|
||||
"@xen-orchestra/mixin": "^0.2.1",
|
||||
|
||||
@@ -22,10 +22,10 @@
|
||||
"dependencies": {
|
||||
"@vates/async-each": "^1.0.3",
|
||||
"@vates/read-chunk": "^1.2.1",
|
||||
"@xen-orchestra/backups": "^1.0.1",
|
||||
"@xen-orchestra/backups": "^1.0.0",
|
||||
"@xen-orchestra/fs": "^4.11.0",
|
||||
"@xen-orchestra/log": "^1.0.0",
|
||||
"@xen-orchestra/vmware-explorer": "^1.4.0",
|
||||
"@xen-orchestra/vmware-explorer": "^1.3.0",
|
||||
"nodemailer": "^7.0.13",
|
||||
"xo-lib": "^0.11.2"
|
||||
},
|
||||
|
||||
@@ -37,38 +37,12 @@ function getBranchName() {
|
||||
}
|
||||
}
|
||||
|
||||
function getCommitHash() {
|
||||
try {
|
||||
return execSync('git rev-parse --short HEAD', { encoding: 'utf8', cwd: ROOT }).trim()
|
||||
} catch {
|
||||
return 'unknown'
|
||||
}
|
||||
}
|
||||
|
||||
function formatDatetime(date) {
|
||||
// "19/11/2026 13:43 (Paris)"
|
||||
return `${date.toLocaleString('fr-FR', {
|
||||
timeZone: 'Europe/Paris',
|
||||
dateStyle: 'short',
|
||||
timeStyle: 'short',
|
||||
})} (Paris)`
|
||||
}
|
||||
|
||||
function formatDuration(ms) {
|
||||
const hours = Math.floor(ms / 3600000)
|
||||
const minutes = Math.floor((ms / 60000) % 60)
|
||||
.toString()
|
||||
.padStart(2, '0')
|
||||
return `${hours}h${minutes}`
|
||||
}
|
||||
|
||||
function getCount(output, label) {
|
||||
const match = output.match(new RegExp(`ℹ ${label} (\\d+)`))
|
||||
if (match === null) {
|
||||
return '?'
|
||||
} else {
|
||||
return match[1]
|
||||
}
|
||||
// "2026-05-20 08:42 UTC"
|
||||
return date
|
||||
.toISOString()
|
||||
.replace('T', ' ')
|
||||
.replace(/:\d{2}\.\d+Z$/, ' UTC')
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
@@ -149,27 +123,14 @@ if (process.argv.includes('--smtp-test')) {
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
const branch = getBranchName()
|
||||
const commitHash = getCommitHash()
|
||||
const startedAt = new Date()
|
||||
|
||||
process.stderr.write(`[run-and-report] branch=${branch}\n`)
|
||||
|
||||
const { success, output, logFilePath } = await runTests()
|
||||
const runtimeInMs = Date.now() - startedAt.getTime()
|
||||
|
||||
const emoji = success ? '✅' : '❌'
|
||||
const status = success ? 'success' : 'failure'
|
||||
const successTests = getCount(output, 'pass')
|
||||
const totalTests = getCount(output, 'tests')
|
||||
const failedTests = getCount(output, 'fail')
|
||||
const cancelledTests = getCount(output, 'cancelled')
|
||||
const skippedTests = getCount(output, 'skipped')
|
||||
|
||||
const subject = `${emoji} ${status} ${successTests}/${totalTests} passed ${formatDatetime(startedAt)} on ${branch}@${commitHash}`
|
||||
const summary = `Result: ${emoji} ${status}
|
||||
Commit: ${branch}@${commitHash}
|
||||
Tests: ${successTests}/${totalTests} passed, ${failedTests} failed, ${cancelledTests} cancelled, ${skippedTests} skipped
|
||||
Duration: ${formatDuration(runtimeInMs)}`
|
||||
const subject = `test run ${formatDatetime(startedAt)} ${branch} ${status}`
|
||||
|
||||
// Attach the full structured debug log if we found its path
|
||||
const attachments = []
|
||||
@@ -188,9 +149,7 @@ await transport.sendMail({
|
||||
from: process.env.SMTP_FROM ?? process.env.SMTP_USER,
|
||||
to: process.env.SMTP_TO,
|
||||
subject,
|
||||
text: `${summary}
|
||||
----------------------------------------
|
||||
${output}`,
|
||||
text: output,
|
||||
attachments,
|
||||
})
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
"main": "./dist/index.mjs",
|
||||
"name": "@xen-orchestra/rest-api",
|
||||
"homepage": "https://github.com/vatesfr/xen-orchestra/tree/master/@xen-orchestra/rest-api",
|
||||
"version": "0.43.0",
|
||||
"version": "0.42.0",
|
||||
"description": "REST API to manage your XOA",
|
||||
"license": "AGPL-3.0-or-later",
|
||||
"private": false,
|
||||
@@ -38,9 +38,9 @@
|
||||
"@vates/async-each": "^1.0.3",
|
||||
"@vates/obfuscate": "^0.2.0",
|
||||
"@vates/task": "^0.7.0",
|
||||
"@vates/types": "^3.1.0",
|
||||
"@vates/types": "^3.0.0",
|
||||
"@xen-orchestra/acl": "^1.9.0",
|
||||
"@xen-orchestra/backups": "^1.0.1",
|
||||
"@xen-orchestra/backups": "^1.0.0",
|
||||
"@xen-orchestra/cron": "^1.0.7",
|
||||
"@xen-orchestra/log": "^1.0.0",
|
||||
"@xen-orchestra/qcow2": "^1.4.1",
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
import {
|
||||
Body,
|
||||
Example,
|
||||
Extension,
|
||||
Get,
|
||||
Middlewares,
|
||||
Path,
|
||||
Post,
|
||||
Query,
|
||||
Request,
|
||||
Response,
|
||||
@@ -13,6 +15,7 @@ import {
|
||||
Tags,
|
||||
} from 'tsoa'
|
||||
import { inject } from 'inversify'
|
||||
import { json } from 'express'
|
||||
import { provide } from 'inversify-binding-decorators'
|
||||
import type { Request as ExRequest } from 'express'
|
||||
import type { XoApp, XoProxy } from '@vates/types'
|
||||
@@ -20,14 +23,19 @@ import type { XoApp, XoProxy } from '@vates/types'
|
||||
import { acl } from '../middlewares/acl.middleware.mjs'
|
||||
import { ApiError } from '../helpers/error.helper.mjs'
|
||||
import {
|
||||
asynchronousActionResp,
|
||||
badRequestResp,
|
||||
forbiddenOperationResp,
|
||||
incorrectStateResp,
|
||||
internalServerErrorResp,
|
||||
noContentResp,
|
||||
notFoundResp,
|
||||
proxyUnreachableResp,
|
||||
unauthorizedResp,
|
||||
type Unbrand,
|
||||
} from '../open-api/common/response.common.mjs'
|
||||
import type { CreateActionReturnType } from '../abstract-classes/base-controller.mjs'
|
||||
import { taskLocation } from '../open-api/oa-examples/task.oa-example.mjs'
|
||||
import {
|
||||
partialProxies,
|
||||
proxy,
|
||||
@@ -183,4 +191,68 @@ export class ProxyController extends XoController<XoProxy> {
|
||||
getProxyApplianceUpdaterState(@Path() id: string): ReturnType<XoApp['getProxyApplianceUpdaterState']> {
|
||||
return callProxy(this.restApi.xoApp.getProxyApplianceUpdaterState(id as XoProxy['id']))
|
||||
}
|
||||
|
||||
/**
|
||||
* Upgrades the proxy appliance
|
||||
*
|
||||
* By default, the upgrade is refused with an `incorrect state` error if backup jobs are running on the proxy.
|
||||
*
|
||||
* Set `force` to `true` to upgrade by rebooting the proxy VM, which also ignores running jobs. Only available if the
|
||||
* proxy VM is known. No privilege on the VM is checked: the `upgrade` action is enough to reboot it.
|
||||
*
|
||||
* Required privilege:
|
||||
* - resource: proxy, action: upgrade
|
||||
*
|
||||
* @example id "e625ea0c-a876-405a-b838-109d762efe88"
|
||||
* @example body { "force": false, "ignoreRunningJobs": false }
|
||||
*/
|
||||
@Example(taskLocation)
|
||||
@Extension('x-mcp-exposure', 'confirm')
|
||||
@Post('{id}/actions/upgrade')
|
||||
@Middlewares([
|
||||
json(),
|
||||
acl({
|
||||
resource: 'proxy',
|
||||
action: 'upgrade',
|
||||
objectId: 'params.id',
|
||||
getObject: ({ restApi }) => restApi.xoApp.getProxy,
|
||||
}),
|
||||
])
|
||||
@SuccessResponse(asynchronousActionResp.status, asynchronousActionResp.description)
|
||||
@Response(noContentResp.status, noContentResp.description)
|
||||
@Response(forbiddenOperationResp.status, forbiddenOperationResp.description)
|
||||
@Response(notFoundResp.status, notFoundResp.description)
|
||||
@Response(incorrectStateResp.status, incorrectStateResp.description)
|
||||
@Response(internalServerErrorResp.status, internalServerErrorResp.description)
|
||||
@Response(proxyUnreachableResp.status, proxyUnreachableResp.description)
|
||||
upgradeProxy(
|
||||
@Path() id: string,
|
||||
@Body()
|
||||
body?: {
|
||||
force?: boolean
|
||||
ignoreRunningJobs?: boolean
|
||||
},
|
||||
@Query() sync?: boolean
|
||||
): CreateActionReturnType<void> {
|
||||
const proxyId = id as XoProxy['id']
|
||||
const force = body?.force ?? false
|
||||
const opts = {
|
||||
force,
|
||||
ignoreRunningJobs: body?.ignoreRunningJobs ?? force,
|
||||
}
|
||||
|
||||
const action = async () => {
|
||||
await callProxy(this.restApi.xoApp.upgradeProxyAppliance(proxyId, opts))
|
||||
}
|
||||
|
||||
return this.createAction<void>(action, {
|
||||
sync,
|
||||
statusCode: noContentResp.status,
|
||||
taskProperties: {
|
||||
name: 'upgrade proxy appliance',
|
||||
objectId: proxyId,
|
||||
params: body,
|
||||
},
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@ const unreachableErrors = [
|
||||
|
||||
function createController(result: () => Promise<unknown>) {
|
||||
const calls: unknown[] = []
|
||||
const tasks: unknown[] = []
|
||||
const record =
|
||||
(method: string) =>
|
||||
async (...args: unknown[]) => {
|
||||
@@ -23,13 +24,20 @@ function createController(result: () => Promise<unknown>) {
|
||||
return result()
|
||||
}
|
||||
const restApi = {
|
||||
tasks: {
|
||||
create: (properties: unknown) => {
|
||||
tasks.push(properties)
|
||||
return { id: 'task-1', properties, run: (fn: () => unknown) => fn() }
|
||||
},
|
||||
},
|
||||
xoApp: {
|
||||
checkProxyHealth: record('checkProxyHealth'),
|
||||
getProxyApplianceUpdaterState: record('getProxyApplianceUpdaterState'),
|
||||
upgradeProxyAppliance: record('upgradeProxyAppliance'),
|
||||
},
|
||||
} as unknown as RestApi
|
||||
const controller = new ProxyController(restApi)
|
||||
return { calls, controller }
|
||||
return { calls, controller, tasks }
|
||||
}
|
||||
|
||||
for (const [method, xoAppMethod, xoAppResult, expected] of [
|
||||
@@ -67,3 +75,59 @@ for (const [method, xoAppMethod, xoAppResult, expected] of [
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
describe('ProxyController.upgradeProxy', () => {
|
||||
it('upgrades in a task without force by default', async () => {
|
||||
const { calls, controller, tasks } = createController(async () => undefined)
|
||||
|
||||
await controller.upgradeProxy(proxyId, undefined, true)
|
||||
|
||||
assert.deepEqual(calls, [['upgradeProxyAppliance', proxyId, { force: false, ignoreRunningJobs: false }]])
|
||||
assert.deepEqual(tasks, [
|
||||
{
|
||||
name: 'REST API: upgrade proxy appliance',
|
||||
objectId: proxyId,
|
||||
objectType: 'proxy',
|
||||
params: undefined,
|
||||
type: 'xo:rest-api:action',
|
||||
},
|
||||
])
|
||||
assert.equal(controller.getStatus(), 204)
|
||||
})
|
||||
|
||||
it('ignores running jobs by default when forced', async () => {
|
||||
const { calls, controller } = createController(async () => undefined)
|
||||
|
||||
await controller.upgradeProxy(proxyId, { force: true }, true)
|
||||
|
||||
assert.deepEqual(calls, [['upgradeProxyAppliance', proxyId, { force: true, ignoreRunningJobs: true }]])
|
||||
})
|
||||
|
||||
it('forwards an explicit ignoreRunningJobs', async () => {
|
||||
const { calls, controller } = createController(async () => undefined)
|
||||
|
||||
await controller.upgradeProxy(proxyId, { force: true, ignoreRunningJobs: false }, true)
|
||||
|
||||
assert.deepEqual(calls, [['upgradeProxyAppliance', proxyId, { force: true, ignoreRunningJobs: false }]])
|
||||
})
|
||||
|
||||
it('returns the task id when not synchronous', async () => {
|
||||
const { controller } = createController(async () => undefined)
|
||||
|
||||
assert.deepEqual(await controller.upgradeProxy(proxyId), { taskId: 'task-1' })
|
||||
assert.equal(controller.getStatus(), 202)
|
||||
})
|
||||
|
||||
for (const unreachableError of unreachableErrors) {
|
||||
it(`throws a 502 ApiError on "${unreachableError.message}"`, async () => {
|
||||
const { controller } = createController(async () => {
|
||||
throw unreachableError
|
||||
})
|
||||
|
||||
await assert.rejects(
|
||||
controller.upgradeProxy(proxyId, undefined, true),
|
||||
error => error instanceof ApiError && error.status === 502 && error.message === 'Proxy unreachable'
|
||||
)
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
@@ -33,6 +33,7 @@ import type {
|
||||
} from '@vates/types'
|
||||
|
||||
import { SUPPORTED_ACTIONS_BY_RESOURCE, type SupportedActions } from '@xen-orchestra/acl'
|
||||
import { invalidParameters } from 'xo-common/api-errors.js'
|
||||
|
||||
import { acl, actionsFromBody } from '../middlewares/acl.middleware.mjs'
|
||||
import { AlarmService } from '../alarms/alarm.service.mjs'
|
||||
@@ -244,7 +245,11 @@ export class VdiController extends XapiXoController<XoVdi> {
|
||||
await $xapi.call('VDI.set_name_description', $ref, name_description)
|
||||
}
|
||||
if (size !== undefined) {
|
||||
await $xapi.VDI_resize($ref, size)
|
||||
const currentSize = this.getObject(id as XoVdi['id']).size
|
||||
if (size < currentSize) {
|
||||
throw invalidParameters(`cannot set new size (${size}) below the current size (${currentSize})`)
|
||||
}
|
||||
await $xapi.callAsync('VDI.resize', $ref, size)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"license": "ISC",
|
||||
"private": false,
|
||||
"version": "1.4.0",
|
||||
"version": "1.3.0",
|
||||
"name": "@xen-orchestra/vmware-explorer",
|
||||
"description": "Reads the VMs and the disks of an ESXi host or a vCenter",
|
||||
"dependencies": {
|
||||
|
||||
72
@xen-orchestra/vmware-explorer/vectura/Cargo.lock
generated
72
@xen-orchestra/vmware-explorer/vectura/Cargo.lock
generated
@@ -299,21 +299,6 @@ dependencies = [
|
||||
"miniz_oxide",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "foreign-types"
|
||||
version = "0.3.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1"
|
||||
dependencies = [
|
||||
"foreign-types-shared",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "foreign-types-shared"
|
||||
version = "0.1.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b"
|
||||
|
||||
[[package]]
|
||||
name = "fs_extra"
|
||||
version = "1.3.0"
|
||||
@@ -475,59 +460,12 @@ version = "1.70.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "384b8ab6d37215f3c5301a95a4accb5d64aa607f1fcb26a11b5303878451b4fe"
|
||||
|
||||
[[package]]
|
||||
name = "openssl"
|
||||
version = "0.10.82"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "4de8111e94a56adca7ebfe6c365b6d42f99deb69b74b6becacd4204e2f193aa2"
|
||||
dependencies = [
|
||||
"bitflags",
|
||||
"cfg-if",
|
||||
"foreign-types",
|
||||
"libc",
|
||||
"openssl-macros",
|
||||
"openssl-sys",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "openssl-macros"
|
||||
version = "0.1.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.119",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "openssl-probe"
|
||||
version = "0.2.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7c87def4c32ab89d880effc9e097653c8da5d6ef28e6b539d313baaacfbafcbe"
|
||||
|
||||
[[package]]
|
||||
name = "openssl-src"
|
||||
version = "300.6.1+3.6.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "46eb8fb9fb3b61ce1c0f8a026c4c1a0714d3a9e138e7fbde78753ce2babc3846"
|
||||
dependencies = [
|
||||
"cc",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "openssl-sys"
|
||||
version = "0.9.118"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "19c413d6ec9ebaf5e1c829d355cb3e9f783778d700f135be0921d52fce3c60ae"
|
||||
dependencies = [
|
||||
"cc",
|
||||
"libc",
|
||||
"openssl-src",
|
||||
"pkg-config",
|
||||
"vcpkg",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pkg-config"
|
||||
version = "0.3.34"
|
||||
@@ -863,21 +801,13 @@ version = "0.2.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821"
|
||||
|
||||
[[package]]
|
||||
name = "vcpkg"
|
||||
version = "0.2.15"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426"
|
||||
|
||||
[[package]]
|
||||
name = "vectura"
|
||||
version = "0.3.0"
|
||||
version = "0.2.1"
|
||||
dependencies = [
|
||||
"aws-lc-rs",
|
||||
"clap",
|
||||
"flate2",
|
||||
"openssl",
|
||||
"openssl-src",
|
||||
"quick-xml",
|
||||
"rcgen",
|
||||
"rustls",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "vectura"
|
||||
version = "0.3.0"
|
||||
version = "0.2.1"
|
||||
edition = "2024"
|
||||
description = "Standalone client for VMware's NFC disk-read protocol"
|
||||
# The license of the Xen Orchestra application components, see LICENSE.md at
|
||||
@@ -15,20 +15,12 @@ publish = false
|
||||
aws-lc-rs = "1.18.1"
|
||||
clap = { version = "4.6.6", features = ["derive"] }
|
||||
flate2 = { version = "1.1.10", default-features = false, features = ["rust_backend"] }
|
||||
openssl = { version = "0.10.82", features = ["vendored"] }
|
||||
quick-xml = "0.42.0"
|
||||
rustls = "0.23"
|
||||
rustls-native-certs = "0.8.4"
|
||||
rustls-pki-types = "1.15.1"
|
||||
thiserror = "2.0.20"
|
||||
|
||||
[build-dependencies]
|
||||
# Not used by a build script: the entry only turns on a feature of the
|
||||
# OpenSSL build `openssl` asks for. Without DSO support OpenSSL cannot load
|
||||
# an engine or a provider from a file at run time, whatever a configuration
|
||||
# file or the environment asks.
|
||||
openssl-src = { version = "300.6.1", features = ["no-dso"] }
|
||||
|
||||
[dev-dependencies]
|
||||
rcgen = { version = "0.14.10", default-features = false, features = ["aws_lc_rs"] }
|
||||
serde_json = "1.0.151"
|
||||
|
||||
@@ -117,8 +117,7 @@ scripts/build.sh .
|
||||
```
|
||||
|
||||
The build is reproducible: `scripts/build.sh` keeps the paths of the machine
|
||||
out of the binary, builds under `/tmp/vectura-build`, a path OpenSSL writes
|
||||
into the binary, and refuses any zig or cargo-zigbuild but the versions the
|
||||
out of the binary and refuses any zig or cargo-zigbuild but the versions the
|
||||
workflow installs. Linux x86_64 machines build the same binary; macOS and
|
||||
aarch64 hosts are untested.
|
||||
|
||||
@@ -129,8 +128,3 @@ and Ubuntu 20.04. It needs [zig](https://ziglang.org/download/) 0.16.0 and:
|
||||
```sh
|
||||
cargo install --locked cargo-zigbuild@0.23.4
|
||||
```
|
||||
|
||||
OpenSSL is compiled from its sources, which takes perl, to run its
|
||||
`Configure` script, and make. Debian and Ubuntu install both with
|
||||
`build-essential`; on Fedora and RHEL, `perl-core` brings the perl modules
|
||||
`Configure` loads.
|
||||
|
||||
@@ -29,10 +29,8 @@ unmaintained = "workspace"
|
||||
unsound = "workspace"
|
||||
|
||||
[licenses]
|
||||
# What may enter the binary. The OpenSSL license is on the list for
|
||||
# aws-lc-sys, which the default rustls crypto provider builds on; nothing else
|
||||
# needs it. The OpenSSL 3 sources the RSA key exchange fallback links are
|
||||
# under Apache-2.0.
|
||||
# What may enter the binary. OpenSSL is on the list for aws-lc-sys, which the
|
||||
# default rustls crypto provider builds on; nothing else needs it.
|
||||
allow = [
|
||||
"0BSD",
|
||||
"Apache-2.0",
|
||||
|
||||
@@ -71,14 +71,10 @@ thirty minutes, makes the ordinary run not need one.
|
||||
|
||||
## Why rustls, synchronous I/O and two threads
|
||||
|
||||
- **rustls with aws-lc-rs, and OpenSSL for one handshake.** The TLS
|
||||
stack is in the binary, with no system library to match at run time
|
||||
and no shell out. ESXi 6.0, 7 and 8 hosts negotiate TLS 1.2 with ECDHE
|
||||
and AES-GCM on both ports, which rustls speaks. The data port of some
|
||||
ESXi 6.5 hosts accepts RSA key exchange alone, which rustls leaves out
|
||||
on purpose, so a copy of OpenSSL is compiled in and used for that port
|
||||
when the host has refused rustls, and for nothing else. The security
|
||||
model says what such a session gives up.
|
||||
- **rustls with aws-lc-rs, no OpenSSL.** One TLS stack, in the binary,
|
||||
with no system library to match at run time and no shell out. ESXi 6.0,
|
||||
7 and 8 hosts negotiate TLS 1.2 with ECDHE and AES-GCM on both ports,
|
||||
which rustls speaks.
|
||||
- **Synchronous `std` I/O, no async runtime.** A run is two sockets and
|
||||
two pipes. Two threads joined by a bounded channel cover that with
|
||||
back pressure for free and nothing to schedule. An async runtime would
|
||||
|
||||
@@ -64,39 +64,6 @@ presenting the same certificate. There is no flag to accept or refuse
|
||||
this: a 6.x host is served like any other, and the management port, which
|
||||
carries the password, is verified the same way on every host.
|
||||
|
||||
The data port of some ESXi 6.5 hosts accepts no ECDHE suite. When the
|
||||
host answers the first handshake with a `handshake_failure` alert, and
|
||||
only then, Vectura connects again and offers TLS 1.2 with RSA key
|
||||
exchange and AES-GCM. The certificate is judged by its thumbprint, compared
|
||||
with the ticket's once the handshake completes. By then the client has
|
||||
sent `ClientKeyExchange` and `Finished`, but no ticket and no application
|
||||
data go out before the check, and the second session must present the
|
||||
same certificate. With RSA key exchange the host signs
|
||||
nothing: it proves it holds the private key by decrypting the secret the
|
||||
client sent, which the `Finished` messages confirm, so the pinned
|
||||
certificate still authenticates it. Two things are given up, on such a
|
||||
host and on port 902 only:
|
||||
|
||||
- **Forward secrecy.** With RSA key exchange the session keys are sent
|
||||
encrypted to the host's key. Whoever records the session and later
|
||||
obtains that private key can read the disk that was carried.
|
||||
- **The choice of suites.** An attacker on the network can forge the
|
||||
alert, which is not authenticated, and so make Vectura offer RSA key
|
||||
exchange to a host that has ECDHE. They gain nothing at once, since
|
||||
the handshake still needs the host's private key, but the session
|
||||
they record loses forward secrecy.
|
||||
|
||||
There is no flag to forbid the retry, as there is none for the 6.x
|
||||
dialect. The transcript says when it happened, and the management port,
|
||||
which carries the password, never uses it.
|
||||
|
||||
OpenSSL is in the binary, built without the means to load code from a
|
||||
file. When the retry opens it, it still reads its configuration file if
|
||||
one exists: `/usr/local/ssl/openssl.cnf`, or the file `OPENSSL_CONF`
|
||||
names. Vectura sets the protocol version and the two suites itself after
|
||||
that. Whoever can write that file or set the environment of the process
|
||||
is already trusted with the password.
|
||||
|
||||
An attacker who controls the network between Vectura and the host sees
|
||||
TLS on 443 and TLS on 902, and can complete neither handshake without the
|
||||
host's private key. What they can do is drop the connection, which ends
|
||||
|
||||
@@ -27,7 +27,6 @@ are most likely to meet, what each means and what to do.
|
||||
|
||||
| Message | Meaning | Do |
|
||||
| ---------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `host refused every supported TLS suite (ECDHE, then RSA key exchange with AES-GCM)` | The data port accepts neither ECDHE nor RSA key exchange with AES-GCM. | Not supported: Vectura offers nothing weaker. |
|
||||
| `greeting: the host does not announce "NFCSSL supported"; announced: [...]` | The host cannot carry the disk inside a second TLS session. | Not seen on a supported host. `--transport nfc` would carry the disk in clear text; understand what that means before using it. |
|
||||
| `open "[ds] vm/x.vmdk": the host reported error 11: NfcAioProcessOpenFileMsg: permission check failed ...` | The ticket covers the files of the virtual machine `--vm-id` names, and this path is not one of them, or the account may not read it. | Check `--vm-id` against `--disk`. |
|
||||
| `... Thin/TBZ/Sparse disks cannot be opened in multiwriter mode` | The disk is the link a running virtual machine writes to. | Power the virtual machine off, or take a snapshot and read a base link. |
|
||||
|
||||
@@ -9,7 +9,7 @@ documentation is cited where it states the limit.
|
||||
|
||||
| Requirement | Detail |
|
||||
| ---------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| ESXi 6.x, 7.x or 8.x directly; 6.5, 6.7, 7.x or 8.x through a vCenter | With a vCenter, `--host` names the vCenter and the ticket names the ESXi host that holds the virtual machine; the data port is opened on that host. |
|
||||
| ESXi 7.x or 8.x, directly or through a vCenter; ESXi 6.x directly | With a vCenter, `--host` names the vCenter and the ticket names the ESXi host that holds the virtual machine; the data port is opened on that host. |
|
||||
| `SHA256 supported` in the data port's greeting, for the modern dialect | The ticket dialogue confirms the data port's certificate by its SHA-256. A host that does not announce it, ESXi 6.x, is read in the [legacy dialect](#esxi-6x-hosts). |
|
||||
| `NFCSSL supported` in the greeting, for `--transport nfcssl` | Without it, only `--transport nfc` can run, in clear text. Every host measured, 6.0 included, announces it. |
|
||||
| Port 443 and port 902 reachable | 443 for the management calls, on the vCenter when there is one; 902 for the greeting, the ticket dialogue and the disk, always on the ESXi host. |
|
||||
@@ -31,8 +31,7 @@ NBD export are the same; the disk session differs:
|
||||
| Compression | None, whatever `--compression` says: each read comes back as stored. | Measured on ESXi 6.0 |
|
||||
| Capacity | Not in the open reply. Found by 512-byte reads from the size the disk's geometry gives: 26 reads for an 8 GiB disk, 6 for a 24 GiB disk. | Measured on ESXi 6.0 |
|
||||
| Throughput | 3 to 5 MiB/s per process over a link with a 30 ms round trip. | Measured on ESXi 6.0 |
|
||||
| Versions | ESXi 6.0.0, reached directly. ESXi 6.5 and 6.7, through a 6.x vCenter. | |
|
||||
| Ticket of a vCenter | Known to vpxa, the vCenter's agent on the host, not to hostd: the dialogue asks `PROXY vpxa-nfcssl`, which hostd would drop as `session ticket ... not found`. | ESXi 6.5 and 6.7 |
|
||||
| Versions | ESXi 6.0.0, reached directly. ESXi 6.5, 6.7 and a 6.x vCenter are untested. | |
|
||||
|
||||
Several `serve` processes can read the same disk at once, each over its
|
||||
own session: two processes read about 9 MiB/s over the link above, where
|
||||
@@ -87,12 +86,11 @@ A run longer than the session lifetime serves the whole disk and exits
|
||||
|
||||
## TLS
|
||||
|
||||
| Item | Value | Source |
|
||||
| ---------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------ |
|
||||
| Versions the hosts negotiate | TLS 1.2 on both ports, `TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384` or the AES-128 variant | Measured; the vSphere 7 and 8 documentation on the default cipher suites |
|
||||
| RSA key exchange on 902 | Offered only after the host refused the first handshake with a `handshake_failure` alert: TLS 1.2, `TLS_RSA_WITH_AES_256_GCM_SHA384` or the AES-128 variant, no forward secrecy. Never on 443. | Vectura; reported on an ESXi 6.5 U3 host, not measured |
|
||||
| Certificate on 902 | The same certificate as on 443 on every host measured | Measured |
|
||||
| Data port verification | The SHA-1 thumbprint in the ticket, the SHA-256 confirmed in the dialogue on ESXi 7 and later, and the second TLS session must present the certificate of the first | Vectura |
|
||||
| Item | Value | Source |
|
||||
| ---------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------ |
|
||||
| Versions the hosts negotiate | TLS 1.2 on both ports, `TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384` or the AES-128 variant | Measured; the vSphere 7 and 8 documentation on the default cipher suites |
|
||||
| Certificate on 902 | The same certificate as on 443 on every host measured | Measured |
|
||||
| Data port verification | The SHA-1 thumbprint in the ticket, the SHA-256 confirmed in the dialogue on ESXi 7 and later, and the second TLS session must present the certificate of the first | Vectura |
|
||||
|
||||
## Throughput, measured
|
||||
|
||||
|
||||
@@ -12,30 +12,26 @@ is never delayed by the transcript.
|
||||
|
||||
## Lines, in session order
|
||||
|
||||
| Line | When | Fields |
|
||||
| --------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `<call>: <status> in <n> ms` | After each management call on port 443: `RetrieveServiceContent`, `Login`, `RetrieveInternalContent`, `NfcGetVmFiles`, and `Logout` at the end. | The HTTP status the host answered, and the time from request to full response. |
|
||||
| `greeting: <capabilities>` | After the data port's greeting line. | The capabilities the host announced, comma separated, as the host wrote them, such as `NFCSSL supported, SHA256 supported`. |
|
||||
| `legacy dialect: no in-band thumbprint check, one read in flight, no compression` | After the greeting, when it does not announce `SHA256 supported`. | None: the line says what the legacy dialect gives up. |
|
||||
| `first session tls fallback: host refused ECDHE, retrying with RSA key exchange` | After the host refused the first TLS handshake on the data port for want of a common suite. | None: the data port is connected to again and offered RSA key exchange, for both sessions. |
|
||||
| `first session tls <version> <suite>` | After the first TLS handshake on the data port. | The protocol version in rustls's name and the cipher suite in its IANA name, such as `TLSv1_2 TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384`. |
|
||||
| `> <line>` | Each line sent in the ticket dialogue. | `SESSION <ticket>`, `BANNER `, `THUMBPRINT_SHA2 <tag>` or, on a legacy host, `THUMBPRINT <tag>`, `PROXY nfcssl` or `PROXY nfc`; on a legacy host reached through a vCenter, `PROXY vpxa-nfcssl` or `PROXY vpxa-nfc`. |
|
||||
| `< <line>` | Each line the host answered. | The host's reply, such as `220 ...`, `200 <thumbprint>` or `200 Connect ha-nfcssl`; `200 Connect vpxa-nfcssl` when vpxa was asked. |
|
||||
| `second session tls <version> <suite>` | After the second TLS handshake, `--transport nfcssl` only. | As above. |
|
||||
| `> handshake type <n>` | Each handshake message sent. | The message type: 43, 33 and 51 are sent, then 54, 55 and 52 after the host's replies; only 43 and 33 on a legacy host. |
|
||||
| `< handshake type <n>` | Each handshake message received. | The message type: 36 and 51 after the first three, 52 after the last three; only 36 on a legacy host. |
|
||||
| `open: <capacity> bytes, sector size <n>` | After the host's open reply. | The disk's virtual capacity and its sector size, as reported; on a legacy host, the capacity the search found. |
|
||||
| `capacity search: <n> reads from the <size> bytes the geometry gives` | After the open, on a legacy host. | The 512-byte reads the capacity search took, and the size the open reply's geometry gives. |
|
||||
| `nbd option <n>: <outcome>` | After each NBD option. | The option number and how it was answered: `export`, `info`, `acknowledged`, `invalid` or `unsupported`. |
|
||||
| `nbd export: <size> bytes` | When transmission starts. | The export size sent to the client. |
|
||||
| `progress: served <n> GiB, compression ratio <r>, depth <d>` | Each time the bytes served cross a whole gibibyte. | Whole gibibytes served so far, wire bytes per served byte with two decimals, and the depth in use. |
|
||||
| `summary: bytes served <n>, wire bytes <n>, host reads <n>, elapsed <s> s` | When the session ends, before `Logout`. | Bytes served to the client, bytes received from the host for them, host reads issued, and the seconds since negotiation began, with one decimal. |
|
||||
| Line | When | Fields |
|
||||
| --------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| `<call>: <status> in <n> ms` | After each management call on port 443: `RetrieveServiceContent`, `Login`, `RetrieveInternalContent`, `NfcGetVmFiles`, and `Logout` at the end. | The HTTP status the host answered, and the time from request to full response. |
|
||||
| `greeting: <capabilities>` | After the data port's greeting line. | The capabilities the host announced, comma separated, as the host wrote them, such as `NFCSSL supported, SHA256 supported`. |
|
||||
| `legacy dialect: no in-band thumbprint check, one read in flight, no compression` | After the greeting, when it does not announce `SHA256 supported`. | None: the line says what the legacy dialect gives up. |
|
||||
| `first session tls <version> <suite>` | After the first TLS handshake on the data port. | The protocol version and cipher suite, in rustls's names, such as `TLSv1_2 TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384`. |
|
||||
| `> <line>` | Each line sent in the ticket dialogue. | `SESSION <ticket>`, `BANNER `, `THUMBPRINT_SHA2 <tag>` or, on a legacy host, `THUMBPRINT <tag>`, `PROXY nfcssl` or `PROXY nfc`. |
|
||||
| `< <line>` | Each line the host answered. | The host's reply, such as `220 ...` or `200 <thumbprint>`. |
|
||||
| `second session tls <version> <suite>` | After the second TLS handshake, `--transport nfcssl` only. | As above. |
|
||||
| `> handshake type <n>` | Each handshake message sent. | The message type: 43, 33 and 51 are sent, then 54, 55 and 52 after the host's replies; only 43 and 33 on a legacy host. |
|
||||
| `< handshake type <n>` | Each handshake message received. | The message type: 36 and 51 after the first three, 52 after the last three; only 36 on a legacy host. |
|
||||
| `open: <capacity> bytes, sector size <n>` | After the host's open reply. | The disk's virtual capacity and its sector size, as reported; on a legacy host, the capacity the search found. |
|
||||
| `capacity search: <n> reads from the <size> bytes the geometry gives` | After the open, on a legacy host. | The 512-byte reads the capacity search took, and the size the open reply's geometry gives. |
|
||||
| `nbd option <n>: <outcome>` | After each NBD option. | The option number and how it was answered: `export`, `info`, `acknowledged`, `invalid` or `unsupported`. |
|
||||
| `nbd export: <size> bytes` | When transmission starts. | The export size sent to the client. |
|
||||
| `progress: served <n> GiB, compression ratio <r>, depth <d>` | Each time the bytes served cross a whole gibibyte. | Whole gibibytes served so far, wire bytes per served byte with two decimals, and the depth in use. |
|
||||
| `summary: bytes served <n>, wire bytes <n>, host reads <n>, elapsed <s> s` | When the session ends, before `Logout`. | Bytes served to the client, bytes received from the host for them, host reads issued, and the seconds since negotiation began, with one decimal. |
|
||||
|
||||
`fingerprint --verbose` writes `<port> tls <version> <suite>` per port,
|
||||
with `443` or the value of `--nfc-port` as the port, as each handshake
|
||||
completes. When the data port refuses ECDHE, `<port> tls fallback: host
|
||||
refused ECDHE, retrying with RSA key exchange` comes before that port's
|
||||
line.
|
||||
with `443` or the value of `--nfc-port` as the port.
|
||||
|
||||
## Ratios
|
||||
|
||||
|
||||
@@ -39,29 +39,6 @@ RUSTFLAGS="--remap-path-prefix=${CARGO_HOME:-$HOME/.cargo}=/cargo --remap-path-p
|
||||
export RUSTFLAGS
|
||||
unset CARGO_ENCODED_RUSTFLAGS
|
||||
|
||||
# OpenSSL, which is compiled from its sources, writes into the binary the date
|
||||
# of its build and two absolute paths: the directory it is built in, under the
|
||||
# target directory, and the compiler, a wrapper cargo-zigbuild keeps in its
|
||||
# cache. No flag remaps them, so all three are the same on every machine. The
|
||||
# two directories are named in the binary and never read: OpenSSL is built
|
||||
# without the support for loading code at run time. Its configuration file is
|
||||
# another matter, see the security model.
|
||||
build=/tmp/vectura-build
|
||||
# /tmp is shared: a directory someone else prepared could plant what gets
|
||||
# linked into the binary.
|
||||
mkdir -p "$build"
|
||||
if [ -L "$build" ] || [ ! -O "$build" ]; then
|
||||
echo "$build is not a directory of yours, refusing to build in it" >&2
|
||||
exit 1
|
||||
fi
|
||||
chmod 700 "$build"
|
||||
export CARGO_TARGET_DIR=$build/target
|
||||
export CARGO_ZIGBUILD_CACHE_DIR=$build/zigbuild
|
||||
export SOURCE_DATE_EPOCH=1
|
||||
|
||||
# cargo-zigbuild names the directory of that wrapper after its own path, which
|
||||
# depends on the home directory: it runs from a copy at a fixed path.
|
||||
install -m 755 "$(command -v cargo-zigbuild)" "$build/cargo-zigbuild"
|
||||
"$build/cargo-zigbuild" zigbuild --locked --release --target x86_64-unknown-linux-gnu.2.31
|
||||
cargo zigbuild --locked --release --target x86_64-unknown-linux-gnu.2.31
|
||||
# the glibc suffix is for zig only: the binary lands under the plain triple
|
||||
install -m 755 "$CARGO_TARGET_DIR/x86_64-unknown-linux-gnu/release/vectura" "$out"
|
||||
install -m 755 target/x86_64-unknown-linux-gnu/release/vectura "$out"
|
||||
|
||||
@@ -297,21 +297,21 @@ fn report_parse(error: &clap::Error) -> ExitCode {
|
||||
/// Probes both ports, then prints their thumbprints, management port first.
|
||||
fn fingerprint(arguments: &Fingerprint) -> Result<(), Failure> {
|
||||
let HostPort { host, port } = &arguments.host;
|
||||
let transcript = Transcript::new(arguments.verbose);
|
||||
let management = tls::connect(host, *port)
|
||||
.and_then(|mut stream| tls::capture(&mut stream, host))
|
||||
.map_err(|source| Failure::Management {
|
||||
address: format!("{host}:{port}"),
|
||||
source,
|
||||
})?;
|
||||
transcript.tls(&port.to_string(), management.version, management.suite);
|
||||
let data =
|
||||
nfc::capture(host, arguments.nfc_port, transcript).map_err(|source| Failure::Data {
|
||||
address: format!("{host}:{}", arguments.nfc_port),
|
||||
source,
|
||||
})?;
|
||||
transcript.tls(&arguments.nfc_port.to_string(), data.version, data.suite);
|
||||
let data = nfc::capture(host, arguments.nfc_port).map_err(|source| Failure::Data {
|
||||
address: format!("{host}:{}", arguments.nfc_port),
|
||||
source,
|
||||
})?;
|
||||
let presented = [(*port, management), (arguments.nfc_port, data)];
|
||||
let transcript = Transcript::new(arguments.verbose);
|
||||
for (port, presented) in &presented {
|
||||
transcript.tls(&port.to_string(), presented.version, presented.suite);
|
||||
}
|
||||
let mut stdout = io::stdout().lock();
|
||||
for (port, presented) in &presented {
|
||||
writeln!(
|
||||
|
||||
@@ -21,7 +21,7 @@ use std::net::TcpStream;
|
||||
use std::num::NonZeroUsize;
|
||||
use std::str::FromStr;
|
||||
|
||||
use rustls::Stream;
|
||||
use rustls::{ClientConnection, Stream};
|
||||
use rustls_pki_types::CertificateDer;
|
||||
|
||||
use crate::transcript::Transcript;
|
||||
@@ -64,19 +64,19 @@ pub enum Transport {
|
||||
}
|
||||
|
||||
impl Transport {
|
||||
/// The dialogue line asking for this transport, without its line end,
|
||||
/// and the whole reply granting it.
|
||||
///
|
||||
/// With `vpxa`, it is asked of vpxa, the vCenter's agent on the host,
|
||||
/// instead of hostd: the hostd of an ESXi 6.5 or 6.7 host drops a
|
||||
/// ticket its vCenter issued as not found, since the vCenter
|
||||
/// registered it with vpxa.
|
||||
const fn proxy(self, vpxa: bool) -> (&'static str, &'static str) {
|
||||
match (self, vpxa) {
|
||||
(Transport::Nfcssl, false) => ("PROXY nfcssl", "200 Connect ha-nfcssl"),
|
||||
(Transport::Nfc, false) => ("PROXY nfc", "200 Connect ha-nfc"),
|
||||
(Transport::Nfcssl, true) => ("PROXY vpxa-nfcssl", "200 Connect vpxa-nfcssl"),
|
||||
(Transport::Nfc, true) => ("PROXY vpxa-nfc", "200 Connect vpxa-nfc"),
|
||||
/// The dialogue line asking for this transport, without its line end.
|
||||
const fn proxy(self) -> &'static str {
|
||||
match self {
|
||||
Transport::Nfcssl => "PROXY nfcssl",
|
||||
Transport::Nfc => "PROXY nfc",
|
||||
}
|
||||
}
|
||||
|
||||
/// The whole reply granting this transport; nothing else is written before it.
|
||||
const fn granted(self) -> &'static str {
|
||||
match self {
|
||||
Transport::Nfcssl => "200 Connect ha-nfcssl",
|
||||
Transport::Nfc => "200 Connect ha-nfc",
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -171,11 +171,6 @@ pub enum Error {
|
||||
/// The SHA-256 thumbprint of the certificate the first session verified.
|
||||
presented: String,
|
||||
},
|
||||
/// The connection reopened for RSA key exchange was greeted differently.
|
||||
#[error(
|
||||
"greeting: the host announced other capabilities on the connection reopened for RSA key exchange"
|
||||
)]
|
||||
GreetingChanged,
|
||||
/// The second TLS session did not present the certificate the first one did.
|
||||
#[error("the second tls session presented another certificate than the first")]
|
||||
Certificate,
|
||||
@@ -335,54 +330,14 @@ pub fn read_greeting<R: Read>(reader: &mut R) -> Result<greeting::Greeting, Erro
|
||||
/// Reads a host's data-port greeting, then captures the certificate TLS presents.
|
||||
///
|
||||
/// TLS starts on the same connection right after the greeting line,
|
||||
/// whatever capabilities it announces. A host that refuses the ECDHE suites
|
||||
/// is asked again on a new connection, with RSA key exchange, which
|
||||
/// `transcript` says under the port's number. That connection must be
|
||||
/// greeted as the first one was.
|
||||
/// whatever capabilities it announces.
|
||||
///
|
||||
/// # Errors
|
||||
/// When connecting, reading the greeting or the TLS handshake fails, or the
|
||||
/// reopened connection is greeted differently.
|
||||
pub(crate) fn capture(
|
||||
host: &str,
|
||||
port: u16,
|
||||
transcript: Transcript,
|
||||
) -> Result<tls::Presented, Error> {
|
||||
/// When connecting, reading the greeting or the TLS handshake fails.
|
||||
pub(crate) fn capture(host: &str, port: u16) -> Result<tls::Presented, Error> {
|
||||
let mut stream = tls::connect(host, port)?;
|
||||
let greeted = read_greeting(&mut stream)?;
|
||||
match tls::capture(&mut stream, host) {
|
||||
Err(error) if error.refused_suites() => {
|
||||
transcript.fallback(&port.to_string());
|
||||
let (stream, again) = greet_again(host, port)?;
|
||||
// Another greeting means another peer: its certificate is not
|
||||
// the data port's.
|
||||
if again != greeted {
|
||||
return Err(Error::GreetingChanged);
|
||||
}
|
||||
Ok(tls::capture_rsa_kx(&stream)?)
|
||||
}
|
||||
presented => Ok(presented?),
|
||||
}
|
||||
}
|
||||
|
||||
/// Opens a new connection to a host that refused the ECDHE suites, past its greeting.
|
||||
///
|
||||
/// The refusal is a fatal alert, after which the host closes the connection,
|
||||
/// so the RSA key exchange retry cannot reuse it. The greeting read on the
|
||||
/// new connection is returned for the caller to compare with the first one.
|
||||
fn greet_again(host: &str, port: u16) -> Result<(TcpStream, greeting::Greeting), Error> {
|
||||
let mut stream = tls::connect(host, port)?;
|
||||
let greeted = read_greeting(&mut stream)?;
|
||||
Ok((stream, greeted))
|
||||
}
|
||||
|
||||
/// The byte stream of `session`, whose records travel on `stream`.
|
||||
fn wire<'a>(session: &'a mut tls::Session, stream: &'a mut TcpStream) -> Box<dyn Wire + 'a> {
|
||||
match session {
|
||||
tls::Session::Ecdhe(connection) => Box::new(Stream::new(&mut **connection, stream)),
|
||||
// The session owns its clone of the socket.
|
||||
tls::Session::RsaKx(session) => Box::new(session),
|
||||
}
|
||||
read_greeting(&mut stream)?;
|
||||
Ok(tls::capture(&mut stream, host)?)
|
||||
}
|
||||
|
||||
/// An established data session, ready to open a disk.
|
||||
@@ -398,7 +353,7 @@ pub struct Connection {
|
||||
/// What carries the disk session: the second TLS session, or the socket in clear.
|
||||
#[derive(Debug)]
|
||||
enum Plane {
|
||||
Tls(tls::Session),
|
||||
Tls(Box<ClientConnection>),
|
||||
Clear,
|
||||
}
|
||||
|
||||
@@ -415,14 +370,9 @@ impl Connection {
|
||||
/// present the certificate `pin` names, which is the ticket's thumbprint;
|
||||
/// `secret` is the ticket presented in that session. With `nfcssl` the
|
||||
/// second TLS session must present the same certificate; with `nfc` the
|
||||
/// connection goes on in clear. A host that refuses the ECDHE suites is
|
||||
/// connected to again and both sessions use RSA key exchange, under the
|
||||
/// same pin. `vcenter` says a vCenter issued the ticket: a legacy host
|
||||
/// is then asked for the transport of vpxa, the vCenter's agent on the
|
||||
/// host; since vCenter 7.0 U1, hostd serves a vCenter's tickets, as it
|
||||
/// does a host's own. The handshake, hello, version and capabilities
|
||||
/// exchanges follow, each waiting for its reply; a legacy host gets the
|
||||
/// start of the handshake alone.
|
||||
/// connection goes on in clear. The handshake, hello, version and
|
||||
/// capabilities exchanges follow, each waiting for its reply; a legacy
|
||||
/// host gets the start of the handshake alone.
|
||||
///
|
||||
/// # Errors
|
||||
/// When any phase fails, naming that phase.
|
||||
@@ -432,7 +382,6 @@ impl Connection {
|
||||
secret: &str,
|
||||
pin: &tls::Pin,
|
||||
transport: Transport,
|
||||
vcenter: bool,
|
||||
transcript: Transcript,
|
||||
) -> Result<Connection, Error> {
|
||||
let mut stream = tls::connect(host, port)?;
|
||||
@@ -446,53 +395,33 @@ impl Connection {
|
||||
greeted.require(greeting::NFCSSL_SUPPORTED)?;
|
||||
}
|
||||
let client = tls::Client::new(&tls::Trust::Pin(pin.clone()))?;
|
||||
let mut first = match client.handshake(&mut stream, host) {
|
||||
Ok(connection) => tls::Session::Ecdhe(Box::new(connection)),
|
||||
Err(error) if error.refused_suites() => {
|
||||
transcript.fallback("first session");
|
||||
let (reopened, again) = greet_again(host, port)?;
|
||||
// The dialect and transport were chosen from the first
|
||||
// greeting: another one means another peer or another state.
|
||||
if again != greeted {
|
||||
return Err(Error::GreetingChanged);
|
||||
}
|
||||
stream = reopened;
|
||||
tls::rsa_kx(&stream, pin)?
|
||||
}
|
||||
Err(error) => return Err(error.into()),
|
||||
};
|
||||
let (version, suite) = first.negotiated()?;
|
||||
let mut first = client.handshake(&mut stream, host)?;
|
||||
let (version, suite) = tls::negotiated(&first)?;
|
||||
transcript.tls("first session", version, suite);
|
||||
let certificate = first.certificate()?;
|
||||
let certificate = tls::peer_certificate(&first)?;
|
||||
let tag = draw_tag()?;
|
||||
dialogue(
|
||||
&mut wire(&mut first, &mut stream),
|
||||
&mut Stream::new(&mut first, &mut stream),
|
||||
secret,
|
||||
&tag,
|
||||
&certificate,
|
||||
transport.proxy(vcenter && dialect == Dialect::Legacy),
|
||||
transport,
|
||||
dialect,
|
||||
transcript,
|
||||
)?;
|
||||
// The PROXY reply is the last thing the host sends in the first
|
||||
// session, so nothing of it is left unread; dropping the connection
|
||||
// without a close notify keeps the stream clear for what follows.
|
||||
let fallback = matches!(first, tls::Session::RsaKx(_));
|
||||
drop(first);
|
||||
let plane = match transport {
|
||||
Transport::Nfcssl => {
|
||||
// The host that refused ECDHE once is not offered it again.
|
||||
let session = if fallback {
|
||||
tls::rsa_kx(&stream, pin)?
|
||||
} else {
|
||||
tls::Session::Ecdhe(Box::new(client.handshake(&mut stream, host)?))
|
||||
};
|
||||
let (version, suite) = session.negotiated()?;
|
||||
let session = client.handshake(&mut stream, host)?;
|
||||
let (version, suite) = tls::negotiated(&session)?;
|
||||
transcript.tls("second session", version, suite);
|
||||
if session.certificate()? != certificate {
|
||||
if tls::peer_certificate(&session)? != certificate {
|
||||
return Err(Error::Certificate);
|
||||
}
|
||||
Plane::Tls(session)
|
||||
Plane::Tls(Box::new(session))
|
||||
}
|
||||
Transport::Nfc => Plane::Clear,
|
||||
};
|
||||
@@ -658,7 +587,7 @@ impl Connection {
|
||||
|
||||
fn data(&mut self) -> Box<dyn Wire + '_> {
|
||||
match &mut self.plane {
|
||||
Plane::Tls(session) => wire(session, &mut self.stream),
|
||||
Plane::Tls(session) => Box::new(Stream::new(&mut **session, &mut self.stream)),
|
||||
Plane::Clear => Box::new(&mut self.stream),
|
||||
}
|
||||
}
|
||||
@@ -728,14 +657,14 @@ fn draw_tag() -> Result<[u8; handshake::TAG_LEN], Error> {
|
||||
/// `200 <hash>`, where the hash must be the SHA-256 thumbprint of the
|
||||
/// certificate this session verified; a legacy host is asked `THUMBPRINT
|
||||
/// <tag>` instead, and its reply, a SHA-1 hash, must only start with `200 `.
|
||||
/// The `PROXY` line, from [`Transport::proxy`], must be answered with
|
||||
/// exactly the line granting it; nothing else is written before that.
|
||||
/// The `PROXY` line asking for `transport` must be answered with exactly
|
||||
/// the line granting it; nothing else is written before that.
|
||||
fn dialogue<S: Read + Write>(
|
||||
stream: &mut S,
|
||||
secret: &str,
|
||||
tag: &[u8; handshake::TAG_LEN],
|
||||
certificate: &CertificateDer<'_>,
|
||||
(proxy, granted): (&'static str, &'static str),
|
||||
transport: Transport,
|
||||
dialect: Dialect,
|
||||
transcript: Transcript,
|
||||
) -> Result<(), Error> {
|
||||
@@ -776,13 +705,17 @@ fn dialogue<S: Read + Write>(
|
||||
});
|
||||
}
|
||||
}
|
||||
send(stream, format!("{proxy}\r\n").as_bytes(), "dialogue")?;
|
||||
transcript.sent(proxy);
|
||||
send(
|
||||
stream,
|
||||
format!("{}\r\n", transport.proxy()).as_bytes(),
|
||||
"dialogue",
|
||||
)?;
|
||||
transcript.sent(transport.proxy());
|
||||
let answer = reply(stream)?;
|
||||
transcript.received(&answer);
|
||||
if answer != granted {
|
||||
if answer != transport.granted() {
|
||||
return Err(Error::Dialogue {
|
||||
command: proxy,
|
||||
command: transport.proxy(),
|
||||
reply: answer,
|
||||
});
|
||||
}
|
||||
@@ -1197,76 +1130,10 @@ mod tests {
|
||||
use super::*;
|
||||
use greeting::ESXI_8;
|
||||
use std::io::Cursor;
|
||||
use std::net::TcpListener;
|
||||
use std::thread;
|
||||
|
||||
const TAG: &[u8; 16] = b"ABCDEFGHIJKLMNOP";
|
||||
const QUIET: Transcript = Transcript::new(false);
|
||||
|
||||
/// A fatal `handshake_failure` alert, as one TLS 1.2 record.
|
||||
const HANDSHAKE_FAILURE: [u8; 7] = [0x15, 0x03, 0x03, 0x00, 0x02, 0x02, 0x28];
|
||||
|
||||
/// A host that refuses ECDHE, then greets the reopened connection as another peer.
|
||||
///
|
||||
/// Returns its port and what the client wrote on the reopened connection.
|
||||
fn greeting_differently_after_refusing_ecdhe() -> (u16, thread::JoinHandle<Vec<u8>>) {
|
||||
let listener = TcpListener::bind("127.0.0.1:0").unwrap();
|
||||
let port = listener.local_addr().unwrap().port();
|
||||
let host = thread::spawn(move || {
|
||||
let (mut first, _) = listener.accept().unwrap();
|
||||
first.write_all(ESXI_8).unwrap();
|
||||
let mut header = [0_u8; 5];
|
||||
first.read_exact(&mut header).unwrap();
|
||||
let mut hello = vec![0_u8; usize::from(u16::from_be_bytes([header[3], header[4]]))];
|
||||
first.read_exact(&mut hello).unwrap();
|
||||
first.write_all(&HANDSHAKE_FAILURE).unwrap();
|
||||
drop(first);
|
||||
let (mut second, _) = listener.accept().unwrap();
|
||||
second
|
||||
.write_all(b"220 VMware Authentication Daemon Version 1.10: SSL Required, NFCSSL supported/t\r\n")
|
||||
.unwrap();
|
||||
let mut received = Vec::new();
|
||||
// The client leaves at once; whatever it wrote first is returned.
|
||||
let _ = second.read_to_end(&mut received);
|
||||
received
|
||||
});
|
||||
(port, host)
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_host_greeting_differently_after_refusing_ecdhe_is_not_offered_rsa_key_exchange() {
|
||||
let (port, host) = greeting_differently_after_refusing_ecdhe();
|
||||
let pin = tls::Pin::sha256(&tls::sha256(b"a certificate")).unwrap();
|
||||
|
||||
let error = Connection::establish(
|
||||
"127.0.0.1",
|
||||
port,
|
||||
"ticket",
|
||||
&pin,
|
||||
Transport::Nfcssl,
|
||||
false,
|
||||
QUIET,
|
||||
)
|
||||
.unwrap_err();
|
||||
|
||||
assert!(matches!(error, Error::GreetingChanged), "{error:?}");
|
||||
assert_eq!(
|
||||
error.to_string(),
|
||||
"greeting: the host announced other capabilities on the connection reopened for RSA key exchange"
|
||||
);
|
||||
assert!(host.join().unwrap().is_empty(), "no handshake was started");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_capture_greeted_differently_after_refusing_ecdhe_reports_no_thumbprint() {
|
||||
let (port, host) = greeting_differently_after_refusing_ecdhe();
|
||||
|
||||
let error = capture("127.0.0.1", port, QUIET).unwrap_err();
|
||||
|
||||
assert!(matches!(error, Error::GreetingChanged), "{error:?}");
|
||||
assert!(host.join().unwrap().is_empty(), "no handshake was started");
|
||||
}
|
||||
|
||||
/// A scripted peer: replies come from `input`, each write the client makes lands in `writes`.
|
||||
///
|
||||
/// Reads time out until `unlock_at` bytes have been written, the way a
|
||||
@@ -1436,7 +1303,7 @@ mod tests {
|
||||
"ticket-0",
|
||||
TAG,
|
||||
&certificate(),
|
||||
Transport::Nfcssl.proxy(false),
|
||||
Transport::Nfcssl,
|
||||
Dialect::Modern,
|
||||
QUIET,
|
||||
)
|
||||
@@ -1461,7 +1328,7 @@ mod tests {
|
||||
"ticket-0",
|
||||
TAG,
|
||||
&certificate(),
|
||||
Transport::Nfc.proxy(false),
|
||||
Transport::Nfc,
|
||||
Dialect::Modern,
|
||||
QUIET,
|
||||
)
|
||||
@@ -1483,7 +1350,7 @@ mod tests {
|
||||
"ticket-0",
|
||||
TAG,
|
||||
&certificate(),
|
||||
Transport::Nfc.proxy(false),
|
||||
Transport::Nfc,
|
||||
Dialect::Modern,
|
||||
QUIET,
|
||||
)
|
||||
@@ -1504,7 +1371,7 @@ mod tests {
|
||||
"ticket-0",
|
||||
TAG,
|
||||
&certificate(),
|
||||
Transport::Nfcssl.proxy(false),
|
||||
Transport::Nfcssl,
|
||||
Dialect::Modern,
|
||||
QUIET,
|
||||
)
|
||||
@@ -1526,7 +1393,7 @@ mod tests {
|
||||
"ticket-0",
|
||||
TAG,
|
||||
&certificate(),
|
||||
Transport::Nfcssl.proxy(false),
|
||||
Transport::Nfcssl,
|
||||
Dialect::Modern,
|
||||
QUIET,
|
||||
)
|
||||
@@ -1549,7 +1416,7 @@ mod tests {
|
||||
"ticket-0",
|
||||
TAG,
|
||||
&certificate(),
|
||||
Transport::Nfcssl.proxy(false),
|
||||
Transport::Nfcssl,
|
||||
Dialect::Modern,
|
||||
QUIET,
|
||||
)
|
||||
@@ -1578,7 +1445,7 @@ mod tests {
|
||||
"ticket-0",
|
||||
TAG,
|
||||
&certificate(),
|
||||
Transport::Nfcssl.proxy(false),
|
||||
Transport::Nfcssl,
|
||||
Dialect::Modern,
|
||||
QUIET,
|
||||
)
|
||||
@@ -1599,7 +1466,7 @@ mod tests {
|
||||
"ticket-0",
|
||||
TAG,
|
||||
&certificate(),
|
||||
Transport::Nfcssl.proxy(false),
|
||||
Transport::Nfcssl,
|
||||
Dialect::Modern,
|
||||
QUIET,
|
||||
)
|
||||
@@ -2139,7 +2006,7 @@ mod tests {
|
||||
"ticket-0",
|
||||
TAG,
|
||||
&certificate(),
|
||||
Transport::Nfcssl.proxy(false),
|
||||
Transport::Nfcssl,
|
||||
Dialect::Legacy,
|
||||
QUIET,
|
||||
)
|
||||
@@ -2160,7 +2027,7 @@ mod tests {
|
||||
"ticket-0",
|
||||
TAG,
|
||||
&certificate(),
|
||||
Transport::Nfcssl.proxy(false),
|
||||
Transport::Nfcssl,
|
||||
Dialect::Legacy,
|
||||
QUIET,
|
||||
)
|
||||
|
||||
@@ -139,7 +139,6 @@ fn export<R: Read + Send + 'static, W: Write>(
|
||||
&ticket.secret,
|
||||
&ticket.thumbprint,
|
||||
target.transport,
|
||||
session.vcenter(),
|
||||
target.transcript,
|
||||
)?;
|
||||
let disk = match connection.open(&target.disk) {
|
||||
|
||||
@@ -144,7 +144,6 @@ pub struct Session {
|
||||
port: u16,
|
||||
client: tls::Client,
|
||||
manager: String,
|
||||
vcenter: bool,
|
||||
cookie: Cookie,
|
||||
transcript: Transcript,
|
||||
}
|
||||
@@ -174,7 +173,7 @@ impl Session {
|
||||
&this(SERVICE_INSTANCE, SERVICE_INSTANCE),
|
||||
transcript,
|
||||
)?;
|
||||
let (manager, vcenter) = service_content(&String::from_utf8_lossy(&content.body))?;
|
||||
let manager = service_content(&String::from_utf8_lossy(&content.body))?;
|
||||
let inner = format!(
|
||||
"{}<userName>{}</userName><password>{}</password>",
|
||||
this("SessionManager", &manager),
|
||||
@@ -199,18 +198,11 @@ impl Session {
|
||||
port,
|
||||
client,
|
||||
manager,
|
||||
vcenter,
|
||||
cookie: Cookie(cookie),
|
||||
transcript,
|
||||
})
|
||||
}
|
||||
|
||||
/// Whether a vCenter answered, as its service content's `about.apiType` states.
|
||||
#[must_use]
|
||||
pub const fn vcenter(&self) -> bool {
|
||||
self.vcenter
|
||||
}
|
||||
|
||||
/// Asks the NFC service for a fresh ticket to the files of the VM `vm_id` names.
|
||||
///
|
||||
/// # Errors
|
||||
@@ -311,15 +303,12 @@ fn this(kind: &str, reference: &str) -> String {
|
||||
format!("<_this type=\"{kind}\">{}</_this>", escape(reference))
|
||||
}
|
||||
|
||||
/// Returns the session manager the service content names, and whether
|
||||
/// `about.apiType` says a vCenter answered.
|
||||
fn service_content(content: &str) -> Result<(String, bool), Error> {
|
||||
let manager = element(content, "sessionManager").ok_or(Error::Missing {
|
||||
/// Returns the session manager the service content names.
|
||||
fn service_content(content: &str) -> Result<String, Error> {
|
||||
element(content, "sessionManager").ok_or(Error::Missing {
|
||||
call: "RetrieveServiceContent",
|
||||
element: "sessionManager",
|
||||
})?;
|
||||
let vcenter = element(content, "apiType").as_deref() == Some("VirtualCenter");
|
||||
Ok((manager, vcenter))
|
||||
})
|
||||
}
|
||||
|
||||
/// Reads the ticket out of an `NfcGetVmFiles` reply.
|
||||
@@ -409,7 +398,6 @@ mod tests {
|
||||
))
|
||||
.unwrap(),
|
||||
manager: "ha-sessionmgr".to_owned(),
|
||||
vcenter: false,
|
||||
cookie: Cookie("vmware_soap_session=\"mock-cookie\"".to_owned()),
|
||||
transcript: Transcript::new(false),
|
||||
};
|
||||
@@ -486,22 +474,16 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn an_esxi_service_content_yields_its_session_manager() {
|
||||
assert_eq!(
|
||||
service_content(SERVICE_CONTENT).unwrap(),
|
||||
("ha-sessionmgr".to_owned(), false)
|
||||
);
|
||||
assert_eq!(service_content(SERVICE_CONTENT).unwrap(), "ha-sessionmgr");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_vcenter_service_content_yields_its_session_manager_and_says_so() {
|
||||
fn a_vcenter_service_content_yields_its_session_manager() {
|
||||
let content = SERVICE_CONTENT
|
||||
.replace("HostAgent", "VirtualCenter")
|
||||
.replace("ha-sessionmgr", "SessionManager");
|
||||
|
||||
assert_eq!(
|
||||
service_content(&content).unwrap(),
|
||||
("SessionManager".to_owned(), true)
|
||||
);
|
||||
assert_eq!(service_content(&content).unwrap(), "SessionManager");
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
@@ -5,10 +5,6 @@
|
||||
//! accept-everything verifier never leaves this module: [`capture`] runs a TLS
|
||||
//! handshake with it, sends nothing afterwards and drops the connection
|
||||
//! before returning.
|
||||
//!
|
||||
//! rustls only knows ECDHE key exchange. A data port that refuses it is
|
||||
//! retried through [`rsa_kx`], which the `legacy` module runs on OpenSSL; a
|
||||
//! [`Session`] is either of the two.
|
||||
|
||||
use std::fmt;
|
||||
use std::io;
|
||||
@@ -17,19 +13,15 @@ use std::sync::{Arc, Mutex, PoisonError};
|
||||
use std::time::Duration;
|
||||
|
||||
use aws_lc_rs::digest;
|
||||
use openssl::error::ErrorStack;
|
||||
use openssl::ssl::SslStream;
|
||||
use rustls::client::danger::{HandshakeSignatureValid, ServerCertVerified, ServerCertVerifier};
|
||||
use rustls::crypto::aws_lc_rs::default_provider;
|
||||
use rustls::crypto::{CryptoProvider, verify_tls12_signature, verify_tls13_signature};
|
||||
use rustls::{
|
||||
AlertDescription, CertificateError, CipherSuite, ClientConfig, ClientConnection,
|
||||
DigitallySignedStruct, ProtocolVersion, RootCertStore, SignatureScheme,
|
||||
CertificateError, CipherSuite, ClientConfig, ClientConnection, DigitallySignedStruct,
|
||||
ProtocolVersion, RootCertStore, SignatureScheme,
|
||||
};
|
||||
use rustls_pki_types::{CertificateDer, InvalidDnsNameError, ServerName, UnixTime};
|
||||
|
||||
mod legacy;
|
||||
|
||||
/// How long a TCP connect may take before the host counts as unreachable.
|
||||
///
|
||||
/// Ten seconds: a host on the same network answers within milliseconds, and
|
||||
@@ -83,68 +75,6 @@ pub enum Error {
|
||||
/// rustls rejected the client configuration.
|
||||
#[error("tls configuration rejected: {0}")]
|
||||
Config(#[source] rustls::Error),
|
||||
/// OpenSSL rejected the configuration of the RSA key exchange fallback.
|
||||
#[error("tls configuration rejected: {0}")]
|
||||
LegacyConfig(#[source] ErrorStack),
|
||||
/// The host refused the ECDHE suites, then the RSA key exchange ones.
|
||||
#[error("host refused every supported TLS suite (ECDHE, then RSA key exchange with AES-GCM)")]
|
||||
NoCommonSuite,
|
||||
}
|
||||
|
||||
impl Error {
|
||||
/// Whether the host answered the handshake with a `handshake_failure` alert.
|
||||
///
|
||||
/// That alert is how a server says it shares no cipher suite with the
|
||||
/// client. Nothing else counts: a refused certificate, a closed socket or
|
||||
/// a timeout must never lead to the RSA key exchange fallback.
|
||||
#[must_use]
|
||||
pub(crate) fn refused_suites(&self) -> bool {
|
||||
let Error::TlsHandshake(error) = self else {
|
||||
return false;
|
||||
};
|
||||
error
|
||||
.get_ref()
|
||||
.and_then(|inner| inner.downcast_ref::<rustls::Error>())
|
||||
.is_some_and(|inner| {
|
||||
matches!(
|
||||
inner,
|
||||
rustls::Error::AlertReceived(AlertDescription::HandshakeFailure)
|
||||
)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
/// A completed TLS session on a data port, by the stack that negotiated it.
|
||||
#[derive(Debug)]
|
||||
pub(crate) enum Session {
|
||||
/// rustls, with ECDHE key exchange: every host that offers it.
|
||||
Ecdhe(Box<ClientConnection>),
|
||||
/// OpenSSL, with RSA key exchange: a host that refused ECDHE.
|
||||
RsaKx(SslStream<TcpStream>),
|
||||
}
|
||||
|
||||
impl Session {
|
||||
/// The protocol version and cipher suite the session negotiated.
|
||||
///
|
||||
/// # Errors
|
||||
/// When the session has not completed its handshake.
|
||||
pub(crate) fn negotiated(&self) -> Result<(ProtocolVersion, CipherSuite), Error> {
|
||||
match self {
|
||||
Session::Ecdhe(connection) => negotiated(connection),
|
||||
Session::RsaKx(session) => legacy::negotiated(session),
|
||||
}
|
||||
}
|
||||
|
||||
/// The first certificate of the chain the peer sent, DER encoded.
|
||||
///
|
||||
/// # Errors
|
||||
/// When the session carries no certificate.
|
||||
pub(crate) fn certificate(&self) -> Result<CertificateDer<'static>, Error> {
|
||||
match self {
|
||||
Session::Ecdhe(connection) => peer_certificate(connection),
|
||||
Session::RsaKx(session) => legacy::certificate(session),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// What a host presented during a TLS handshake that carried nothing else.
|
||||
@@ -398,38 +328,6 @@ pub(crate) fn capture(stream: &mut TcpStream, host: &str) -> Result<Presented, E
|
||||
})
|
||||
}
|
||||
|
||||
/// Runs a TLS 1.2 handshake with RSA key exchange on `stream`, pinned to `pin`.
|
||||
///
|
||||
/// For a host that refused the ECDHE suites, on a fresh connection: the
|
||||
/// refusal closed the first one. The session has no forward secrecy. Nothing
|
||||
/// is written after the handshake when the certificate is not the pinned one.
|
||||
///
|
||||
/// # Errors
|
||||
/// When the host refuses these suites too, presents another certificate, or
|
||||
/// the TLS handshake fails or times out.
|
||||
pub(crate) fn rsa_kx(stream: &TcpStream, pin: &Pin) -> Result<Session, Error> {
|
||||
legacy::handshake(stream, Some(pin)).map(Session::RsaKx)
|
||||
}
|
||||
|
||||
/// What a host that refused the ECDHE suites presents with RSA key exchange.
|
||||
///
|
||||
/// The counterpart of [`capture`]: any certificate is accepted, nothing is
|
||||
/// sent after the TLS handshake, and the session is dropped on return.
|
||||
///
|
||||
/// # Errors
|
||||
/// When the host refuses these suites too, or the TLS handshake fails, times
|
||||
/// out or ends without a certificate.
|
||||
pub(crate) fn capture_rsa_kx(stream: &TcpStream) -> Result<Presented, Error> {
|
||||
let session = legacy::handshake(stream, None)?;
|
||||
let certificate = legacy::certificate(&session)?;
|
||||
let (version, suite) = legacy::negotiated(&session)?;
|
||||
Ok(Presented {
|
||||
certificate,
|
||||
version,
|
||||
suite,
|
||||
})
|
||||
}
|
||||
|
||||
/// The protocol version and cipher suite a completed session negotiated.
|
||||
///
|
||||
/// # Errors
|
||||
@@ -707,10 +605,6 @@ mod tests {
|
||||
sha1(&certificate)
|
||||
)
|
||||
);
|
||||
assert!(
|
||||
!error.refused_suites(),
|
||||
"a refused certificate never leads to the fallback"
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -745,33 +639,6 @@ mod tests {
|
||||
assert!(matches!(error, Error::TlsHandshake(_)), "{error:?}");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn only_a_handshake_failure_alert_counts_as_refused_suites() {
|
||||
let alert = |description| {
|
||||
Error::TlsHandshake(io::Error::other(rustls::Error::AlertReceived(description)))
|
||||
};
|
||||
assert!(alert(AlertDescription::HandshakeFailure).refused_suites());
|
||||
for other in [
|
||||
AlertDescription::BadCertificate,
|
||||
AlertDescription::ProtocolVersion,
|
||||
AlertDescription::InsufficientSecurity,
|
||||
AlertDescription::InternalError,
|
||||
] {
|
||||
assert!(!alert(other).refused_suites(), "{other:?}");
|
||||
}
|
||||
for kind in [
|
||||
io::ErrorKind::ConnectionReset,
|
||||
io::ErrorKind::UnexpectedEof,
|
||||
io::ErrorKind::TimedOut,
|
||||
] {
|
||||
assert!(
|
||||
!Error::TlsHandshake(kind.into()).refused_suites(),
|
||||
"{kind:?}"
|
||||
);
|
||||
}
|
||||
assert!(!Error::NoCommonSuite.refused_suites());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_timeout_is_described_as_such_and_other_errors_keep_their_message() {
|
||||
let timeout = io::Error::from(io::ErrorKind::WouldBlock);
|
||||
|
||||
@@ -1,326 +0,0 @@
|
||||
//! TLS 1.2 with RSA key exchange, for a data port that offers nothing else.
|
||||
//!
|
||||
//! The data port of some ESXi 6.5 hosts accepts no ECDHE suite, and rustls
|
||||
//! implements no other key exchange. This module runs the handshake with
|
||||
//! OpenSSL instead, restricted to the two AES-GCM suites of RFC 5288 that use
|
||||
//! RSA key exchange. Such a session has no forward secrecy: whoever later
|
||||
//! obtains the host's private key can decrypt a recording of it.
|
||||
//!
|
||||
//! No chain and no host name are checked here. The certificate is judged by
|
||||
//! its thumbprint alone, before the session is handed to the caller. The
|
||||
//! handshake has by then sent `ClientKeyExchange` and `Finished`, but no
|
||||
//! ticket and no application data reach a host that presented another
|
||||
//! certificate.
|
||||
|
||||
// Rust guideline compliant 2026-10-09
|
||||
|
||||
use std::io;
|
||||
use std::net::TcpStream;
|
||||
|
||||
use openssl::error::ErrorStack;
|
||||
use openssl::ssl::{
|
||||
HandshakeError, Ssl, SslContext, SslMethod, SslStream, SslVerifyMode, SslVersion,
|
||||
};
|
||||
use rustls::{CipherSuite, ProtocolVersion};
|
||||
use rustls_pki_types::CertificateDer;
|
||||
|
||||
use super::{Error, Pin};
|
||||
|
||||
/// The suites offered, in OpenSSL's names: RSA key exchange with AES-GCM.
|
||||
///
|
||||
/// `TLS_RSA_WITH_AES_256_GCM_SHA384` and `TLS_RSA_WITH_AES_128_GCM_SHA256`.
|
||||
/// The CBC suites a host may also accept are left out: they would add the
|
||||
/// padding-oracle exposure of MAC-then-encrypt for no host known to need them.
|
||||
const SUITES: &str = "AES256-GCM-SHA384:AES128-GCM-SHA256";
|
||||
|
||||
/// OpenSSL's reason code for a `handshake_failure` alert received from the peer.
|
||||
///
|
||||
/// `SSL_R_SSLV3_ALERT_HANDSHAKE_FAILURE`: 1000 (`SSL_AD_REASON_OFFSET`) plus
|
||||
/// the alert's number, 40. A server sends this alert when it shares no suite
|
||||
/// with the client.
|
||||
const HANDSHAKE_FAILURE_ALERT: i32 = 1040;
|
||||
|
||||
/// OpenSSL's number for its SSL library, `ERR_LIB_SSL`.
|
||||
///
|
||||
/// Reason codes are numbered per library: 1040 names the alert only in an
|
||||
/// error the SSL library raised.
|
||||
const SSL_LIBRARY: i32 = 20;
|
||||
|
||||
/// Runs the TLS handshake on a clone of `stream` and returns the session.
|
||||
///
|
||||
/// With a `pin`, the certificate presented must match it; without one any
|
||||
/// certificate is accepted, which only a thumbprint capture wants. The
|
||||
/// session owns its clone of the socket: dropping it sends no close notify
|
||||
/// and leaves `stream` open.
|
||||
///
|
||||
/// # Errors
|
||||
/// When the host refuses both suites, presents another certificate than the
|
||||
/// pinned one, or the handshake fails or times out.
|
||||
pub(super) fn handshake(
|
||||
stream: &TcpStream,
|
||||
pin: Option<&Pin>,
|
||||
) -> Result<SslStream<TcpStream>, Error> {
|
||||
let ssl = configure().map_err(Error::LegacyConfig)?;
|
||||
let socket = stream.try_clone().map_err(Error::TlsHandshake)?;
|
||||
let session = ssl.connect(socket).map_err(failure)?;
|
||||
if let Some(pin) = pin {
|
||||
let presented = certificate(&session)?;
|
||||
if !pin.matches(&presented) {
|
||||
return Err(Error::Mismatch {
|
||||
expected: pin.clone(),
|
||||
presented: pin.digest_of(&presented),
|
||||
});
|
||||
}
|
||||
}
|
||||
Ok(session)
|
||||
}
|
||||
|
||||
/// The first certificate the peer of `session` sent, DER encoded.
|
||||
///
|
||||
/// # Errors
|
||||
/// When the session carries no certificate.
|
||||
pub(super) fn certificate(
|
||||
session: &SslStream<TcpStream>,
|
||||
) -> Result<CertificateDer<'static>, Error> {
|
||||
session
|
||||
.ssl()
|
||||
.peer_certificate()
|
||||
.and_then(|certificate| certificate.to_der().ok())
|
||||
.map(CertificateDer::from)
|
||||
.ok_or(Error::Incomplete("a certificate"))
|
||||
}
|
||||
|
||||
/// The protocol version and cipher suite `session` negotiated.
|
||||
///
|
||||
/// # Errors
|
||||
/// When the session reports no suite, or another version than TLS 1.2.
|
||||
pub(super) fn negotiated(
|
||||
session: &SslStream<TcpStream>,
|
||||
) -> Result<(ProtocolVersion, CipherSuite), Error> {
|
||||
if session.ssl().version2() != Some(SslVersion::TLS1_2) {
|
||||
return Err(Error::Incomplete("a protocol version"));
|
||||
}
|
||||
let suite = session
|
||||
.ssl()
|
||||
.current_cipher()
|
||||
.ok_or(Error::Incomplete("a cipher suite"))?;
|
||||
Ok((
|
||||
ProtocolVersion::TLSv1_2,
|
||||
CipherSuite::from(u16::from_be_bytes(suite.protocol_id())),
|
||||
))
|
||||
}
|
||||
|
||||
/// A client restricted to TLS 1.2 and [`SUITES`], with no chain verification.
|
||||
fn configure() -> Result<Ssl, ErrorStack> {
|
||||
let mut context = SslContext::builder(SslMethod::tls_client())?;
|
||||
context.set_min_proto_version(Some(SslVersion::TLS1_2))?;
|
||||
context.set_max_proto_version(Some(SslVersion::TLS1_2))?;
|
||||
context.set_cipher_list(SUITES)?;
|
||||
// The thumbprint is the whole verdict, given by `handshake`.
|
||||
context.set_verify(SslVerifyMode::NONE);
|
||||
Ssl::new(&context.build())
|
||||
}
|
||||
|
||||
/// Turns a failed handshake into the error that names its cause.
|
||||
fn failure(error: HandshakeError<TcpStream>) -> Error {
|
||||
match error {
|
||||
HandshakeError::SetupFailure(stack) => Error::LegacyConfig(stack),
|
||||
// The socket carries a timeout, which OpenSSL reports as a retry.
|
||||
HandshakeError::WouldBlock(_) => Error::TlsHandshake(io::ErrorKind::TimedOut.into()),
|
||||
HandshakeError::Failure(interrupted) => {
|
||||
let error = interrupted.into_error();
|
||||
let refused = error.ssl_error().is_some_and(|stack| {
|
||||
stack
|
||||
.errors()
|
||||
.iter()
|
||||
.any(|entry| is_refusal(entry.library_code(), entry.reason_code()))
|
||||
});
|
||||
if refused {
|
||||
Error::NoCommonSuite
|
||||
} else {
|
||||
Error::TlsHandshake(error.into_io_error().unwrap_or_else(io::Error::other))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Whether an error stack entry is the peer's `handshake_failure` alert.
|
||||
fn is_refusal(library: i32, reason: i32) -> bool {
|
||||
library == SSL_LIBRARY && reason == HANDSHAKE_FAILURE_ALERT
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use std::io::Read;
|
||||
use std::net::TcpListener;
|
||||
use std::thread::{self, JoinHandle};
|
||||
|
||||
use openssl::asn1::Asn1Time;
|
||||
use openssl::hash::MessageDigest;
|
||||
use openssl::pkey::PKey;
|
||||
use openssl::rsa::Rsa;
|
||||
use openssl::x509::{X509, X509NameBuilder};
|
||||
|
||||
use super::super::{Client, Session, Trust, capture, capture_rsa_kx, connect, rsa_kx, sha256};
|
||||
use super::*;
|
||||
|
||||
/// A self-signed certificate with an RSA key, which RSA key exchange needs.
|
||||
fn issue() -> (X509, PKey<openssl::pkey::Private>) {
|
||||
let key = PKey::from_rsa(Rsa::generate(2048).unwrap()).unwrap();
|
||||
let mut name = X509NameBuilder::new().unwrap();
|
||||
name.append_entry_by_text("CN", "esxi.test").unwrap();
|
||||
let name = name.build();
|
||||
let mut certificate = X509::builder().unwrap();
|
||||
certificate.set_version(2).unwrap();
|
||||
certificate.set_subject_name(&name).unwrap();
|
||||
certificate.set_issuer_name(&name).unwrap();
|
||||
certificate.set_pubkey(&key).unwrap();
|
||||
certificate
|
||||
.set_not_before(&Asn1Time::days_from_now(0).unwrap())
|
||||
.unwrap();
|
||||
certificate
|
||||
.set_not_after(&Asn1Time::days_from_now(1).unwrap())
|
||||
.unwrap();
|
||||
certificate.sign(&key, MessageDigest::sha256()).unwrap();
|
||||
(certificate.build(), key)
|
||||
}
|
||||
|
||||
/// A loopback TLS 1.2 server offering `suites` alone, for `connections` clients.
|
||||
///
|
||||
/// The thread returns the bytes each client sent after its handshake, or
|
||||
/// `None` when the handshake failed.
|
||||
fn server(
|
||||
suites: &'static str,
|
||||
connections: usize,
|
||||
) -> (
|
||||
CertificateDer<'static>,
|
||||
u16,
|
||||
JoinHandle<Vec<Option<Vec<u8>>>>,
|
||||
) {
|
||||
let (certificate, key) = issue();
|
||||
let der = CertificateDer::from(certificate.to_der().unwrap());
|
||||
let mut context = SslContext::builder(SslMethod::tls_server()).unwrap();
|
||||
context
|
||||
.set_max_proto_version(Some(SslVersion::TLS1_2))
|
||||
.unwrap();
|
||||
context.set_cipher_list(suites).unwrap();
|
||||
context.set_certificate(&certificate).unwrap();
|
||||
context.set_private_key(&key).unwrap();
|
||||
let context = context.build();
|
||||
let listener = TcpListener::bind("127.0.0.1:0").unwrap();
|
||||
let port = listener.local_addr().unwrap().port();
|
||||
let served = thread::spawn(move || {
|
||||
(0..connections)
|
||||
.map(|_| {
|
||||
let (stream, _) = listener.accept().unwrap();
|
||||
let mut session = Ssl::new(&context).unwrap().accept(stream).ok()?;
|
||||
let mut received = Vec::new();
|
||||
// The client leaves without a close notify, which reads as an error.
|
||||
let _ = session.read_to_end(&mut received);
|
||||
Some(received)
|
||||
})
|
||||
.collect()
|
||||
});
|
||||
(der, port, served)
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn an_rsa_only_host_refuses_rustls_then_completes_the_fallback_with_the_pinned_certificate() {
|
||||
let (certificate, port, served) = server("AES256-GCM-SHA384", 2);
|
||||
let pin = Pin::sha256(&sha256(&certificate)).unwrap();
|
||||
let client = Client::new(&Trust::Pin(pin.clone())).unwrap();
|
||||
let mut stream = connect("127.0.0.1", port).unwrap();
|
||||
|
||||
let refusal = client.handshake(&mut stream, "127.0.0.1").unwrap_err();
|
||||
|
||||
assert!(refusal.refused_suites(), "{refusal:?}");
|
||||
let stream = connect("127.0.0.1", port).unwrap();
|
||||
let session = rsa_kx(&stream, &pin).unwrap();
|
||||
assert!(matches!(session, Session::RsaKx(_)));
|
||||
assert_eq!(session.certificate().unwrap(), certificate);
|
||||
assert_eq!(
|
||||
session.negotiated().unwrap(),
|
||||
(
|
||||
ProtocolVersion::TLSv1_2,
|
||||
CipherSuite::TLS_RSA_WITH_AES_256_GCM_SHA384
|
||||
)
|
||||
);
|
||||
drop(session);
|
||||
drop(stream);
|
||||
assert_eq!(served.join().unwrap(), [None, Some(Vec::new())]);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn the_fallback_capture_reports_the_certificate_and_the_128_bit_suite() {
|
||||
let (certificate, port, _) = server("AES128-GCM-SHA256", 1);
|
||||
let stream = connect("127.0.0.1", port).unwrap();
|
||||
|
||||
let presented = capture_rsa_kx(&stream).unwrap();
|
||||
|
||||
assert_eq!(presented.certificate, certificate);
|
||||
assert_eq!(presented.version, ProtocolVersion::TLSv1_2);
|
||||
assert_eq!(
|
||||
presented.suite,
|
||||
CipherSuite::TLS_RSA_WITH_AES_128_GCM_SHA256
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_pin_mismatch_on_the_fallback_is_refused_before_any_write() {
|
||||
let (certificate, port, served) = server("AES256-GCM-SHA384", 1);
|
||||
let pin = Pin::sha256(&sha256(b"another certificate")).unwrap();
|
||||
let stream = connect("127.0.0.1", port).unwrap();
|
||||
|
||||
let error = rsa_kx(&stream, &pin).unwrap_err();
|
||||
|
||||
assert_eq!(
|
||||
error.to_string(),
|
||||
format!(
|
||||
"certificate thumbprint mismatch: expected {pin}, the host presented {}",
|
||||
sha256(&certificate)
|
||||
)
|
||||
);
|
||||
assert!(!error.refused_suites());
|
||||
drop(stream);
|
||||
assert_eq!(served.join().unwrap(), [Some(Vec::new())]);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_host_offering_only_cbc_with_rsa_key_exchange_shares_no_suite() {
|
||||
let (certificate, port, _) = server("AES256-SHA256", 2);
|
||||
let mut stream = connect("127.0.0.1", port).unwrap();
|
||||
let refusal = capture(&mut stream, "127.0.0.1").unwrap_err();
|
||||
assert!(refusal.refused_suites(), "{refusal:?}");
|
||||
let stream = connect("127.0.0.1", port).unwrap();
|
||||
|
||||
let error = rsa_kx(&stream, &Pin::sha256(&sha256(&certificate)).unwrap()).unwrap_err();
|
||||
|
||||
assert!(matches!(error, Error::NoCommonSuite), "{error:?}");
|
||||
assert_eq!(
|
||||
error.to_string(),
|
||||
"host refused every supported TLS suite (ECDHE, then RSA key exchange with AES-GCM)"
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn the_alert_reason_code_is_a_refusal_only_from_the_ssl_library() {
|
||||
// 6 is ERR_LIB_EVP, whose reason codes are numbered on their own.
|
||||
assert!(is_refusal(SSL_LIBRARY, HANDSHAKE_FAILURE_ALERT));
|
||||
assert!(!is_refusal(6, HANDSHAKE_FAILURE_ALERT));
|
||||
assert!(!is_refusal(SSL_LIBRARY, HANDSHAKE_FAILURE_ALERT + 1));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_host_that_closes_during_the_fallback_is_a_handshake_failure_not_a_refusal() {
|
||||
let listener = TcpListener::bind("127.0.0.1:0").unwrap();
|
||||
let port = listener.local_addr().unwrap().port();
|
||||
let closing = thread::spawn(move || drop(listener.accept().unwrap()));
|
||||
let stream = connect("127.0.0.1", port).unwrap();
|
||||
closing.join().unwrap();
|
||||
|
||||
let error = capture_rsa_kx(&stream).unwrap_err();
|
||||
|
||||
assert!(matches!(error, Error::TlsHandshake(_)), "{error:?}");
|
||||
assert!(!error.refused_suites());
|
||||
}
|
||||
}
|
||||
@@ -45,14 +45,7 @@ impl Transcript {
|
||||
|
||||
/// The protocol version and cipher suite the TLS session at `place` negotiated.
|
||||
pub fn tls(&self, place: &str, version: ProtocolVersion, suite: CipherSuite) {
|
||||
self.line(&format!("{place} tls {version:?} {}", suite_name(suite)));
|
||||
}
|
||||
|
||||
/// That the data port refused the ECDHE suites at `place` and is asked again.
|
||||
pub fn fallback(&self, place: &str) {
|
||||
self.line(&format!(
|
||||
"{place} tls fallback: host refused ECDHE, retrying with RSA key exchange"
|
||||
));
|
||||
self.line(&format!("{place} tls {version:?} {suite:?}"));
|
||||
}
|
||||
|
||||
/// A dialogue line sent to the host, without its line end; never the ticket.
|
||||
@@ -125,18 +118,6 @@ impl Transcript {
|
||||
}
|
||||
}
|
||||
|
||||
/// The IANA name of `suite`.
|
||||
///
|
||||
/// rustls prints the name of the suites it implements and a bare number for
|
||||
/// the others, which the two RSA key exchange suites of the fallback are.
|
||||
fn suite_name(suite: CipherSuite) -> String {
|
||||
match u16::from(suite) {
|
||||
0x009C => "TLS_RSA_WITH_AES_128_GCM_SHA256".to_owned(),
|
||||
0x009D => "TLS_RSA_WITH_AES_256_GCM_SHA384".to_owned(),
|
||||
_ => format!("{suite:?}"),
|
||||
}
|
||||
}
|
||||
|
||||
/// `wire` over `logical` with two decimals, in integer arithmetic; 0.00 before any byte.
|
||||
fn ratio(wire: u64, logical: u64) -> String {
|
||||
let hundredths = wire.saturating_mul(100) / logical.max(1);
|
||||
@@ -147,18 +128,6 @@ fn ratio(wire: u64, logical: u64) -> String {
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn a_suite_is_named_whether_or_not_rustls_implements_it() {
|
||||
for (suite, expected) in [
|
||||
(0x009C, "TLS_RSA_WITH_AES_128_GCM_SHA256"),
|
||||
(0x009D, "TLS_RSA_WITH_AES_256_GCM_SHA384"),
|
||||
(0x1302, "TLS13_AES_256_GCM_SHA384"),
|
||||
(0xC02F, "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256"),
|
||||
] {
|
||||
assert_eq!(suite_name(CipherSuite::from(suite)), expected);
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn the_ratio_has_two_decimals_and_is_zero_before_any_byte() {
|
||||
for (wire, logical, expected) in [
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
use std::net::TcpListener;
|
||||
use std::process::{Command, Output};
|
||||
|
||||
use crate::support::{DataPort, GREETING, GREETING_WITHOUT_SHA256, Host, Observed, Scenario, text};
|
||||
use crate::support::{DataPort, GREETING, GREETING_WITHOUT_SHA256, Host, Observed, text};
|
||||
|
||||
/// Runs the built binary with `args` and waits for it.
|
||||
fn vectura(args: &[&str]) -> Output {
|
||||
@@ -161,69 +161,3 @@ fn a_refused_data_port_fails_naming_its_address() {
|
||||
failure_naming(&output, &format!("127.0.0.1:{data}"));
|
||||
assert!(host.management().handshake_completed);
|
||||
}
|
||||
|
||||
/// A host whose data port accepts `suites` alone, like an ESXi 6.5 one.
|
||||
fn restricted_to(suites: &'static str) -> Host {
|
||||
Host::start(Scenario {
|
||||
data: DataPort::Greeting(GREETING_WITHOUT_SHA256),
|
||||
data_suites: Some(suites),
|
||||
..Scenario::default()
|
||||
})
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn an_rsa_only_data_port_is_fingerprinted_through_the_fallback() {
|
||||
let host = restricted_to("AES256-GCM-SHA384");
|
||||
|
||||
let output = fingerprint(&host, true);
|
||||
|
||||
assert_eq!(
|
||||
output.status.code(),
|
||||
Some(0),
|
||||
"stderr: {}",
|
||||
text(&output.stderr)
|
||||
);
|
||||
assert_eq!(text(&output.stdout), expected_stdout(&host));
|
||||
let refused = host.data();
|
||||
assert!(
|
||||
refused.handshake_started && !refused.handshake_completed,
|
||||
"the ECDHE offer is refused first: {refused:?}"
|
||||
);
|
||||
let accepted = host.data();
|
||||
assert_eq!(
|
||||
accepted.suite.as_deref(),
|
||||
Some("TLS_RSA_WITH_AES_256_GCM_SHA384")
|
||||
);
|
||||
assert_eq!(
|
||||
accepted.bytes_after_tls_handshake, 0,
|
||||
"nothing is sent after the TLS handshake: {accepted:?}"
|
||||
);
|
||||
let expected = verbose_line(host.management_port, &host.management())
|
||||
+ &format!(
|
||||
"{} tls fallback: host refused ECDHE, retrying with RSA key exchange\n",
|
||||
host.data_port
|
||||
)
|
||||
+ &verbose_line(host.data_port, &accepted);
|
||||
assert_eq!(text(&output.stderr), expected);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_data_port_with_no_common_suite_fails_naming_the_cause() {
|
||||
// CBC with RSA key exchange: neither rustls nor the fallback offers it.
|
||||
let host = restricted_to("AES256-SHA256");
|
||||
|
||||
let output = fingerprint(&host, false);
|
||||
|
||||
let stderr = failure_naming(&output, &format!("127.0.0.1:{}", host.data_port));
|
||||
assert!(
|
||||
stderr.contains(
|
||||
"host refused every supported TLS suite (ECDHE, then RSA key exchange with AES-GCM)"
|
||||
),
|
||||
"{stderr}"
|
||||
);
|
||||
assert!(!stderr.contains("HandshakeFailure"), "{stderr}");
|
||||
for _ in 0..2 {
|
||||
let refused = host.data();
|
||||
assert!(!refused.handshake_completed, "{refused:?}");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -446,24 +446,6 @@ fn a_vcenter_serves_the_disk_from_the_host_its_ticket_names() {
|
||||
healthy_session(&events, 1);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_legacy_host_through_a_vcenter_is_asked_for_the_transport_of_vpxa() {
|
||||
// The mock grants a vCenter's ticket on a legacy host to vpxa only.
|
||||
let host = Host::start(Scenario {
|
||||
data: DataPort::Greeting(GREETING_WITHOUT_SHA256),
|
||||
vcenter: true,
|
||||
..Scenario::default()
|
||||
});
|
||||
let mut child = spawn(&host, Some(PASSWORD), &pin(&host));
|
||||
negotiate(&mut child, true);
|
||||
let events = session_ends_cleanly(&host, child);
|
||||
|
||||
assert!(
|
||||
events.contains(&Event::Proxy("vpxa-nfcssl".to_owned())),
|
||||
"{events:?}"
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_refused_login_reports_the_fault_without_the_password() {
|
||||
let fault = "Cannot complete login due to an incorrect user name or password.";
|
||||
@@ -600,123 +582,6 @@ fn a_legacy_host_exports_the_capacity_its_reads_reveal_and_serves_the_disk_bytes
|
||||
);
|
||||
}
|
||||
|
||||
/// A legacy host whose data port accepts RSA key exchange alone, like an ESXi 6.5 one.
|
||||
///
|
||||
/// Its ticket carries the SHA-1 thumbprint of `ticket_thumbprint`.
|
||||
fn rsa_only(ticket_thumbprint: Thumbprint) -> Scenario {
|
||||
Scenario {
|
||||
data: DataPort::Greeting(GREETING_WITHOUT_SHA256),
|
||||
data_suites: Some("AES256-GCM-SHA384"),
|
||||
ticket_thumbprint,
|
||||
..Scenario::default()
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_host_that_refuses_ecdhe_serves_the_disk_over_rsa_key_exchange_in_both_sessions() {
|
||||
let capacity = Scenario::default().capacity;
|
||||
let host = Host::start(rsa_only(Thumbprint::Own));
|
||||
let mut child = spawn(&host, Some(PASSWORD), &pinned(&host, &["--verbose"]));
|
||||
|
||||
let export = negotiate(&mut child, true);
|
||||
let first = read_at(&mut child, 1, 0, 4 * MIB);
|
||||
let last = read_at(&mut child, 2, capacity - SECTOR, SECTOR);
|
||||
disconnect(&mut child);
|
||||
let output = finish(child);
|
||||
|
||||
assert_eq!(
|
||||
output.status.code(),
|
||||
Some(0),
|
||||
"stderr: {}",
|
||||
text(&output.stderr)
|
||||
);
|
||||
assert_eq!(export.size, capacity);
|
||||
matches_disk(&first, 0, 4 * MIB);
|
||||
matches_disk(&last, capacity - SECTOR, SECTOR);
|
||||
let refused = host.data();
|
||||
assert!(
|
||||
refused.handshake_started && !refused.handshake_completed,
|
||||
"the ECDHE offer is refused first: {refused:?}"
|
||||
);
|
||||
let served = host.data();
|
||||
assert!(served.second_handshake, "{served:?}");
|
||||
let stderr = text(&output.stderr);
|
||||
let lines = [
|
||||
"first session tls fallback: host refused ECDHE, retrying with RSA key exchange\n\
|
||||
first session tls TLSv1_2 TLS_RSA_WITH_AES_256_GCM_SHA384\n",
|
||||
"second session tls TLSv1_2 TLS_RSA_WITH_AES_256_GCM_SHA384\n",
|
||||
];
|
||||
for line in lines {
|
||||
assert!(stderr.contains(line), "{stderr}");
|
||||
}
|
||||
secrets_absent(&output);
|
||||
let opened = legacy_events_up_to_open();
|
||||
assert_eq!(host.events()[..opened.len()], opened);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_host_that_offers_ecdhe_is_never_asked_for_rsa_key_exchange() {
|
||||
let host = Host::start(Scenario {
|
||||
capacity: SMALL,
|
||||
..Scenario::default()
|
||||
});
|
||||
let mut child = spawn(&host, Some(PASSWORD), &pinned(&host, &["--verbose"]));
|
||||
|
||||
negotiate(&mut child, true);
|
||||
disconnect(&mut child);
|
||||
let output = finish(child);
|
||||
|
||||
assert_eq!(output.status.code(), Some(0));
|
||||
let stderr = text(&output.stderr);
|
||||
assert!(!stderr.contains("fallback"), "{stderr}");
|
||||
assert!(!stderr.contains("TLS_RSA_"), "{stderr}");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_pin_mismatch_does_not_trigger_the_fallback() {
|
||||
let host = Host::start(Scenario {
|
||||
ticket_thumbprint: Thumbprint::Other,
|
||||
..Scenario::default()
|
||||
});
|
||||
|
||||
let output = finish(spawn(&host, Some(PASSWORD), &pinned(&host, &["--verbose"])));
|
||||
|
||||
assert_eq!(output.status.code(), Some(1));
|
||||
let stderr = text(&output.stderr);
|
||||
assert!(
|
||||
stderr.contains("vectura: data plane: certificate thumbprint mismatch"),
|
||||
"{stderr}"
|
||||
);
|
||||
assert!(!stderr.contains("fallback"), "{stderr}");
|
||||
assert!(
|
||||
!host.events().contains(&Event::Session(TICKET.to_owned())),
|
||||
"the ticket was never presented: {:?}",
|
||||
host.events()
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_ticket_thumbprint_that_is_not_the_certificate_aborts_the_fallback_before_any_write() {
|
||||
let (host, stderr) = fails_then_logs_out(rsa_only(Thumbprint::Other));
|
||||
|
||||
assert!(
|
||||
stderr.starts_with("vectura: data plane: certificate thumbprint mismatch"),
|
||||
"{stderr}"
|
||||
);
|
||||
assert!(!host.data().handshake_completed);
|
||||
let pinned = host.data();
|
||||
assert!(pinned.handshake_completed, "{pinned:?}");
|
||||
assert_eq!(
|
||||
pinned.bytes_after_tls_handshake, 0,
|
||||
"nothing is written to a host presenting another certificate: {pinned:?}"
|
||||
);
|
||||
assert!(
|
||||
!host.events().contains(&Event::Session(TICKET.to_owned())),
|
||||
"the ticket was never presented: {:?}",
|
||||
host.events()
|
||||
);
|
||||
}
|
||||
|
||||
/// The text an ESXi 6.0 host sends when the path names no disk.
|
||||
const LEGACY_OPEN_ERROR: &str =
|
||||
"NfcFssrvrOpen: permission check failed for file [datastore1] vm/vm.vmdk, access = 1";
|
||||
|
||||
@@ -19,12 +19,6 @@ use std::thread;
|
||||
use std::time::Duration;
|
||||
|
||||
use aws_lc_rs::digest::{self, Algorithm, SHA1_FOR_LEGACY_USE_ONLY, SHA256};
|
||||
use openssl::asn1::Asn1Time;
|
||||
use openssl::hash::MessageDigest;
|
||||
use openssl::pkey::PKey;
|
||||
use openssl::rsa::Rsa;
|
||||
use openssl::ssl::{Ssl, SslContext, SslMethod, SslStream, SslVersion};
|
||||
use openssl::x509::{X509, X509NameBuilder};
|
||||
use rustls::{IoState, ServerConfig, ServerConnection, Stream};
|
||||
use rustls_pki_types::{CertificateDer, PrivateKeyDer, PrivatePkcs8KeyDer};
|
||||
|
||||
@@ -165,13 +159,6 @@ pub enum ReadFault {
|
||||
pub struct Scenario {
|
||||
/// What the data port does on connection.
|
||||
pub data: DataPort,
|
||||
/// The only suites the data port accepts, as an OpenSSL cipher list, with TLS 1.2 at most.
|
||||
///
|
||||
/// `None` is a host that offers ECDHE. With a list, the host has an RSA
|
||||
/// key, as RSA key exchange needs, and the data port serves every
|
||||
/// connection instead of the first only: a client refused once may come
|
||||
/// back, and [`Host::data`] then reports the connections in order.
|
||||
pub data_suites: Option<&'static str>,
|
||||
/// Whether the management port plays a vCenter.
|
||||
///
|
||||
/// It reports `VirtualCenter`, and its ticket names [`VCENTER_DATA_HOST`],
|
||||
@@ -210,7 +197,6 @@ impl Default for Scenario {
|
||||
fn default() -> Scenario {
|
||||
Scenario {
|
||||
data: DataPort::Greeting(GREETING),
|
||||
data_suites: None,
|
||||
vcenter: false,
|
||||
login: Ok(()),
|
||||
ticket_thumbprint: Thumbprint::Own,
|
||||
@@ -338,20 +324,14 @@ pub struct Host {
|
||||
impl Host {
|
||||
/// Starts a host with a fresh self-signed certificate that plays `scenario`.
|
||||
pub fn start(scenario: Scenario) -> Host {
|
||||
let restricted = scenario.data_suites.map(restricted);
|
||||
let (certificate, key) = if let Some((certificate, key, _)) = &restricted {
|
||||
(certificate.clone(), key.clone_key())
|
||||
} else {
|
||||
let issued = rcgen::generate_simple_self_signed(vec![
|
||||
"esxi.test".to_owned(),
|
||||
"127.0.0.1".to_owned(),
|
||||
])
|
||||
.expect("a self-signed certificate is generated");
|
||||
(
|
||||
issued.cert.der().clone(),
|
||||
PrivateKeyDer::Pkcs8(PrivatePkcs8KeyDer::from(issued.signing_key.serialize_der())),
|
||||
)
|
||||
};
|
||||
let issued = rcgen::generate_simple_self_signed(vec![
|
||||
"esxi.test".to_owned(),
|
||||
"127.0.0.1".to_owned(),
|
||||
])
|
||||
.expect("a self-signed certificate is generated");
|
||||
let certificate = issued.cert.der().clone();
|
||||
let key =
|
||||
PrivateKeyDer::Pkcs8(PrivatePkcs8KeyDer::from(issued.signing_key.serialize_der()));
|
||||
let config = Arc::new(
|
||||
ServerConfig::builder()
|
||||
.with_no_client_auth()
|
||||
@@ -367,7 +347,6 @@ impl Host {
|
||||
let mock = Arc::new(Mock {
|
||||
scenario,
|
||||
config,
|
||||
restricted: restricted.map(|(_, _, context)| context),
|
||||
events: Mutex::new(Vec::new()),
|
||||
certificate: certificate.clone(),
|
||||
data_port,
|
||||
@@ -378,12 +357,7 @@ impl Host {
|
||||
true,
|
||||
serve_management,
|
||||
);
|
||||
let data = listen(
|
||||
data_listener,
|
||||
Arc::clone(&mock),
|
||||
mock.restricted.is_some(),
|
||||
serve_data,
|
||||
);
|
||||
let data = listen(data_listener, Arc::clone(&mock), false, serve_data);
|
||||
Host {
|
||||
certificate,
|
||||
management_port,
|
||||
@@ -418,7 +392,7 @@ impl Host {
|
||||
.expect("the management port served a connection")
|
||||
}
|
||||
|
||||
/// What the data port observed on its next connection; panics when there was none.
|
||||
/// What the data port observed; panics when it was never contacted.
|
||||
pub fn data(&self) -> Observed {
|
||||
self.data
|
||||
.recv_timeout(REPORT_TIMEOUT)
|
||||
@@ -463,69 +437,16 @@ pub fn text(bytes: &[u8]) -> String {
|
||||
String::from_utf8(bytes.to_vec()).expect("the output is UTF-8")
|
||||
}
|
||||
|
||||
/// An RSA certificate and key, and the TLS 1.2 server that accepts `suites` alone with them.
|
||||
fn restricted(suites: &str) -> (CertificateDer<'static>, PrivateKeyDer<'static>, SslContext) {
|
||||
let key = PKey::from_rsa(Rsa::generate(2048).expect("an RSA key is generated"))
|
||||
.expect("the key is usable");
|
||||
let mut name = X509NameBuilder::new().expect("a name builder");
|
||||
name.append_entry_by_text("CN", "esxi.test")
|
||||
.expect("a common name");
|
||||
let name = name.build();
|
||||
let mut certificate = X509::builder().expect("a certificate builder");
|
||||
certificate.set_version(2).expect("version 3");
|
||||
certificate.set_subject_name(&name).expect("a subject");
|
||||
certificate.set_issuer_name(&name).expect("an issuer");
|
||||
certificate.set_pubkey(&key).expect("a public key");
|
||||
certificate
|
||||
.set_not_before(&Asn1Time::days_from_now(0).expect("today"))
|
||||
.expect("a start");
|
||||
certificate
|
||||
.set_not_after(&Asn1Time::days_from_now(1).expect("tomorrow"))
|
||||
.expect("an end");
|
||||
certificate
|
||||
.sign(&key, MessageDigest::sha256())
|
||||
.expect("the certificate is signed");
|
||||
let certificate = certificate.build();
|
||||
let mut context = SslContext::builder(SslMethod::tls_server()).expect("a server context");
|
||||
context
|
||||
.set_max_proto_version(Some(SslVersion::TLS1_2))
|
||||
.expect("TLS 1.2 is available");
|
||||
context.set_cipher_list(suites).expect("the suites exist");
|
||||
context
|
||||
.set_certificate(&certificate)
|
||||
.expect("the certificate is accepted");
|
||||
context.set_private_key(&key).expect("the key matches");
|
||||
(
|
||||
CertificateDer::from(certificate.to_der().expect("the certificate encodes")),
|
||||
PrivateKeyDer::Pkcs8(PrivatePkcs8KeyDer::from(
|
||||
key.private_key_to_pkcs8().expect("the key encodes"),
|
||||
)),
|
||||
context.build(),
|
||||
)
|
||||
}
|
||||
|
||||
/// What both port threads share.
|
||||
#[derive(Debug)]
|
||||
struct Mock {
|
||||
scenario: Scenario,
|
||||
config: Arc<ServerConfig>,
|
||||
/// The data port's TLS server when the scenario restricts its suites.
|
||||
restricted: Option<SslContext>,
|
||||
events: Mutex<Vec<Event>>,
|
||||
certificate: CertificateDer<'static>,
|
||||
data_port: u16,
|
||||
}
|
||||
|
||||
impl std::fmt::Debug for Mock {
|
||||
fn fmt(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
// `SslContext` has no `Debug`; the scenario says whether it is there.
|
||||
formatter
|
||||
.debug_struct("Mock")
|
||||
.field("scenario", &self.scenario)
|
||||
.field("data_port", &self.data_port)
|
||||
.finish_non_exhaustive()
|
||||
}
|
||||
}
|
||||
|
||||
impl Mock {
|
||||
fn record(&self, event: Event) {
|
||||
self.events
|
||||
@@ -827,8 +748,6 @@ fn fault(text: &str) -> String {
|
||||
/// The disk session as the mock carries it: TLS or the socket in clear.
|
||||
enum Plane<'a> {
|
||||
Tls(&'a mut ServerConnection, &'a mut TcpStream),
|
||||
/// TLS as OpenSSL serves it, on its own clone of the socket.
|
||||
Restricted(SslStream<TcpStream>),
|
||||
Clear(&'a mut TcpStream),
|
||||
}
|
||||
|
||||
@@ -837,13 +756,6 @@ impl Plane<'_> {
|
||||
fn message(&mut self) -> Option<Vec<u8>> {
|
||||
match self {
|
||||
Plane::Tls(connection, stream) => next_record(connection, stream),
|
||||
// OpenSSL hands over the plaintext of one record per read.
|
||||
Plane::Restricted(session) => {
|
||||
let mut message = vec![0_u8; 1 << 14];
|
||||
let length = session.read(&mut message).ok().filter(|read| *read > 0)?;
|
||||
message.truncate(length);
|
||||
Some(message)
|
||||
}
|
||||
Plane::Clear(stream) => {
|
||||
let mut message = vec![0_u8; MESSAGE_LEN];
|
||||
stream.read_exact(&mut message).ok()?;
|
||||
@@ -861,22 +773,15 @@ impl Plane<'_> {
|
||||
fn send(&mut self, bytes: &[u8]) -> Option<()> {
|
||||
match self {
|
||||
Plane::Tls(connection, stream) => send_record(connection, stream, bytes),
|
||||
Plane::Restricted(session) => send(session, bytes),
|
||||
Plane::Clear(stream) => send(stream, bytes),
|
||||
}
|
||||
}
|
||||
|
||||
/// Ends the TLS session properly; the clear session just closes.
|
||||
fn close(self) {
|
||||
match self {
|
||||
Plane::Tls(connection, stream) => {
|
||||
connection.send_close_notify();
|
||||
let _ = connection.complete_io(stream);
|
||||
}
|
||||
Plane::Restricted(mut session) => {
|
||||
let _ = session.shutdown();
|
||||
}
|
||||
Plane::Clear(_) => {}
|
||||
if let Plane::Tls(connection, stream) = self {
|
||||
connection.send_close_notify();
|
||||
let _ = connection.complete_io(stream);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -887,7 +792,6 @@ impl Read for Plane<'_> {
|
||||
Plane::Tls(connection, stream) => {
|
||||
Stream::new(&mut **connection, &mut **stream).read(buffer)
|
||||
}
|
||||
Plane::Restricted(session) => session.read(buffer),
|
||||
Plane::Clear(stream) => stream.read(buffer),
|
||||
}
|
||||
}
|
||||
@@ -899,7 +803,6 @@ impl Write for Plane<'_> {
|
||||
Plane::Tls(connection, stream) => {
|
||||
Stream::new(&mut **connection, &mut **stream).write(buffer)
|
||||
}
|
||||
Plane::Restricted(session) => session.write(buffer),
|
||||
Plane::Clear(stream) => stream.write(buffer),
|
||||
}
|
||||
}
|
||||
@@ -907,7 +810,6 @@ impl Write for Plane<'_> {
|
||||
fn flush(&mut self) -> io::Result<()> {
|
||||
match self {
|
||||
Plane::Tls(connection, stream) => Stream::new(&mut **connection, &mut **stream).flush(),
|
||||
Plane::Restricted(session) => session.flush(),
|
||||
Plane::Clear(stream) => stream.flush(),
|
||||
}
|
||||
}
|
||||
@@ -922,10 +824,6 @@ fn serve_data(mut stream: TcpStream, mock: &Mock) -> Observed {
|
||||
if stream.write_all(greeting).is_err() {
|
||||
return observed;
|
||||
}
|
||||
if let Some(context) = &mock.restricted {
|
||||
serve_restricted(stream, mock, context, &mut observed);
|
||||
return observed;
|
||||
}
|
||||
let Some(mut first) = handshake(&mut stream, mock, &mut observed) else {
|
||||
return observed;
|
||||
};
|
||||
@@ -937,7 +835,7 @@ fn serve_data(mut stream: TcpStream, mock: &Mock) -> Observed {
|
||||
drop(first);
|
||||
let socket = stream.try_clone().expect("the socket clones");
|
||||
let mut second;
|
||||
let mut plane = if transport.ends_with("nfc") {
|
||||
let mut plane = if transport == "nfc" {
|
||||
Plane::Clear(&mut stream)
|
||||
} else {
|
||||
second = ServerConnection::new(Arc::clone(&mock.config))
|
||||
@@ -959,75 +857,6 @@ fn serve_data(mut stream: TcpStream, mock: &Mock) -> Observed {
|
||||
observed
|
||||
}
|
||||
|
||||
/// Accepts one TLS session with the restricted suites on a clone of `stream`.
|
||||
fn accept(stream: &TcpStream, context: &SslContext) -> Option<SslStream<TcpStream>> {
|
||||
let socket = stream.try_clone().expect("the socket clones");
|
||||
Ssl::new(context)
|
||||
.expect("the server context is valid")
|
||||
.accept(socket)
|
||||
.ok()
|
||||
}
|
||||
|
||||
/// [`serve_data`] past the greeting, for a data port whose suites are restricted.
|
||||
///
|
||||
/// A client offering none of them is answered with a `handshake_failure`
|
||||
/// alert and the connection ends there, as on a host.
|
||||
fn serve_restricted(
|
||||
mut stream: TcpStream,
|
||||
mock: &Mock,
|
||||
context: &SslContext,
|
||||
observed: &mut Observed,
|
||||
) {
|
||||
let mut first = [0_u8; 1];
|
||||
observed.handshake_started = matches!(stream.peek(&mut first), Ok(1));
|
||||
let Some(mut first) = accept(&stream, context) else {
|
||||
return;
|
||||
};
|
||||
observed.handshake_completed = true;
|
||||
// The names rustls debug-prints, which the transcript uses.
|
||||
observed.version = Some(first.ssl().version_str().replace('.', "_"));
|
||||
observed.suite = first
|
||||
.ssl()
|
||||
.current_cipher()
|
||||
.and_then(openssl::ssl::SslCipherRef::standard_name)
|
||||
.map(str::to_owned);
|
||||
let (read, granted) = dialogue(&mut first, mock);
|
||||
observed.bytes_after_tls_handshake = read;
|
||||
let Some(transport) = granted else {
|
||||
return;
|
||||
};
|
||||
// No close notify, as on the other path: the socket goes on.
|
||||
drop(first);
|
||||
let mut plane = if transport.ends_with("nfc") {
|
||||
Plane::Clear(&mut stream)
|
||||
} else {
|
||||
let Some(second) = accept(&stream, context) else {
|
||||
return;
|
||||
};
|
||||
observed.second_handshake = true;
|
||||
Plane::Restricted(second)
|
||||
};
|
||||
if mock.legacy() {
|
||||
if legacy_shake(&mut plane, mock).is_some() {
|
||||
legacy_messages(&mut plane, mock);
|
||||
}
|
||||
} else if shake(&mut plane, mock).is_some() {
|
||||
let socket = stream_clone(&plane);
|
||||
if let Some(socket) = socket {
|
||||
records(&mut plane, &socket, mock, observed);
|
||||
}
|
||||
}
|
||||
plane.close();
|
||||
}
|
||||
|
||||
/// A handle on the socket under `plane`, to set its timeouts.
|
||||
fn stream_clone(plane: &Plane<'_>) -> Option<TcpStream> {
|
||||
match plane {
|
||||
Plane::Tls(_, stream) | Plane::Clear(stream) => stream.try_clone().ok(),
|
||||
Plane::Restricted(session) => session.get_ref().try_clone().ok(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Runs the ticket dialogue: the bytes read, and the transport `PROXY` was granted, if any.
|
||||
fn dialogue<S: Read + Write>(tls: &mut S, mock: &Mock) -> (usize, Option<String>) {
|
||||
let mut read = 0;
|
||||
@@ -1059,20 +888,11 @@ fn dialogue<S: Read + Write>(tls: &mut S, mock: &Mock) -> (usize, Option<String>
|
||||
"200 {}",
|
||||
mock.thumbprint(&SHA256, mock.scenario.announced_thumbprint)
|
||||
)
|
||||
} else if let Some(transport @ ("nfc" | "nfcssl" | "vpxa-nfc" | "vpxa-nfcssl")) =
|
||||
text.strip_prefix("PROXY ")
|
||||
// A 6.x host knows a vCenter's ticket under vpxa's services only.
|
||||
&& transport.starts_with("vpxa-") == (mock.scenario.vcenter && mock.legacy())
|
||||
{
|
||||
} else if let Some(transport @ ("nfc" | "nfcssl")) = text.strip_prefix("PROXY ") {
|
||||
mock.record(Event::Proxy(transport.to_owned()));
|
||||
let service = if transport.starts_with("vpxa-") {
|
||||
transport.to_owned()
|
||||
} else {
|
||||
format!("ha-{transport}")
|
||||
};
|
||||
mock.scenario
|
||||
.proxy_reply
|
||||
.map_or_else(|| format!("200 Connect {service}"), str::to_owned)
|
||||
.map_or_else(|| format!("200 Connect ha-{transport}"), str::to_owned)
|
||||
} else {
|
||||
return (read, None);
|
||||
};
|
||||
|
||||
Binary file not shown.
@@ -40,7 +40,7 @@ XO 6 tests import the generic helpers through `@core-test` too, so a helper exis
|
||||
|
||||
## Setup in web-core
|
||||
|
||||
Testing uses **Vitest 5** with a single `unit` project (see `vitest.config.ts`): every test matches `**/*.unit.test.ts` and runs on `happy-dom`, CLI-only, no browser.
|
||||
Testing uses **Vitest 4** with a single `unit` project (see `vitest.config.ts`): every test matches `**/*.unit.test.ts` and runs on `happy-dom`, CLI-only, no browser.
|
||||
|
||||
| Path | Role |
|
||||
| ----------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
:root {
|
||||
--color-logo: #282467;
|
||||
|
||||
/* NEUTRALS */
|
||||
|
||||
--color-neutral-txt-primary: #1a1b38;
|
||||
@@ -29,7 +31,6 @@
|
||||
--color-brand-item-hover: color-mix(in srgb, #ffffff 20%, var(--color-brand-item-base));
|
||||
--color-brand-item-active: color-mix(in srgb, #ffffff 40%, var(--color-brand-item-base));
|
||||
--color-brand-item-disabled: #d2ceff;
|
||||
--color-brand-data: #8a80ff;
|
||||
|
||||
/* INFO */
|
||||
|
||||
@@ -46,7 +47,6 @@
|
||||
--color-info-item-hover: color-mix(in srgb, #ffffff 20%, var(--color-info-item-base));
|
||||
--color-info-item-active: color-mix(in srgb, #ffffff 40%, var(--color-info-item-base));
|
||||
--color-info-item-disabled: #abdafa;
|
||||
--color-info-data: #1498f0;
|
||||
|
||||
/* SUCCESS */
|
||||
|
||||
@@ -63,7 +63,6 @@
|
||||
--color-success-item-hover: color-mix(in srgb, #ffffff 20%, var(--color-success-item-base));
|
||||
--color-success-item-active: color-mix(in srgb, #ffffff 40%, var(--color-success-item-base));
|
||||
--color-success-item-disabled: #abdcc9;
|
||||
--color-success-data: #2ca577;
|
||||
|
||||
/* WARNING */
|
||||
|
||||
@@ -80,7 +79,6 @@
|
||||
--color-warning-item-hover: color-mix(in srgb, #ffffff 20%, var(--color-warning-item-base));
|
||||
--color-warning-item-active: color-mix(in srgb, #ffffff 40%, var(--color-warning-item-base));
|
||||
--color-warning-item-disabled: #f9cca3;
|
||||
--color-warning-data: #e07410;
|
||||
|
||||
/* DANGER */
|
||||
|
||||
@@ -88,20 +86,20 @@
|
||||
--color-danger-txt-hover: color-mix(in srgb, #000000 20%, var(--color-danger-txt-base));
|
||||
--color-danger-txt-active: color-mix(in srgb, #000000 40%, var(--color-danger-txt-base));
|
||||
|
||||
--color-danger-background-base: #e73642;
|
||||
--color-danger-background-selected: color-mix(in srgb, #ffffff 90%, var(--color-danger-background-base));
|
||||
--color-danger-background-hover: color-mix(in srgb, #ffffff 80%, var(--color-danger-background-base));
|
||||
--color-danger-background-active: color-mix(in srgb, #ffffff 70%, var(--color-danger-background-base));
|
||||
--color-danger-background-selected: color-mix(in srgb, #ffffff 90%, var(--color-danger-item-base));
|
||||
--color-danger-background-hover: color-mix(in srgb, #ffffff 80%, var(--color-danger-item-base));
|
||||
--color-danger-background-active: color-mix(in srgb, #ffffff 70%, var(--color-danger-item-base));
|
||||
|
||||
--color-danger-txt-item: #fff0f1;
|
||||
--color-danger-item-base: #be1621;
|
||||
--color-danger-item-hover: color-mix(in srgb, #000000 20%, var(--color-danger-item-base));
|
||||
--color-danger-item-active: color-mix(in srgb, #000000 40%, var(--color-danger-item-base));
|
||||
--color-danger-item-disabled: #e5a2a6;
|
||||
--color-danger-data: #be1621;
|
||||
}
|
||||
|
||||
:root.dark {
|
||||
--color-logo: #e5e5e7;
|
||||
|
||||
/* NEUTRALS */
|
||||
|
||||
--color-neutral-txt-primary: #f8f8f8;
|
||||
@@ -132,7 +130,6 @@
|
||||
--color-brand-item-hover: color-mix(in srgb, #ffffff 20%, var(--color-brand-item-base));
|
||||
--color-brand-item-active: color-mix(in srgb, #ffffff 40%, var(--color-brand-item-base));
|
||||
--color-brand-item-disabled: #393566;
|
||||
--color-brand-data: #8f84ff;
|
||||
|
||||
/* INFO */
|
||||
|
||||
@@ -149,7 +146,6 @@
|
||||
--color-info-item-hover: color-mix(in srgb, #ffffff 20%, var(--color-info-item-base));
|
||||
--color-info-item-active: color-mix(in srgb, #ffffff 40%, var(--color-info-item-base));
|
||||
--color-info-item-disabled: #124161;
|
||||
--color-info-data: #2ca3f2;
|
||||
|
||||
/* SUCCESS */
|
||||
|
||||
@@ -157,16 +153,15 @@
|
||||
--color-success-txt-hover: color-mix(in srgb, #ffffff 20%, var(--color-success-txt-base));
|
||||
--color-success-txt-active: color-mix(in srgb, #ffffff 40%, var(--color-success-txt-base));
|
||||
|
||||
--color-success-background-selected: color-mix(in srgb, #000000 70%, var(--color-success-item-base));
|
||||
--color-success-background-hover: color-mix(in srgb, #000000 60%, var(--color-success-item-base));
|
||||
--color-success-background-active: color-mix(in srgb, #000000 50%, var(--color-success-item-base));
|
||||
--color-success-background-selected: color-mix(in srgb, #000000 70%, var(--color-success-txt-base));
|
||||
--color-success-background-hover: color-mix(in srgb, #000000 60%, var(--color-success-txt-base));
|
||||
--color-success-background-active: color-mix(in srgb, #000000 50%, var(--color-success-txt-base));
|
||||
|
||||
--color-success-txt-item: #092017;
|
||||
--color-success-item-base: #2ca878;
|
||||
--color-success-item-hover: color-mix(in srgb, #ffffff 20%, var(--color-success-item-base));
|
||||
--color-success-item-active: color-mix(in srgb, #ffffff 40%, var(--color-success-item-base));
|
||||
--color-success-item-disabled: #124330;
|
||||
--color-success-data: #2ca878;
|
||||
|
||||
/* WARNING */
|
||||
|
||||
@@ -174,16 +169,15 @@
|
||||
--color-warning-txt-hover: color-mix(in srgb, #ffffff 20%, var(--color-warning-txt-base));
|
||||
--color-warning-txt-active: color-mix(in srgb, #ffffff 40%, var(--color-warning-txt-base));
|
||||
|
||||
--color-warning-background-selected: color-mix(in srgb, #000000 70%, var(--color-warning-item-base));
|
||||
--color-warning-background-hover: color-mix(in srgb, #000000 60%, var(--color-warning-item-base));
|
||||
--color-warning-background-active: color-mix(in srgb, #000000 50%, var(--color-warning-item-base));
|
||||
--color-warning-background-selected: color-mix(in srgb, #000000 70%, var(--color-warning-txt-base));
|
||||
--color-warning-background-hover: color-mix(in srgb, #000000 60%, var(--color-warning-txt-base));
|
||||
--color-warning-background-active: color-mix(in srgb, #000000 50%, var(--color-warning-txt-base));
|
||||
|
||||
--color-warning-txt-item: #261403;
|
||||
--color-warning-item-base: #ef7f18;
|
||||
--color-warning-item-hover: color-mix(in srgb, #ffffff 20%, var(--color-warning-item-base));
|
||||
--color-warning-item-active: color-mix(in srgb, #ffffff 40%, var(--color-warning-item-base));
|
||||
--color-warning-item-disabled: #60330a;
|
||||
--color-warning-data: #ef7f18;
|
||||
|
||||
/* DANGER */
|
||||
|
||||
@@ -191,15 +185,13 @@
|
||||
--color-danger-txt-hover: color-mix(in srgb, #ffffff 20%, var(--color-danger-txt-base));
|
||||
--color-danger-txt-active: color-mix(in srgb, #ffffff 40%, var(--color-danger-txt-base));
|
||||
|
||||
--color-danger-background-base: #e73642;
|
||||
--color-danger-background-selected: color-mix(in srgb, #000000 70%, var(--color-danger-background-base));
|
||||
--color-danger-background-hover: color-mix(in srgb, #000000 60%, var(--color-danger-background-base));
|
||||
--color-danger-background-active: color-mix(in srgb, #000000 50%, var(--color-danger-background-base));
|
||||
--color-danger-background-selected: color-mix(in srgb, #000000 70%, var(--color-danger-txt-base));
|
||||
--color-danger-background-hover: color-mix(in srgb, #000000 60%, var(--color-danger-txt-base));
|
||||
--color-danger-background-active: color-mix(in srgb, #000000 50%, var(--color-danger-txt-base));
|
||||
|
||||
--color-danger-txt-item: #fff0f1;
|
||||
--color-danger-item-base: #be1621;
|
||||
--color-danger-item-hover: color-mix(in srgb, #000000 20%, var(--color-danger-item-base));
|
||||
--color-danger-item-active: color-mix(in srgb, #000000 40%, var(--color-danger-item-base));
|
||||
--color-danger-item-disabled: #4c090d;
|
||||
--color-danger-data: #c41723;
|
||||
}
|
||||
|
||||
@@ -3,15 +3,6 @@
|
||||
* Default theme is defined in web-core/_colors.pcss
|
||||
*/
|
||||
|
||||
/* Data colors are tuned for the default theme only: themed charts keep each theme's own accent colors */
|
||||
:root:is(.theme-nord, .theme-solarized, .theme-dracula, .theme-monokai) {
|
||||
--color-brand-data: var(--color-brand-item-base);
|
||||
--color-info-data: var(--color-info-item-base);
|
||||
--color-success-data: var(--color-success-item-base);
|
||||
--color-warning-data: var(--color-warning-item-base);
|
||||
--color-danger-data: var(--color-danger-item-base);
|
||||
}
|
||||
|
||||
/*
|
||||
* Nord Theme - Light Mode
|
||||
* An arctic, north-bluish color palette
|
||||
@@ -23,6 +14,8 @@
|
||||
* Aurora: #bf616a (red), #d08770 (orange), #ebcb8b (yellow), #a3be8c (green), #b48ead (purple)
|
||||
*/
|
||||
:root.theme-nord {
|
||||
--color-logo: #5e81ac;
|
||||
|
||||
/* NEUTRALS */
|
||||
--color-neutral-txt-primary: #2e3440;
|
||||
--color-neutral-txt-secondary: #4c566a;
|
||||
@@ -116,6 +109,8 @@
|
||||
* Nord Theme - Dark Mode
|
||||
*/
|
||||
:root.dark.theme-nord {
|
||||
--color-logo: #88c0d0;
|
||||
|
||||
/* NEUTRALS */
|
||||
--color-neutral-txt-primary: #eceff4;
|
||||
--color-neutral-txt-secondary: #d8dee9;
|
||||
@@ -215,6 +210,8 @@
|
||||
* violet #6c71c4, blue #268bd2, cyan #2aa198, green #859900
|
||||
*/
|
||||
:root.theme-solarized {
|
||||
--color-logo: #268bd2;
|
||||
|
||||
/* NEUTRALS */
|
||||
--color-neutral-txt-primary: #657b83;
|
||||
--color-neutral-txt-secondary: #93a1a1;
|
||||
@@ -308,6 +305,8 @@
|
||||
* Solarized Theme - Dark Mode
|
||||
*/
|
||||
:root.dark.theme-solarized {
|
||||
--color-logo: #268bd2;
|
||||
|
||||
/* NEUTRALS */
|
||||
--color-neutral-txt-primary: #839496;
|
||||
--color-neutral-txt-secondary: #586e75;
|
||||
@@ -407,6 +406,8 @@
|
||||
* Purple: #bd93f9, Red: #ff5555, Yellow: #f1fa8c
|
||||
*/
|
||||
:root.theme-dracula {
|
||||
--color-logo: #bd93f9;
|
||||
|
||||
/* NEUTRALS */
|
||||
--color-neutral-txt-primary: #282a36;
|
||||
--color-neutral-txt-secondary: #44475a;
|
||||
@@ -500,6 +501,8 @@
|
||||
* Dracula Theme - Dark Mode
|
||||
*/
|
||||
:root.dark.theme-dracula {
|
||||
--color-logo: #bd93f9;
|
||||
|
||||
/* NEUTRALS */
|
||||
--color-neutral-txt-primary: #f8f8f2;
|
||||
--color-neutral-txt-secondary: #6272a4;
|
||||
@@ -598,6 +601,8 @@
|
||||
* Pink: #f92672, Green: #a6e22e, Blue: #66d9ef, Orange: #fd971f, Purple: #ae81ff
|
||||
*/
|
||||
:root.theme-monokai {
|
||||
--color-logo: #f92672;
|
||||
|
||||
/* NEUTRALS */
|
||||
--color-neutral-txt-primary: #272822;
|
||||
--color-neutral-txt-secondary: #75715e;
|
||||
@@ -691,6 +696,8 @@
|
||||
* Monokai Theme - Dark Mode
|
||||
*/
|
||||
:root.dark.theme-monokai {
|
||||
--color-logo: #f92672;
|
||||
|
||||
/* NEUTRALS */
|
||||
--color-neutral-txt-primary: #f8f8f2;
|
||||
--color-neutral-txt-secondary: #a8a8a0;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<template>
|
||||
<UiLabelValueTag
|
||||
<UiTertiaryTag
|
||||
v-if="parsedTag"
|
||||
ref="labelValueTag"
|
||||
v-tooltip="isLabelValueTagTruncated && value"
|
||||
ref="tertiaryTag"
|
||||
v-tooltip="isTertiaryTagTruncated && value"
|
||||
:accent
|
||||
:removable
|
||||
:truncate="!wrap"
|
||||
@@ -11,7 +11,7 @@
|
||||
>
|
||||
<template #term>{{ parsedTag.term }}</template>
|
||||
{{ parsedTag.label }}
|
||||
</UiLabelValueTag>
|
||||
</UiTertiaryTag>
|
||||
<UiTag
|
||||
v-else
|
||||
v-tooltip
|
||||
@@ -28,8 +28,8 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import UiLabelValueTag from '@core/components/ui/tag/UiLabelValueTag.vue'
|
||||
import UiTag, { type TagAccent } from '@core/components/ui/tag/UiTag.vue'
|
||||
import UiTertiaryTag from '@core/components/ui/tag/UiTertiaryTag.vue'
|
||||
import { vTooltip } from '@core/directives/tooltip.directive.ts'
|
||||
import { hasEllipsis } from '@core/utils/has-ellipsis.util.ts'
|
||||
import { parseTag } from '@core/utils/parse-tag.util.ts'
|
||||
@@ -61,23 +61,23 @@ const parsedTag = computed(() => parseTag(value))
|
||||
|
||||
const isEmpty = computed(() => value.trim() === '')
|
||||
|
||||
const labelValueTag = useTemplateRef('labelValueTag')
|
||||
const tertiaryTag = useTemplateRef('tertiaryTag')
|
||||
|
||||
const labelValueTagElement = computed(() => labelValueTag.value?.$el as HTMLElement | undefined)
|
||||
const tertiaryTagElement = computed(() => tertiaryTag.value?.$el as HTMLElement | undefined)
|
||||
|
||||
const isLabelValueTagTruncated = ref(false)
|
||||
const isTertiaryTagTruncated = ref(false)
|
||||
|
||||
function updateLabelValueTagTruncation() {
|
||||
const element = labelValueTagElement.value
|
||||
function updateTertiaryTagTruncation() {
|
||||
const element = tertiaryTagElement.value
|
||||
|
||||
isLabelValueTagTruncated.value = element !== undefined && [...element.children].some(part => hasEllipsis(part))
|
||||
isTertiaryTagTruncated.value = element !== undefined && [...element.children].some(part => hasEllipsis(part))
|
||||
}
|
||||
|
||||
useResizeObserver(labelValueTagElement, () => updateLabelValueTagTruncation())
|
||||
useResizeObserver(tertiaryTagElement, () => updateTertiaryTagTruncation())
|
||||
|
||||
watch(
|
||||
() => value,
|
||||
() => updateLabelValueTagTruncation(),
|
||||
() => updateTertiaryTagTruncation(),
|
||||
{ flush: 'post' }
|
||||
)
|
||||
</script>
|
||||
|
||||
@@ -1,48 +0,0 @@
|
||||
import VtsIcon from '@core/components/icon/VtsIcon.vue'
|
||||
import UiCheckbox from '@core/components/ui/checkbox/UiCheckbox.vue'
|
||||
import type { CheckboxModel } from '@core/composables/checkbox-state.composable.ts'
|
||||
import { createGlobalTestConfig } from '@core-test/create-global-test-config.ts'
|
||||
import { mount } from '@vue/test-utils'
|
||||
|
||||
type CheckboxProps = {
|
||||
accent?: 'brand' | 'warning' | 'danger'
|
||||
modelValue?: CheckboxModel
|
||||
value?: string
|
||||
disabled?: boolean
|
||||
}
|
||||
|
||||
function mountCheckbox(props: CheckboxProps = {}) {
|
||||
return mount(UiCheckbox, {
|
||||
global: createGlobalTestConfig(),
|
||||
props: { accent: 'brand', modelValue: false, ...props },
|
||||
slots: { default: 'Auto power on' },
|
||||
})
|
||||
}
|
||||
|
||||
it('shows a partly checked model on the checkbox and the input', () => {
|
||||
const wrapper = mountCheckbox({ modelValue: undefined })
|
||||
|
||||
expect(wrapper.getComponent(VtsIcon).props('name')).toBe('status:checkbox-partially-checked')
|
||||
expect(wrapper.get('input').element.indeterminate).toBe(true)
|
||||
})
|
||||
|
||||
it('adds its value to an array model', async () => {
|
||||
const wrapper = mountCheckbox({ modelValue: ['s3'], value: 'nfs' })
|
||||
|
||||
await wrapper.get('input').setValue(true)
|
||||
|
||||
expect(wrapper.emitted('update:modelValue')).toEqual([[['s3', 'nfs']]])
|
||||
})
|
||||
|
||||
it('reads its value in an array model', () => {
|
||||
const icon = mountCheckbox({ modelValue: ['nfs'], value: 'nfs' }).getComponent(VtsIcon)
|
||||
|
||||
expect(icon.props('name')).toBe('status:checkbox-checked')
|
||||
})
|
||||
|
||||
it('applies the disabled variant to the label and disables the input', () => {
|
||||
const wrapper = mountCheckbox({ disabled: true })
|
||||
|
||||
expect(wrapper.get('.checkbox-label').classes()).toContain('disabled')
|
||||
expect(wrapper.get('input').attributes()).toHaveProperty('disabled')
|
||||
})
|
||||
@@ -1,18 +1,17 @@
|
||||
<!-- v9 -->
|
||||
<!-- v8 -->
|
||||
<template>
|
||||
<div class="ui-checkbox">
|
||||
<label :class="classNames" class="checkbox-label" v-bind="wrapperAttrs">
|
||||
<input
|
||||
v-model="checkboxModel"
|
||||
:class="{ indeterminate: isIndeterminate }"
|
||||
:disabled="isDisabled"
|
||||
:indeterminate="isIndeterminate"
|
||||
:value
|
||||
class="input"
|
||||
type="checkbox"
|
||||
v-bind="attrs"
|
||||
/>
|
||||
<span class="fake-checkbox">
|
||||
<VtsIcon :name="icon" size="medium" />
|
||||
<VtsIcon :name="icon" size="medium" class="icon" />
|
||||
</span>
|
||||
<span v-if="slots.default" class="typo-body-regular">
|
||||
<slot />
|
||||
@@ -30,7 +29,6 @@
|
||||
<script lang="ts" setup>
|
||||
import VtsIcon from '@core/components/icon/VtsIcon.vue'
|
||||
import UiInfo from '@core/components/ui/info/UiInfo.vue'
|
||||
import { type CheckboxModel, useCheckboxState } from '@core/composables/checkbox-state.composable.ts'
|
||||
import { useDisabled } from '@core/composables/disabled.composable.ts'
|
||||
import { toVariants } from '@core/utils/to-variants.util.ts'
|
||||
import { computed, type LabelHTMLAttributes, useAttrs } from 'vue'
|
||||
@@ -39,14 +37,13 @@ type CheckboxAccent = 'brand' | 'warning' | 'danger'
|
||||
|
||||
defineOptions({ inheritAttrs: false })
|
||||
|
||||
const { accent, value, disabled } = defineProps<{
|
||||
const { accent, disabled } = defineProps<{
|
||||
accent: CheckboxAccent
|
||||
value?: string
|
||||
disabled?: boolean
|
||||
wrapperAttrs?: LabelHTMLAttributes
|
||||
}>()
|
||||
|
||||
const checkboxModel = defineModel<CheckboxModel>({ default: undefined })
|
||||
const checkboxModel = defineModel<boolean | undefined | string[]>({ default: undefined })
|
||||
|
||||
const slots = defineSlots<{
|
||||
default?(): any
|
||||
@@ -63,7 +60,9 @@ const classNames = computed(() => [
|
||||
}),
|
||||
])
|
||||
|
||||
const { isIndeterminate, icon } = useCheckboxState(checkboxModel, () => value)
|
||||
const isIndeterminate = computed(() => checkboxModel.value === undefined)
|
||||
|
||||
const icon = computed(() => (isIndeterminate.value ? 'fa:minus' : 'fa:check'))
|
||||
|
||||
const attrs = useAttrs()
|
||||
</script>
|
||||
@@ -80,11 +79,23 @@ const attrs = useAttrs()
|
||||
gap: 0.4rem;
|
||||
|
||||
.fake-checkbox {
|
||||
--checkbox-mark-color: var(--color-neutral-background-primary);
|
||||
position: relative;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: 1.6rem;
|
||||
width: 1.6rem;
|
||||
transition:
|
||||
background-color 0.125s ease-in-out,
|
||||
border-color 0.125s ease-in-out;
|
||||
border: 0.2rem solid transparent;
|
||||
border-radius: 0.2rem;
|
||||
flex-shrink: 0;
|
||||
transition: color 0.125s ease-in-out;
|
||||
|
||||
.icon {
|
||||
font-size: 0.75rem;
|
||||
color: var(--color-neutral-background-primary);
|
||||
transition: opacity 0.125s ease-in-out;
|
||||
}
|
||||
}
|
||||
|
||||
.input {
|
||||
@@ -93,6 +104,19 @@ const attrs = useAttrs()
|
||||
pointer-events: none;
|
||||
opacity: 0;
|
||||
|
||||
&.indeterminate + .fake-checkbox > .icon {
|
||||
opacity: 1;
|
||||
color: var(--color-neutral-background-primary);
|
||||
}
|
||||
|
||||
& + .fake-checkbox > .icon {
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
&:checked + .fake-checkbox > .icon {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
&:focus-visible + .fake-checkbox {
|
||||
outline: none;
|
||||
|
||||
@@ -100,8 +124,9 @@ const attrs = useAttrs()
|
||||
content: '';
|
||||
position: absolute;
|
||||
inset: -0.5rem;
|
||||
border: 0.2rem solid var(--color-brand-txt-base);
|
||||
border-radius: 0.4rem;
|
||||
border-width: 0.2rem;
|
||||
border-style: solid;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -109,15 +134,50 @@ const attrs = useAttrs()
|
||||
&.accent--brand {
|
||||
.input:not(:disabled) {
|
||||
& + .fake-checkbox {
|
||||
color: var(--color-brand-txt-base);
|
||||
border-color: var(--color-brand-txt-base);
|
||||
}
|
||||
|
||||
&.indeterminate + .fake-checkbox {
|
||||
background-color: var(--color-brand-txt-base);
|
||||
|
||||
&:hover {
|
||||
border-color: transparent;
|
||||
background-color: var(--color-brand-txt-hover);
|
||||
}
|
||||
|
||||
&:active {
|
||||
background-color: var(--color-brand-txt-active);
|
||||
}
|
||||
}
|
||||
|
||||
&.indeterminate:hover + .fake-checkbox {
|
||||
border-color: transparent;
|
||||
background-color: var(--color-brand-txt-hover);
|
||||
}
|
||||
|
||||
&:hover + .fake-checkbox {
|
||||
color: var(--color-brand-txt-hover);
|
||||
border-color: var(--color-brand-txt-hover);
|
||||
}
|
||||
|
||||
&:focus-visible + .fake-checkbox::before {
|
||||
border: 0.2rem solid var(--color-brand-txt-base);
|
||||
}
|
||||
|
||||
&:active + .fake-checkbox {
|
||||
color: var(--color-brand-txt-active);
|
||||
border-color: var(--color-brand-txt-active);
|
||||
}
|
||||
|
||||
&:checked + .fake-checkbox {
|
||||
border-color: transparent;
|
||||
background-color: var(--color-brand-txt-base);
|
||||
}
|
||||
|
||||
&:checked:hover + .fake-checkbox {
|
||||
background-color: var(--color-brand-txt-hover);
|
||||
}
|
||||
|
||||
&:checked:active + .fake-checkbox {
|
||||
background-color: var(--color-brand-txt-active);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -125,15 +185,50 @@ const attrs = useAttrs()
|
||||
&.accent--warning {
|
||||
.input:not(:disabled) {
|
||||
& + .fake-checkbox {
|
||||
color: var(--color-warning-txt-base);
|
||||
border-color: var(--color-warning-txt-base);
|
||||
}
|
||||
|
||||
&.indeterminate + .fake-checkbox {
|
||||
background-color: var(--color-warning-txt-base);
|
||||
|
||||
&:hover {
|
||||
border-color: transparent;
|
||||
background-color: var(--color-warning-txt-hover);
|
||||
}
|
||||
|
||||
&:active {
|
||||
background-color: var(--color-warning-txt-active);
|
||||
}
|
||||
}
|
||||
|
||||
&.indeterminate:hover + .fake-checkbox {
|
||||
border-color: transparent;
|
||||
background-color: var(--color-warning-txt-hover);
|
||||
}
|
||||
|
||||
&:hover + .fake-checkbox {
|
||||
color: var(--color-warning-txt-hover);
|
||||
border-color: var(--color-warning-txt-hover);
|
||||
}
|
||||
|
||||
&:focus-visible + .fake-checkbox::before {
|
||||
border: 0.2rem solid var(--color-brand-txt-base);
|
||||
}
|
||||
|
||||
&:active + .fake-checkbox {
|
||||
color: var(--color-warning-txt-active);
|
||||
border-color: var(--color-warning-txt-active);
|
||||
}
|
||||
|
||||
&:checked + .fake-checkbox {
|
||||
border-color: transparent;
|
||||
background-color: var(--color-warning-txt-base);
|
||||
}
|
||||
|
||||
&:checked:hover + .fake-checkbox {
|
||||
background-color: var(--color-warning-txt-hover);
|
||||
}
|
||||
|
||||
&:checked:active + .fake-checkbox {
|
||||
background-color: var(--color-warning-txt-active);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -141,27 +236,73 @@ const attrs = useAttrs()
|
||||
&.accent--danger {
|
||||
.input:not(:disabled) {
|
||||
& + .fake-checkbox {
|
||||
color: var(--color-danger-txt-base);
|
||||
border-color: var(--color-danger-txt-base);
|
||||
|
||||
> .icon {
|
||||
color: var(--color-danger-txt-item);
|
||||
}
|
||||
}
|
||||
|
||||
&.indeterminate + .fake-checkbox {
|
||||
background-color: var(--color-danger-txt-base);
|
||||
|
||||
&:hover {
|
||||
border-color: transparent;
|
||||
background-color: var(--color-danger-txt-hover);
|
||||
}
|
||||
|
||||
&:active {
|
||||
background-color: var(--color-danger-txt-active);
|
||||
}
|
||||
}
|
||||
|
||||
&.indeterminate:hover + .fake-checkbox {
|
||||
border-color: transparent;
|
||||
background-color: var(--color-danger-txt-hover);
|
||||
}
|
||||
|
||||
&:hover + .fake-checkbox {
|
||||
color: var(--color-danger-txt-hover);
|
||||
border-color: var(--color-danger-txt-hover);
|
||||
}
|
||||
|
||||
&:focus-visible + .fake-checkbox::before {
|
||||
border: 0.2rem solid var(--color-brand-txt-base);
|
||||
}
|
||||
|
||||
&:active + .fake-checkbox {
|
||||
color: var(--color-danger-txt-active);
|
||||
border-color: var(--color-danger-txt-active);
|
||||
}
|
||||
|
||||
&:checked + .fake-checkbox {
|
||||
border-color: transparent;
|
||||
background-color: var(--color-danger-txt-base);
|
||||
}
|
||||
|
||||
&:checked:hover + .fake-checkbox {
|
||||
background-color: var(--color-danger-txt-hover);
|
||||
}
|
||||
|
||||
&:checked:active + .fake-checkbox {
|
||||
background-color: var(--color-danger-txt-active);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&.disabled {
|
||||
color: var(--color-neutral-txt-secondary);
|
||||
}
|
||||
.input:disabled {
|
||||
& + .fake-checkbox {
|
||||
cursor: not-allowed;
|
||||
border-color: var(--color-neutral-txt-secondary);
|
||||
|
||||
.input:disabled + .fake-checkbox {
|
||||
--checkbox-mark-color: var(--color-neutral-background-disabled);
|
||||
color: var(--color-neutral-txt-secondary);
|
||||
cursor: not-allowed;
|
||||
> .icon {
|
||||
color: var(--color-neutral-background-disabled);
|
||||
}
|
||||
}
|
||||
|
||||
&:checked + .fake-checkbox,
|
||||
&.indeterminate + .fake-checkbox {
|
||||
border-color: transparent;
|
||||
background-color: var(--color-neutral-txt-secondary);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -117,7 +117,7 @@ const className = computed(() => [
|
||||
color: var(--color-brand-item-base);
|
||||
|
||||
.fill {
|
||||
stroke: var(--color-brand-data);
|
||||
stroke: var(--color-brand-item-base);
|
||||
}
|
||||
|
||||
.background {
|
||||
@@ -129,7 +129,7 @@ const className = computed(() => [
|
||||
color: var(--color-info-item-base);
|
||||
|
||||
.fill {
|
||||
stroke: var(--color-info-data);
|
||||
stroke: var(--color-info-item-base);
|
||||
}
|
||||
|
||||
.background {
|
||||
@@ -137,7 +137,7 @@ const className = computed(() => [
|
||||
}
|
||||
|
||||
.success {
|
||||
stroke: var(--color-success-data);
|
||||
stroke: var(--color-success-item-base);
|
||||
}
|
||||
|
||||
.icon {
|
||||
@@ -149,7 +149,7 @@ const className = computed(() => [
|
||||
color: var(--color-warning-item-base);
|
||||
|
||||
.fill {
|
||||
stroke: var(--color-warning-data);
|
||||
stroke: var(--color-warning-item-base);
|
||||
}
|
||||
|
||||
.background {
|
||||
@@ -161,7 +161,7 @@ const className = computed(() => [
|
||||
color: var(--color-danger-item-base);
|
||||
|
||||
.fill {
|
||||
stroke: var(--color-danger-data);
|
||||
stroke: var(--color-danger-item-base);
|
||||
}
|
||||
|
||||
.background {
|
||||
|
||||
@@ -80,7 +80,7 @@ const computedSegments = computed(() => {
|
||||
fill: transparent;
|
||||
|
||||
&.accent--info {
|
||||
stroke: var(--color-info-data);
|
||||
stroke: var(--color-info-item-base);
|
||||
}
|
||||
|
||||
&.accent--secondary {
|
||||
@@ -88,15 +88,15 @@ const computedSegments = computed(() => {
|
||||
}
|
||||
|
||||
&.accent--success {
|
||||
stroke: var(--color-success-data);
|
||||
stroke: var(--color-success-item-base);
|
||||
}
|
||||
|
||||
&.accent--warning {
|
||||
stroke: var(--color-warning-data);
|
||||
stroke: var(--color-warning-item-base);
|
||||
}
|
||||
|
||||
&.accent--danger {
|
||||
stroke: var(--color-danger-data);
|
||||
stroke: var(--color-danger-item-base);
|
||||
}
|
||||
|
||||
&.accent--muted {
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
import UiGroupSubcategory from '@core/components/ui/group-subcategory/UiGroupSubcategory.vue'
|
||||
import { createGlobalTestConfig } from '@core-test/create-global-test-config.ts'
|
||||
import { mount } from '@vue/test-utils'
|
||||
|
||||
function mountGroupSubcategory(slots: Record<string, string> = {}) {
|
||||
return mount(UiGroupSubcategory, {
|
||||
global: createGlobalTestConfig(),
|
||||
slots: { default: 'Into a pool', ...slots },
|
||||
})
|
||||
}
|
||||
|
||||
it('renders the title', () => {
|
||||
expect(mountGroupSubcategory().get('.title').text()).toBe('Into a pool')
|
||||
})
|
||||
|
||||
it('renders the info only when it is given', () => {
|
||||
expect(mountGroupSubcategory({ info: 'Writes to a pool' }).get('.info').text()).toBe('Writes to a pool')
|
||||
expect(mountGroupSubcategory().find('.info').exists()).toBe(false)
|
||||
})
|
||||
@@ -1,33 +0,0 @@
|
||||
<!-- v1 -->
|
||||
<template>
|
||||
<div class="ui-group-subcategory">
|
||||
<span class="title typo-caption-small"><slot /></span>
|
||||
<span v-if="slots.info" class="info typo-body-regular-small"><slot name="info" /></span>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
const slots = defineSlots<{
|
||||
default(): any
|
||||
info?(): any
|
||||
}>()
|
||||
</script>
|
||||
|
||||
<style lang="postcss" scoped>
|
||||
.ui-group-subcategory {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.8rem;
|
||||
color: var(--color-neutral-txt-secondary);
|
||||
overflow-wrap: break-word;
|
||||
|
||||
.title {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.info {
|
||||
white-space: nowrap;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,216 +0,0 @@
|
||||
<!-- v1 -->
|
||||
<template>
|
||||
<label :class="variants" class="ui-image-radio-button typo-body-regular">
|
||||
<span class="image">
|
||||
<img :src :alt />
|
||||
</span>
|
||||
<span class="radio-wrapper typo-body-regular">
|
||||
<span class="radio">
|
||||
<input v-model="model" :disabled="isDisabled" :value class="input" type="radio" />
|
||||
<VtsIcon name="status:radio-button" size="medium" />
|
||||
</span>
|
||||
<slot />
|
||||
</span>
|
||||
</label>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import VtsIcon from '@core/components/icon/VtsIcon.vue'
|
||||
import { useDisabled } from '@core/composables/disabled.composable.ts'
|
||||
import { toVariants } from '@core/utils/to-variants.util.ts'
|
||||
import { computed } from 'vue'
|
||||
|
||||
const { accent, value, disabled, size } = defineProps<{
|
||||
accent: 'brand' | 'warning' | 'danger'
|
||||
size: 'small' | 'medium'
|
||||
value: unknown
|
||||
src: string
|
||||
alt: string
|
||||
disabled?: boolean
|
||||
}>()
|
||||
|
||||
const model = defineModel<string>()
|
||||
|
||||
defineSlots<{
|
||||
default(): any
|
||||
}>()
|
||||
|
||||
const variants = computed(() => toVariants({ accent, size }))
|
||||
const isDisabled = useDisabled(() => disabled)
|
||||
</script>
|
||||
|
||||
<style lang="postcss" scoped>
|
||||
.ui-image-radio-button {
|
||||
--radio-color: var(--accent-color);
|
||||
--radio-dot-color: var(--color-neutral-background-primary);
|
||||
cursor: pointer;
|
||||
border: 0.1rem solid var(--color-neutral-border);
|
||||
border-radius: 0.4rem;
|
||||
overflow: hidden;
|
||||
|
||||
.image {
|
||||
border-bottom: 0.1rem solid;
|
||||
border-color: inherit;
|
||||
overflow: hidden;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
}
|
||||
}
|
||||
|
||||
.radio {
|
||||
position: relative;
|
||||
display: inline-flex;
|
||||
flex-shrink: 0;
|
||||
border-radius: 50%;
|
||||
color: var(--radio-color);
|
||||
transition:
|
||||
color 0.125s ease-in-out,
|
||||
background-color 0.125s ease-in-out;
|
||||
|
||||
&:has(.input:checked) {
|
||||
background-color: var(--radio-color);
|
||||
|
||||
&::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
width: 0.6rem;
|
||||
height: 0.6rem;
|
||||
margin: auto;
|
||||
border-radius: 50%;
|
||||
background-color: var(--radio-dot-color);
|
||||
}
|
||||
}
|
||||
|
||||
&:has(.input:focus-visible)::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
inset: -0.4rem;
|
||||
border: 0.2rem solid var(--color-brand-txt-base);
|
||||
border-radius: 0.4rem;
|
||||
}
|
||||
|
||||
.input {
|
||||
opacity: 0;
|
||||
position: absolute;
|
||||
pointer-events: none;
|
||||
}
|
||||
}
|
||||
|
||||
/* ACCENT */
|
||||
|
||||
&.accent--brand {
|
||||
--accent-color: var(--color-brand-txt-base);
|
||||
--accent-hover-color: var(--color-brand-txt-hover);
|
||||
--accent-checked-color: var(--color-brand-item-base);
|
||||
--accent-active-color: var(--color-brand-txt-active);
|
||||
}
|
||||
|
||||
&.accent--warning {
|
||||
--accent-color: var(--color-warning-txt-base);
|
||||
--accent-hover-color: var(--color-warning-txt-hover);
|
||||
--accent-checked-color: var(--color-warning-item-base);
|
||||
--accent-active-color: var(--color-warning-txt-active);
|
||||
}
|
||||
|
||||
&.accent--danger {
|
||||
--accent-color: var(--color-danger-txt-base);
|
||||
--accent-hover-color: var(--color-danger-txt-hover);
|
||||
--accent-checked-color: var(--color-danger-item-base);
|
||||
--accent-active-color: var(--color-danger-txt-active);
|
||||
}
|
||||
|
||||
/* DISABLED */
|
||||
|
||||
&:has(.input:disabled) {
|
||||
cursor: not-allowed;
|
||||
--accent-color: var(--color-neutral-txt-secondary);
|
||||
--radio-dot-color: var(--color-neutral-background-disabled);
|
||||
}
|
||||
.radio-wrapper {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.8rem;
|
||||
padding: 1.6rem;
|
||||
background-color: var(--color-neutral-background-primary);
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
/* INITIAL BORDER EXCEPT BRAND */
|
||||
|
||||
&.accent--warning,
|
||||
&.accent--danger {
|
||||
border-color: var(--accent-color);
|
||||
}
|
||||
|
||||
/* CHECKED STATE */
|
||||
|
||||
&:has(input:checked:not(:disabled)) {
|
||||
border-color: var(--accent-checked-color);
|
||||
}
|
||||
|
||||
/* HOVER STATE */
|
||||
|
||||
&:hover:not(:has(input:disabled)) {
|
||||
--radio-color: var(--accent-hover-color);
|
||||
border-color: var(--accent-hover-color);
|
||||
}
|
||||
|
||||
/* ACTIVE STATE */
|
||||
|
||||
&:active:not(:has(input:disabled)) {
|
||||
--radio-color: var(--accent-active-color);
|
||||
border-color: var(--accent-active-color);
|
||||
}
|
||||
|
||||
/* DISABLED STATE */
|
||||
|
||||
&:has(input:disabled) {
|
||||
border-color: var(--color-neutral-border);
|
||||
|
||||
.image {
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
.radio-wrapper {
|
||||
background-color: var(--color-neutral-background-disabled);
|
||||
cursor: not-allowed;
|
||||
}
|
||||
}
|
||||
|
||||
/* SIZES */
|
||||
|
||||
&.size--small {
|
||||
height: 16.4rem;
|
||||
width: 12.8rem;
|
||||
|
||||
.image {
|
||||
height: 10.8rem;
|
||||
}
|
||||
|
||||
.radio-wrapper {
|
||||
height: 5.6rem;
|
||||
}
|
||||
}
|
||||
|
||||
&.size--medium {
|
||||
height: 25.6rem;
|
||||
width: 20rem;
|
||||
|
||||
.image {
|
||||
height: 20rem;
|
||||
}
|
||||
|
||||
.radio-wrapper {
|
||||
height: 5.6rem;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -72,7 +72,7 @@ const classNames = computed(() => toVariants({ accent }))
|
||||
|
||||
&.accent--info {
|
||||
.circle-icon {
|
||||
color: var(--color-info-data);
|
||||
color: var(--color-info-item-base);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -84,19 +84,19 @@ const classNames = computed(() => toVariants({ accent }))
|
||||
|
||||
&.accent--success {
|
||||
.circle-icon {
|
||||
color: var(--color-success-data);
|
||||
color: var(--color-success-item-base);
|
||||
}
|
||||
}
|
||||
|
||||
&.accent--warning {
|
||||
.circle-icon {
|
||||
color: var(--color-warning-data);
|
||||
color: var(--color-warning-item-base);
|
||||
}
|
||||
}
|
||||
|
||||
&.accent--danger {
|
||||
.circle-icon {
|
||||
color: var(--color-danger-data);
|
||||
color: var(--color-danger-item-base);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -57,19 +57,19 @@ const className = computed(() => toVariants({ accent }))
|
||||
/* ACCENT */
|
||||
&.accent--info {
|
||||
.fill {
|
||||
background-color: var(--color-info-data);
|
||||
background-color: var(--color-info-item-base);
|
||||
}
|
||||
}
|
||||
|
||||
&.accent--warning {
|
||||
.fill {
|
||||
background-color: var(--color-warning-data);
|
||||
background-color: var(--color-warning-item-base);
|
||||
}
|
||||
}
|
||||
|
||||
&.accent--danger {
|
||||
.fill {
|
||||
background-color: var(--color-danger-data);
|
||||
background-color: var(--color-danger-item-base);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<!-- v7 -->
|
||||
<!-- v4 -->
|
||||
<template>
|
||||
<label :class="variant" class="ui-radio-button typo-body-regular">
|
||||
<span class="radio">
|
||||
<span class="radio-container">
|
||||
<input v-model="model" :disabled="isDisabled" :value class="input" type="radio" />
|
||||
<VtsIcon name="status:radio-button" size="medium" />
|
||||
<VtsIcon name="fa:circle" size="medium" class="radio-icon" />
|
||||
</span>
|
||||
<slot />
|
||||
</label>
|
||||
@@ -34,86 +34,120 @@ const isDisabled = useDisabled(() => disabled)
|
||||
|
||||
<style lang="postcss" scoped>
|
||||
.ui-radio-button {
|
||||
--radio-dot-color: var(--color-neutral-background-primary);
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 0.8rem;
|
||||
|
||||
.radio {
|
||||
position: relative;
|
||||
.radio-container {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
flex-shrink: 0;
|
||||
border-radius: 50%;
|
||||
color: var(--radio-color);
|
||||
justify-content: center;
|
||||
border: 0.2rem solid var(--accent-color);
|
||||
background-color: transparent;
|
||||
border-radius: 0.8rem;
|
||||
width: 1.6rem;
|
||||
height: 1.6rem;
|
||||
position: relative;
|
||||
transition:
|
||||
color 0.125s ease-in-out,
|
||||
border-color 0.125s ease-in-out,
|
||||
background-color 0.125s ease-in-out;
|
||||
|
||||
&:has(.input:checked) {
|
||||
background-color: var(--radio-color);
|
||||
&:has(input:focus-visible) {
|
||||
outline: none;
|
||||
|
||||
&::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
width: 0.6rem;
|
||||
height: 0.6rem;
|
||||
margin: auto;
|
||||
border-radius: 50%;
|
||||
background-color: var(--radio-dot-color);
|
||||
content: '';
|
||||
inset: -0.5rem;
|
||||
border: 0.2rem solid var(--color-brand-txt-base);
|
||||
border-radius: 0.4rem;
|
||||
}
|
||||
}
|
||||
|
||||
&:has(.input:focus-visible)::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
inset: -0.4rem;
|
||||
border: 0.2rem solid var(--color-brand-txt-base);
|
||||
border-radius: 0.4rem;
|
||||
&:has(.input:checked) {
|
||||
background-color: var(--accent-color);
|
||||
}
|
||||
|
||||
/* INPUT */
|
||||
|
||||
.input {
|
||||
opacity: 0;
|
||||
position: absolute;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
/* ICON */
|
||||
|
||||
.radio-icon {
|
||||
font-size: 0.8rem;
|
||||
transition: font-size 0.125s ease-in-out;
|
||||
color: var(--radio-icon-color);
|
||||
--radio-icon-color: var(--color-neutral-background-primary);
|
||||
}
|
||||
|
||||
.input:not(:checked) + .radio-icon {
|
||||
font-size: 1.2rem;
|
||||
}
|
||||
|
||||
.input:disabled + .radio-icon {
|
||||
--radio-icon-color: var(--color-neutral-background-disabled);
|
||||
}
|
||||
}
|
||||
|
||||
/* ACCENT */
|
||||
|
||||
&.accent--brand {
|
||||
--radio-color: var(--color-brand-txt-base);
|
||||
--accent-color: var(--color-brand-item-base);
|
||||
|
||||
&:hover {
|
||||
--radio-color: var(--color-brand-txt-hover);
|
||||
--accent-color: var(--color-brand-item-hover);
|
||||
}
|
||||
|
||||
&:active {
|
||||
--radio-color: var(--color-brand-txt-active);
|
||||
--accent-color: var(--color-brand-item-active);
|
||||
}
|
||||
|
||||
&:has(.input:checked:not(:disabled)) {
|
||||
.radio-icon {
|
||||
--radio-icon-color: var(--color-brand-txt-item);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&.accent--warning {
|
||||
--radio-color: var(--color-warning-txt-base);
|
||||
--accent-color: var(--color-warning-item-base);
|
||||
|
||||
&:hover {
|
||||
--radio-color: var(--color-warning-txt-hover);
|
||||
--accent-color: var(--color-warning-item-hover);
|
||||
}
|
||||
|
||||
&:active {
|
||||
--radio-color: var(--color-warning-txt-active);
|
||||
--accent-color: var(--color-warning-item-active);
|
||||
}
|
||||
|
||||
&:has(.input:checked:not(:disabled)) {
|
||||
.radio-icon {
|
||||
--radio-icon-color: var(--color-warning-txt-item);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&.accent--danger {
|
||||
--radio-color: var(--color-danger-txt-base);
|
||||
--accent-color: var(--color-danger-item-base);
|
||||
|
||||
&:hover {
|
||||
--radio-color: var(--color-danger-txt-hover);
|
||||
--accent-color: var(--color-danger-item-hover);
|
||||
}
|
||||
|
||||
&:active {
|
||||
--radio-color: var(--color-danger-txt-active);
|
||||
--accent-color: var(--color-danger-item-active);
|
||||
}
|
||||
|
||||
&:has(.input:checked:not(:disabled)) {
|
||||
.radio-icon {
|
||||
--radio-icon-color: var(--color-danger-txt-item);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -121,9 +155,7 @@ const isDisabled = useDisabled(() => disabled)
|
||||
|
||||
&:has(.input:disabled) {
|
||||
cursor: not-allowed;
|
||||
color: var(--color-neutral-txt-secondary);
|
||||
--radio-color: var(--color-neutral-txt-secondary);
|
||||
--radio-dot-color: var(--color-neutral-background-disabled);
|
||||
--accent-color: var(--color-neutral-txt-secondary);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,77 +0,0 @@
|
||||
import UiInfo from '@core/components/ui/info/UiInfo.vue'
|
||||
import UiLabel from '@core/components/ui/label/UiLabel.vue'
|
||||
import type { RichCheckboxAccent } from '@core/components/ui/rich-checkbox/UiRichCheckbox.vue'
|
||||
import UiRichCheckboxGroup from '@core/components/ui/rich-checkbox-group/UiRichCheckboxGroup.vue'
|
||||
import { createGlobalTestConfig } from '@core-test/create-global-test-config.ts'
|
||||
import { mount } from '@vue/test-utils'
|
||||
|
||||
type RichCheckboxGroupProps = {
|
||||
accent?: RichCheckboxAccent
|
||||
label?: string
|
||||
info?: string
|
||||
message?: string
|
||||
vertical?: boolean
|
||||
}
|
||||
|
||||
function mountRichCheckboxGroup(props: RichCheckboxGroupProps = {}, slots: Record<string, string> = {}) {
|
||||
return mount(UiRichCheckboxGroup, {
|
||||
global: createGlobalTestConfig(),
|
||||
props: { accent: 'brand', ...props },
|
||||
slots: { default: '<span class="option">NFS backups</span>', ...slots },
|
||||
})
|
||||
}
|
||||
|
||||
it('renders its options in a group', () => {
|
||||
expect(mountRichCheckboxGroup().get('[role="group"]').find('.option').text()).toBe('NFS backups')
|
||||
})
|
||||
|
||||
it('names the group after its label', () => {
|
||||
const wrapper = mountRichCheckboxGroup({ label: 'Backup repositories' })
|
||||
const labelId = wrapper.get('[role="group"]').attributes('aria-labelledby')
|
||||
|
||||
expect(wrapper.get(`[id="${labelId}"]`).text()).toBe('Backup repositories')
|
||||
})
|
||||
|
||||
it('names the group after the label slot', () => {
|
||||
const wrapper = mountRichCheckboxGroup({}, { label: 'Custom label' })
|
||||
const labelId = wrapper.get('[role="group"]').attributes('aria-labelledby')
|
||||
|
||||
expect(wrapper.get(`[id="${labelId}"]`).text()).toBe('Custom label')
|
||||
})
|
||||
|
||||
it('leaves the group unnamed without a label', () => {
|
||||
const wrapper = mountRichCheckboxGroup()
|
||||
|
||||
expect(wrapper.findComponent(UiLabel).exists()).toBe(false)
|
||||
expect(wrapper.get('[role="group"]').attributes('aria-labelledby')).toBeUndefined()
|
||||
})
|
||||
|
||||
it.each([
|
||||
{ accent: 'brand', labelAccent: 'neutral' },
|
||||
{ accent: 'warning', labelAccent: 'warning' },
|
||||
{ accent: 'danger', labelAccent: 'danger' },
|
||||
] as const)('gives the label a $labelAccent accent with a $accent accent', ({ accent, labelAccent }) => {
|
||||
expect(mountRichCheckboxGroup({ accent, label: 'Label' }).getComponent(UiLabel).props('accent')).toBe(labelAccent)
|
||||
})
|
||||
|
||||
it('applies the vertical variant only when set', () => {
|
||||
expect(mountRichCheckboxGroup({ vertical: true }).get('.group').classes()).toContain('vertical')
|
||||
expect(mountRichCheckboxGroup().get('.group').classes()).not.toContain('vertical')
|
||||
})
|
||||
|
||||
it('shows the info with an info accent', () => {
|
||||
const info = mountRichCheckboxGroup({ info: 'Pick at least one' }).getComponent(UiInfo)
|
||||
|
||||
expect(info.props('accent')).toBe('info')
|
||||
expect(info.text()).toBe('Pick at least one')
|
||||
})
|
||||
|
||||
it.each([
|
||||
{ accent: 'brand', infos: [] },
|
||||
{ accent: 'warning', infos: ['warning'] },
|
||||
{ accent: 'danger', infos: ['danger'] },
|
||||
] as const)('shows the message only with a $accent accent other than brand', ({ accent, infos }) => {
|
||||
const wrapper = mountRichCheckboxGroup({ accent, message: 'Pick at least one' })
|
||||
|
||||
expect(wrapper.findAllComponents(UiInfo).map(info => info.props('accent'))).toEqual(infos)
|
||||
})
|
||||
@@ -1,71 +0,0 @@
|
||||
<!-- v1 -->
|
||||
<template>
|
||||
<div class="ui-rich-checkbox-group">
|
||||
<div v-if="hasLabel" :id="labelId">
|
||||
<slot name="label">
|
||||
<UiLabel :accent="labelAccent">
|
||||
{{ label }}
|
||||
</UiLabel>
|
||||
</slot>
|
||||
</div>
|
||||
<div :aria-labelledby="hasLabel ? labelId : undefined" :class="{ vertical }" class="group" role="group">
|
||||
<slot />
|
||||
</div>
|
||||
<slot v-if="slots.info || info !== undefined" name="info">
|
||||
<UiInfo accent="info">
|
||||
{{ info }}
|
||||
</UiInfo>
|
||||
</slot>
|
||||
<slot v-if="accent !== 'brand' && (slots.message || message !== undefined)" name="message">
|
||||
<UiInfo :accent>
|
||||
{{ message }}
|
||||
</UiInfo>
|
||||
</slot>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import UiInfo from '@core/components/ui/info/UiInfo.vue'
|
||||
import UiLabel from '@core/components/ui/label/UiLabel.vue'
|
||||
import type { RichCheckboxAccent } from '@core/components/ui/rich-checkbox/UiRichCheckbox.vue'
|
||||
import { computed, useId } from 'vue'
|
||||
|
||||
const { accent, label } = defineProps<{
|
||||
accent: RichCheckboxAccent
|
||||
label?: string
|
||||
info?: string
|
||||
message?: string
|
||||
vertical?: boolean
|
||||
}>()
|
||||
|
||||
const slots = defineSlots<{
|
||||
default(): any
|
||||
label?(): any
|
||||
info?(): any
|
||||
message?(): any
|
||||
}>()
|
||||
|
||||
const labelId = useId()
|
||||
|
||||
const hasLabel = computed(() => slots.label !== undefined || label !== undefined)
|
||||
|
||||
const labelAccent = computed(() => (accent === 'brand' ? 'neutral' : accent))
|
||||
</script>
|
||||
|
||||
<style scoped lang="postcss">
|
||||
.ui-rich-checkbox-group {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.8rem;
|
||||
|
||||
.group {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 0.8rem;
|
||||
|
||||
&.vertical {
|
||||
flex-direction: column;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,109 +0,0 @@
|
||||
import VtsIcon from '@core/components/icon/VtsIcon.vue'
|
||||
import UiInfo from '@core/components/ui/info/UiInfo.vue'
|
||||
import UiRichCheckbox, { type RichCheckboxAccent } from '@core/components/ui/rich-checkbox/UiRichCheckbox.vue'
|
||||
import UiTag from '@core/components/ui/tag/UiTag.vue'
|
||||
import type { CheckboxModel } from '@core/composables/checkbox-state.composable.ts'
|
||||
import type { IconName } from '@core/icons'
|
||||
import { createGlobalTestConfig } from '@core-test/create-global-test-config.ts'
|
||||
import { mount, type VueWrapper } from '@vue/test-utils'
|
||||
|
||||
type RichCheckboxProps = {
|
||||
accent?: RichCheckboxAccent
|
||||
modelValue?: CheckboxModel
|
||||
value?: string
|
||||
icon?: IconName
|
||||
tag?: string
|
||||
description?: string
|
||||
message?: string
|
||||
disabled?: boolean
|
||||
'onUpdate:modelValue'?: (model: CheckboxModel) => void
|
||||
}
|
||||
|
||||
function mountRichCheckbox(props: RichCheckboxProps = {}) {
|
||||
return mount(UiRichCheckbox, {
|
||||
global: createGlobalTestConfig(),
|
||||
props: { accent: 'brand', modelValue: false, ...props },
|
||||
slots: { default: 'NFS backups' },
|
||||
})
|
||||
}
|
||||
|
||||
function readIconNames(wrapper: VueWrapper) {
|
||||
return wrapper.findAllComponents(VtsIcon).map(icon => icon.props('name'))
|
||||
}
|
||||
|
||||
it.each([
|
||||
{ model: true, classes: ['checked'], icon: 'status:checkbox-checked' },
|
||||
{ model: undefined, classes: ['indeterminate'], icon: 'status:checkbox-partially-checked' },
|
||||
{ model: false, classes: [], icon: 'status:checkbox' },
|
||||
])('shows the $model model on the card and the checkbox', ({ model, classes, icon }) => {
|
||||
const wrapper = mountRichCheckbox({ modelValue: model })
|
||||
|
||||
expect(wrapper.classes().filter(className => ['checked', 'indeterminate'].includes(className))).toEqual(classes)
|
||||
expect(readIconNames(wrapper)).toEqual([icon])
|
||||
expect(wrapper.get('input').element.indeterminate).toBe(model === undefined)
|
||||
})
|
||||
|
||||
it('keeps showing the model when the parent rejects the change', async () => {
|
||||
const wrapper = mountRichCheckbox({ modelValue: false, 'onUpdate:modelValue': () => undefined })
|
||||
|
||||
await wrapper.get('input').setValue(true)
|
||||
|
||||
expect(wrapper.emitted('update:modelValue')).toEqual([[true]])
|
||||
expect(wrapper.classes()).not.toContain('checked')
|
||||
expect(readIconNames(wrapper)).toEqual(['status:checkbox'])
|
||||
})
|
||||
|
||||
it('adds its value to an array model', async () => {
|
||||
const wrapper = mountRichCheckbox({ modelValue: ['s3'], value: 'nfs' })
|
||||
|
||||
await wrapper.get('input').setValue(true)
|
||||
|
||||
expect(wrapper.emitted('update:modelValue')).toEqual([[['s3', 'nfs']]])
|
||||
})
|
||||
|
||||
it('applies the accent and the disabled variant', () => {
|
||||
const wrapper = mountRichCheckbox({ accent: 'warning', disabled: true })
|
||||
|
||||
expect(wrapper.classes()).toEqual(expect.arrayContaining(['accent--warning', 'disabled']))
|
||||
expect(wrapper.get('input').attributes()).toHaveProperty('disabled')
|
||||
})
|
||||
|
||||
it('names the checkbox after its heading', () => {
|
||||
const wrapper = mountRichCheckbox({ tag: 'Source' })
|
||||
const heading = wrapper.get('.heading')
|
||||
|
||||
expect(wrapper.get('input').attributes('aria-labelledby')).toBe(heading.attributes('id'))
|
||||
expect(heading.text()).toContain('NFS backups')
|
||||
expect(wrapper.getComponent(UiTag).props('accent')).toBe('info')
|
||||
expect(wrapper.getComponent(UiTag).text()).toBe('Source')
|
||||
})
|
||||
|
||||
it('describes the checkbox with its description', () => {
|
||||
const wrapper = mountRichCheckbox({ description: '4.2 TiB free' })
|
||||
const description = wrapper.get('.description')
|
||||
|
||||
expect(description.text()).toBe('4.2 TiB free')
|
||||
expect(wrapper.get('input').attributes('aria-describedby')).toBe(description.attributes('id'))
|
||||
})
|
||||
|
||||
it('renders no tag and no description when none is given', () => {
|
||||
const wrapper = mountRichCheckbox()
|
||||
|
||||
expect(wrapper.findComponent(UiTag).exists()).toBe(false)
|
||||
expect(wrapper.find('.description').exists()).toBe(false)
|
||||
expect(wrapper.get('input').attributes('aria-describedby')).toBeUndefined()
|
||||
})
|
||||
|
||||
it('renders the icon it is given after the checkbox', () => {
|
||||
expect(readIconNames(mountRichCheckbox({ icon: 'fa:server' }))).toEqual(['status:checkbox', 'fa:server'])
|
||||
})
|
||||
|
||||
it.each([
|
||||
{ accent: 'brand', infos: [] },
|
||||
{ accent: 'warning', infos: ['warning'] },
|
||||
{ accent: 'danger', infos: ['danger'] },
|
||||
] as const)('shows the message only with a $accent accent other than brand', ({ accent, infos }) => {
|
||||
const wrapper = mountRichCheckbox({ accent, message: 'Not enough space' })
|
||||
|
||||
expect(wrapper.findAllComponents(UiInfo).map(info => info.props('accent'))).toEqual(infos)
|
||||
})
|
||||
@@ -1,254 +0,0 @@
|
||||
<!-- v1 -->
|
||||
<template>
|
||||
<div :class="className" class="ui-rich-checkbox">
|
||||
<label class="box typo-body-bold">
|
||||
<span class="controls">
|
||||
<span class="checkbox">
|
||||
<input
|
||||
v-model="model"
|
||||
:aria-labelledby="headingId"
|
||||
:aria-describedby="hasDescription ? descriptionId : undefined"
|
||||
:disabled="isDisabled"
|
||||
:indeterminate="isIndeterminate"
|
||||
:value
|
||||
class="input"
|
||||
type="checkbox"
|
||||
/>
|
||||
<VtsIcon :name="checkboxIcon" size="medium" />
|
||||
</span>
|
||||
<VtsIcon v-if="icon" :name="icon" size="medium" />
|
||||
</span>
|
||||
<span class="content">
|
||||
<span :id="headingId" class="heading">
|
||||
<span class="label">
|
||||
<slot />
|
||||
</span>
|
||||
<slot v-if="slots.tag || tag !== undefined" name="tag">
|
||||
<UiTag accent="info" variant="secondary">{{ tag }}</UiTag>
|
||||
</slot>
|
||||
</span>
|
||||
<span v-if="hasDescription" :id="descriptionId" class="description typo-body-regular">
|
||||
<slot name="description">{{ description }}</slot>
|
||||
</span>
|
||||
</span>
|
||||
</label>
|
||||
<slot v-if="slots.info || info !== undefined" name="info">
|
||||
<UiInfo accent="info">{{ info }}</UiInfo>
|
||||
</slot>
|
||||
<slot v-if="accent !== 'brand' && (slots.message || message !== undefined)" name="message">
|
||||
<UiInfo :accent>{{ message }}</UiInfo>
|
||||
</slot>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import VtsIcon from '@core/components/icon/VtsIcon.vue'
|
||||
import UiInfo from '@core/components/ui/info/UiInfo.vue'
|
||||
import UiTag from '@core/components/ui/tag/UiTag.vue'
|
||||
import { type CheckboxModel, useCheckboxState } from '@core/composables/checkbox-state.composable.ts'
|
||||
import { useDisabled } from '@core/composables/disabled.composable.ts'
|
||||
import type { IconName } from '@core/icons'
|
||||
import { toVariants } from '@core/utils/to-variants.util.ts'
|
||||
import { computed, useId } from 'vue'
|
||||
|
||||
export type RichCheckboxAccent = 'brand' | 'warning' | 'danger'
|
||||
|
||||
const { accent, value, description, disabled } = defineProps<{
|
||||
accent: RichCheckboxAccent
|
||||
value?: string
|
||||
icon?: IconName
|
||||
tag?: string
|
||||
description?: string
|
||||
info?: string
|
||||
message?: string
|
||||
disabled?: boolean
|
||||
}>()
|
||||
|
||||
const model = defineModel<CheckboxModel>({ default: undefined })
|
||||
|
||||
const slots = defineSlots<{
|
||||
default(): any
|
||||
tag?(): any
|
||||
description?(): any
|
||||
info?(): any
|
||||
message?(): any
|
||||
}>()
|
||||
|
||||
const headingId = useId()
|
||||
|
||||
const descriptionId = useId()
|
||||
|
||||
const hasDescription = computed(() => slots.description !== undefined || description !== undefined)
|
||||
|
||||
const isDisabled = useDisabled(() => disabled)
|
||||
|
||||
const { isIndeterminate, isChecked, icon: checkboxIcon } = useCheckboxState(model, () => value)
|
||||
|
||||
const className = computed(() =>
|
||||
toVariants({
|
||||
accent,
|
||||
checked: isChecked.value,
|
||||
indeterminate: isIndeterminate.value,
|
||||
disabled: isDisabled.value,
|
||||
})
|
||||
)
|
||||
</script>
|
||||
|
||||
<style lang="postcss" scoped>
|
||||
.ui-rich-checkbox {
|
||||
--box-border-color: var(--accent-color);
|
||||
--box-background-color: var(--color-neutral-background-primary);
|
||||
--border-hover-color: var(--accent-hover-color);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.4rem;
|
||||
|
||||
.box {
|
||||
position: relative;
|
||||
display: flex;
|
||||
flex-grow: 1;
|
||||
align-items: flex-start;
|
||||
gap: 1.2rem;
|
||||
padding: 1.2rem 1.6rem;
|
||||
border: 0.1rem solid var(--box-border-color);
|
||||
border-radius: 0.4rem;
|
||||
background-color: var(--box-background-color);
|
||||
color: var(--color-neutral-txt-primary);
|
||||
cursor: pointer;
|
||||
transition:
|
||||
border-color 0.125s ease-in-out,
|
||||
background-color 0.125s ease-in-out;
|
||||
|
||||
&:has(.input:focus-visible)::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
inset: -0.4rem;
|
||||
border: 0.2rem solid var(--color-brand-txt-base);
|
||||
border-radius: 0.4rem;
|
||||
}
|
||||
}
|
||||
|
||||
.controls {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-shrink: 0;
|
||||
gap: 1.2rem;
|
||||
height: 1lh;
|
||||
}
|
||||
|
||||
.checkbox {
|
||||
position: relative;
|
||||
display: inline-flex;
|
||||
color: var(--checkbox-color);
|
||||
transition: color 0.125s ease-in-out;
|
||||
|
||||
.input {
|
||||
opacity: 0;
|
||||
position: absolute;
|
||||
pointer-events: none;
|
||||
}
|
||||
}
|
||||
|
||||
.content {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
flex: 1;
|
||||
gap: 0.2rem;
|
||||
min-width: 0;
|
||||
overflow-wrap: break-word;
|
||||
}
|
||||
|
||||
.heading {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: flex-start;
|
||||
gap: 0.8rem;
|
||||
}
|
||||
|
||||
.label {
|
||||
flex: auto;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.description {
|
||||
color: var(--color-neutral-txt-secondary);
|
||||
}
|
||||
|
||||
/* ACCENT */
|
||||
|
||||
&.accent--brand {
|
||||
--box-border-color: var(--color-neutral-txt-secondary);
|
||||
--accent-color: var(--color-brand-txt-base);
|
||||
--accent-hover-color: var(--color-brand-txt-hover);
|
||||
--accent-active-color: var(--color-brand-txt-active);
|
||||
--background-checked-color: var(--color-brand-background-selected);
|
||||
--background-hover-color: var(--color-brand-background-hover);
|
||||
--background-active-color: var(--color-brand-background-active);
|
||||
--background-checked-active-color: var(--color-brand-background-hover);
|
||||
}
|
||||
|
||||
&.accent--warning {
|
||||
--accent-color: var(--color-warning-txt-base);
|
||||
--accent-hover-color: var(--color-warning-txt-hover);
|
||||
--accent-active-color: var(--color-warning-txt-active);
|
||||
--background-checked-color: var(--color-warning-background-selected);
|
||||
--background-hover-color: var(--color-warning-background-hover);
|
||||
--background-active-color: var(--color-warning-background-hover);
|
||||
--background-checked-active-color: var(--color-warning-background-hover);
|
||||
}
|
||||
|
||||
&.accent--danger {
|
||||
--border-hover-color: var(--color-danger-txt-base);
|
||||
--accent-color: var(--color-danger-txt-base);
|
||||
--accent-hover-color: var(--color-danger-txt-hover);
|
||||
--accent-active-color: var(--color-danger-txt-active);
|
||||
--background-checked-color: var(--color-danger-background-selected);
|
||||
--background-hover-color: var(--color-danger-background-hover);
|
||||
--background-active-color: var(--color-danger-background-active);
|
||||
--background-checked-active-color: var(--color-danger-background-active);
|
||||
}
|
||||
|
||||
/* INTERACTIONS */
|
||||
|
||||
&:not(.disabled) {
|
||||
&:is(.checked, .indeterminate) .box {
|
||||
--box-border-color: var(--accent-color);
|
||||
--box-background-color: var(--background-checked-color);
|
||||
}
|
||||
|
||||
&.checked .box {
|
||||
--background-active-color: var(--background-checked-active-color);
|
||||
}
|
||||
|
||||
.box {
|
||||
--checkbox-color: var(--accent-color);
|
||||
--checkbox-mark-color: var(--box-background-color);
|
||||
|
||||
&:hover {
|
||||
--checkbox-color: var(--accent-hover-color);
|
||||
--checkbox-mark-color: var(--background-hover-color);
|
||||
border-color: var(--border-hover-color);
|
||||
background-color: var(--background-hover-color);
|
||||
}
|
||||
|
||||
&:active {
|
||||
--checkbox-color: var(--accent-active-color);
|
||||
--checkbox-mark-color: var(--background-active-color);
|
||||
border-color: var(--accent-active-color);
|
||||
background-color: var(--background-active-color);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* DISABLED */
|
||||
|
||||
&.disabled .box {
|
||||
--checkbox-color: var(--color-neutral-txt-secondary);
|
||||
--checkbox-mark-color: var(--color-neutral-background-disabled);
|
||||
border-color: var(--color-neutral-border);
|
||||
background-color: var(--color-neutral-background-disabled);
|
||||
color: var(--color-neutral-txt-secondary);
|
||||
cursor: not-allowed;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,75 +0,0 @@
|
||||
<!-- v1 -->
|
||||
<template>
|
||||
<div class="ui-rich-radio-button-group">
|
||||
<div v-if="slots.label || label !== undefined" :id="labelId">
|
||||
<slot name="label">
|
||||
<UiLabel :accent="labelAccent">
|
||||
{{ label }}
|
||||
</UiLabel>
|
||||
</slot>
|
||||
</div>
|
||||
<div
|
||||
:aria-labelledby="slots.label || label !== undefined ? labelId : undefined"
|
||||
:class="{ vertical }"
|
||||
class="group"
|
||||
role="radiogroup"
|
||||
>
|
||||
<slot />
|
||||
</div>
|
||||
<slot v-if="slots.info || info !== undefined" name="info">
|
||||
<UiInfo accent="info">
|
||||
{{ info }}
|
||||
</UiInfo>
|
||||
</slot>
|
||||
<slot v-if="accent !== 'brand' && (slots.message || message !== undefined)" name="message">
|
||||
<UiInfo :accent>
|
||||
{{ message }}
|
||||
</UiInfo>
|
||||
</slot>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import UiInfo from '@core/components/ui/info/UiInfo.vue'
|
||||
import UiLabel from '@core/components/ui/label/UiLabel.vue'
|
||||
import type { RichRadioButtonAccent } from '@core/components/ui/rich-radio-button/UiRichRadioButton.vue'
|
||||
import { computed, useId } from 'vue'
|
||||
|
||||
const { accent } = defineProps<{
|
||||
accent: RichRadioButtonAccent
|
||||
label?: string
|
||||
info?: string
|
||||
message?: string
|
||||
vertical?: boolean
|
||||
}>()
|
||||
|
||||
const slots = defineSlots<{
|
||||
default(): any
|
||||
label?(): any
|
||||
info?(): any
|
||||
message?(): any
|
||||
}>()
|
||||
|
||||
const labelId = useId()
|
||||
|
||||
const labelAccent = computed(() => (accent === 'brand' ? 'neutral' : accent))
|
||||
</script>
|
||||
|
||||
<style scoped lang="postcss">
|
||||
.ui-rich-radio-button-group {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.8rem;
|
||||
|
||||
.group {
|
||||
display: grid;
|
||||
grid-auto-flow: column;
|
||||
grid-auto-columns: minmax(0, 1fr);
|
||||
gap: 0.8rem;
|
||||
|
||||
&.vertical {
|
||||
grid-auto-flow: row;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,258 +1,246 @@
|
||||
<!-- v1 -->
|
||||
<template>
|
||||
<div :class="className" class="ui-rich-radio-button">
|
||||
<label class="box">
|
||||
<span class="controls">
|
||||
<span class="radio">
|
||||
<input
|
||||
v-model="model"
|
||||
:aria-labelledby="headingId"
|
||||
:aria-describedby="slots.description || description !== undefined ? descriptionId : undefined"
|
||||
:disabled="isDisabled"
|
||||
:value
|
||||
class="input"
|
||||
type="radio"
|
||||
/>
|
||||
<VtsIcon name="status:radio-button" size="medium" />
|
||||
</span>
|
||||
<VtsIcon v-if="icon" :name="icon" size="medium" class="icon" />
|
||||
<label :class="variants" class="ui-rich-radio-button typo-body-regular">
|
||||
<span class="rich-image">
|
||||
<img :src :alt />
|
||||
</span>
|
||||
<span class="radio-wrapper typo-body-regular">
|
||||
<span class="radio-container">
|
||||
<input v-model="model" :disabled="isDisabled" :value class="input" type="radio" />
|
||||
<VtsIcon name="fa:circle" size="small" class="radio-icon" />
|
||||
</span>
|
||||
<span class="content">
|
||||
<span :id="headingId" class="heading">
|
||||
<span class="label typo-body-bold">
|
||||
<slot />
|
||||
</span>
|
||||
<slot v-if="slots.tag || tag !== undefined" name="tag">
|
||||
<UiTag accent="info" variant="secondary">{{ tag }}</UiTag>
|
||||
</slot>
|
||||
</span>
|
||||
<span
|
||||
v-if="slots.description || description !== undefined"
|
||||
:id="descriptionId"
|
||||
class="description typo-body-regular"
|
||||
>
|
||||
<slot name="description">{{ description }}</slot>
|
||||
</span>
|
||||
</span>
|
||||
</label>
|
||||
<slot v-if="slots.info || info !== undefined" name="info">
|
||||
<UiInfo accent="info">{{ info }}</UiInfo>
|
||||
</slot>
|
||||
</div>
|
||||
<slot />
|
||||
</span>
|
||||
</label>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup generic="TValue">
|
||||
<script lang="ts" setup>
|
||||
import VtsIcon from '@core/components/icon/VtsIcon.vue'
|
||||
import UiInfo from '@core/components/ui/info/UiInfo.vue'
|
||||
import UiTag from '@core/components/ui/tag/UiTag.vue'
|
||||
import { useDisabled } from '@core/composables/disabled.composable.ts'
|
||||
import type { IconName } from '@core/icons'
|
||||
import { toVariants } from '@core/utils/to-variants.util.ts'
|
||||
import { computed, useId } from 'vue'
|
||||
import { computed } from 'vue'
|
||||
|
||||
export type RichRadioButtonAccent = 'brand' | 'warning' | 'danger'
|
||||
|
||||
const { accent, disabled } = defineProps<{
|
||||
accent: RichRadioButtonAccent
|
||||
value: TValue
|
||||
icon?: IconName
|
||||
tag?: string
|
||||
description?: string
|
||||
info?: string
|
||||
const { accent, value, disabled, size } = defineProps<{
|
||||
accent: 'brand' | 'warning' | 'danger'
|
||||
size: 'small' | 'medium'
|
||||
value: unknown
|
||||
src: string
|
||||
alt: string
|
||||
disabled?: boolean
|
||||
}>()
|
||||
|
||||
const model = defineModel<TValue>()
|
||||
const model = defineModel<string>()
|
||||
|
||||
const slots = defineSlots<{
|
||||
defineSlots<{
|
||||
default(): any
|
||||
tag?(): any
|
||||
description?(): any
|
||||
info?(): any
|
||||
}>()
|
||||
|
||||
const headingId = useId()
|
||||
|
||||
const descriptionId = useId()
|
||||
|
||||
const variants = computed(() => toVariants({ accent, size }))
|
||||
const isDisabled = useDisabled(() => disabled)
|
||||
|
||||
const className = computed(() => toVariants({ accent, disabled: isDisabled.value }))
|
||||
</script>
|
||||
|
||||
<style lang="postcss" scoped>
|
||||
.ui-rich-radio-button {
|
||||
--radio-dot-color: var(--color-neutral-background-primary);
|
||||
--box-border-color: var(--accent-color);
|
||||
--box-background-color: var(--color-neutral-background-primary);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.4rem;
|
||||
cursor: pointer;
|
||||
border: 0.1rem solid var(--color-neutral-border);
|
||||
border-radius: 0.4rem;
|
||||
overflow: hidden;
|
||||
|
||||
.box {
|
||||
position: relative;
|
||||
.rich-image {
|
||||
border-bottom: 0.1rem solid;
|
||||
border-color: inherit;
|
||||
overflow: hidden;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
flex-grow: 1;
|
||||
align-items: flex-start;
|
||||
gap: 1.2rem;
|
||||
padding: 1.2rem 1.6rem;
|
||||
border: 0.1rem solid var(--box-border-color);
|
||||
border-radius: 0.4rem;
|
||||
background-color: var(--box-background-color);
|
||||
cursor: pointer;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
}
|
||||
}
|
||||
|
||||
.radio-container {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border: 0.2rem solid var(--accent-color);
|
||||
background-color: transparent;
|
||||
border-radius: 0.8rem;
|
||||
width: 1.6rem;
|
||||
height: 1.6rem;
|
||||
position: relative;
|
||||
transition:
|
||||
border-color 0.125s ease-in-out,
|
||||
background-color 0.125s ease-in-out;
|
||||
|
||||
&:has(.input:focus-visible)::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
inset: -0.4rem;
|
||||
border: 0.2rem solid var(--color-brand-txt-base);
|
||||
border-radius: 0.4rem;
|
||||
}
|
||||
}
|
||||
|
||||
.controls {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-shrink: 0;
|
||||
gap: 1.2rem;
|
||||
height: 2.4rem;
|
||||
}
|
||||
|
||||
.radio {
|
||||
position: relative;
|
||||
display: inline-flex;
|
||||
flex-shrink: 0;
|
||||
border-radius: 50%;
|
||||
color: var(--radio-color);
|
||||
transition:
|
||||
color 0.125s ease-in-out,
|
||||
background-color 0.125s ease-in-out;
|
||||
|
||||
&:has(.input:checked) {
|
||||
background-color: var(--radio-color);
|
||||
&:has(input:focus-visible) {
|
||||
outline: none;
|
||||
|
||||
&::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
width: 0.6rem;
|
||||
height: 0.6rem;
|
||||
margin: auto;
|
||||
border-radius: 50%;
|
||||
background-color: var(--radio-dot-color);
|
||||
content: '';
|
||||
inset: -0.5rem;
|
||||
border: 0.2rem solid var(--color-brand-txt-base);
|
||||
border-radius: 0.4rem;
|
||||
}
|
||||
}
|
||||
|
||||
&:has(.input:checked) {
|
||||
border-color: var(--accent-checked-color);
|
||||
background-color: var(--accent-checked-color);
|
||||
}
|
||||
|
||||
&:has(.input:checked:disabled) {
|
||||
border-color: var(--color-neutral-txt-secondary);
|
||||
background-color: var(--color-neutral-txt-secondary);
|
||||
}
|
||||
|
||||
.input {
|
||||
opacity: 0;
|
||||
position: absolute;
|
||||
pointer-events: none;
|
||||
}
|
||||
}
|
||||
|
||||
.icon {
|
||||
color: var(--color-neutral-txt-primary);
|
||||
}
|
||||
.radio-icon {
|
||||
font-size: 0.8rem;
|
||||
position: absolute;
|
||||
transition: font-size 0.125s ease-in-out;
|
||||
color: var(--radio-icon-color);
|
||||
--radio-icon-color: var(--color-neutral-background-primary);
|
||||
}
|
||||
|
||||
.content {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
flex: 1;
|
||||
gap: 0.2rem;
|
||||
min-width: 0;
|
||||
}
|
||||
.input:not(:checked) + .radio-icon {
|
||||
font-size: 1.2rem;
|
||||
}
|
||||
|
||||
.heading {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: flex-start;
|
||||
gap: 0.8rem;
|
||||
}
|
||||
|
||||
.label {
|
||||
flex: auto;
|
||||
min-width: 0;
|
||||
overflow-wrap: break-word;
|
||||
color: var(--color-neutral-txt-primary);
|
||||
}
|
||||
|
||||
.description {
|
||||
overflow-wrap: break-word;
|
||||
color: var(--color-neutral-txt-secondary);
|
||||
.input:disabled + .radio-icon {
|
||||
--radio-icon-color: var(--color-neutral-background-disabled);
|
||||
}
|
||||
}
|
||||
|
||||
/* ACCENT */
|
||||
|
||||
&.accent--brand {
|
||||
--box-border-color: var(--color-neutral-txt-secondary);
|
||||
--accent-color: var(--color-brand-txt-base);
|
||||
--accent-hover-color: var(--color-brand-txt-hover);
|
||||
--accent-checked-color: var(--color-brand-item-base);
|
||||
--accent-active-color: var(--color-brand-txt-active);
|
||||
--background-checked-color: var(--color-brand-background-selected);
|
||||
--background-hover-color: var(--color-brand-background-hover);
|
||||
--background-active-color: var(--color-brand-background-active);
|
||||
--background-checked-active-color: var(--color-brand-background-hover);
|
||||
}
|
||||
|
||||
&.accent--warning {
|
||||
--accent-color: var(--color-warning-txt-base);
|
||||
--accent-hover-color: var(--color-warning-txt-hover);
|
||||
--accent-checked-color: var(--color-warning-item-base);
|
||||
--accent-active-color: var(--color-warning-txt-active);
|
||||
--background-checked-color: var(--color-warning-background-selected);
|
||||
--background-hover-color: var(--color-warning-background-hover);
|
||||
--background-active-color: var(--color-warning-background-hover);
|
||||
--background-checked-active-color: var(--color-warning-background-hover);
|
||||
}
|
||||
|
||||
&.accent--danger {
|
||||
--accent-color: var(--color-danger-txt-base);
|
||||
--accent-hover-color: var(--color-danger-txt-hover);
|
||||
--accent-checked-color: var(--color-danger-item-base);
|
||||
--accent-active-color: var(--color-danger-txt-active);
|
||||
--background-checked-color: var(--color-danger-background-selected);
|
||||
--background-hover-color: var(--color-danger-background-hover);
|
||||
--background-active-color: var(--color-danger-background-active);
|
||||
--background-checked-active-color: var(--color-danger-background-active);
|
||||
}
|
||||
|
||||
/* INTERACTIONS */
|
||||
|
||||
&:not(.disabled) .box {
|
||||
--radio-color: var(--accent-color);
|
||||
|
||||
&:has(.input:checked) {
|
||||
--box-border-color: var(--accent-color);
|
||||
--box-background-color: var(--background-checked-color);
|
||||
--background-active-color: var(--background-checked-active-color);
|
||||
}
|
||||
|
||||
&:hover {
|
||||
--radio-color: var(--accent-hover-color);
|
||||
border-color: var(--color-brand-txt-hover);
|
||||
background-color: var(--background-hover-color);
|
||||
}
|
||||
|
||||
&:active {
|
||||
--radio-color: var(--accent-active-color);
|
||||
border-color: var(--color-brand-txt-active);
|
||||
background-color: var(--background-active-color);
|
||||
}
|
||||
}
|
||||
|
||||
/* DISABLED */
|
||||
|
||||
&.disabled .box {
|
||||
--radio-color: var(--color-neutral-txt-secondary);
|
||||
--radio-dot-color: var(--color-neutral-background-disabled);
|
||||
border-color: var(--color-neutral-border);
|
||||
background-color: var(--color-neutral-background-disabled);
|
||||
&:has(.input:disabled) {
|
||||
cursor: not-allowed;
|
||||
--accent-color: var(--color-neutral-txt-secondary);
|
||||
}
|
||||
.radio-wrapper {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.8rem;
|
||||
padding: 1.6rem;
|
||||
background-color: var(--color-neutral-background-primary);
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.label,
|
||||
.icon {
|
||||
color: var(--color-neutral-txt-secondary);
|
||||
/* INITIAL BORDER EXCEPT BRAND */
|
||||
|
||||
&.accent--warning,
|
||||
&.accent--danger {
|
||||
border-color: var(--accent-color);
|
||||
}
|
||||
|
||||
/* CHECKED STATE */
|
||||
|
||||
&:has(input:checked:not(:disabled)) {
|
||||
border-color: var(--accent-checked-color);
|
||||
|
||||
.radio-container {
|
||||
border-color: var(--accent-checked-color);
|
||||
background-color: var(--accent-checked-color);
|
||||
}
|
||||
}
|
||||
|
||||
/* HOVER STATE */
|
||||
|
||||
&:hover:not(:has(input:disabled)) {
|
||||
border-color: var(--accent-hover-color);
|
||||
|
||||
.radio-container {
|
||||
border-color: var(--accent-hover-color);
|
||||
}
|
||||
.radio-container:has(.input:checked) {
|
||||
background-color: var(--accent-hover-color);
|
||||
}
|
||||
}
|
||||
|
||||
/* ACTIVE STATE */
|
||||
|
||||
&:active:not(:has(input:disabled)) {
|
||||
.radio-container {
|
||||
border-color: var(--accent-active-color);
|
||||
}
|
||||
.radio-container:has(.input:checked) {
|
||||
background-color: var(--accent-active-color);
|
||||
}
|
||||
}
|
||||
|
||||
/* DISABLED STATE */
|
||||
|
||||
&:has(input:disabled) {
|
||||
border-color: var(--color-neutral-border);
|
||||
|
||||
.rich-image {
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
.radio-wrapper {
|
||||
background-color: var(--color-neutral-background-disabled);
|
||||
cursor: not-allowed;
|
||||
}
|
||||
}
|
||||
|
||||
/* SIZES */
|
||||
|
||||
&.size--small {
|
||||
height: 16.4rem;
|
||||
width: 12.8rem;
|
||||
|
||||
.rich-image {
|
||||
height: 10.8rem;
|
||||
}
|
||||
|
||||
.radio-wrapper {
|
||||
height: 5.6rem;
|
||||
}
|
||||
}
|
||||
|
||||
&.size--medium {
|
||||
height: 25.6rem;
|
||||
width: 20rem;
|
||||
|
||||
.rich-image {
|
||||
height: 20rem;
|
||||
}
|
||||
|
||||
.radio-wrapper {
|
||||
height: 5.6rem;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,19 +54,19 @@ useResizeObserver(ellipsisElement, ([entry]) => {
|
||||
/* ACCENT VARIANTS */
|
||||
|
||||
&.accent--info {
|
||||
background-color: var(--color-info-data);
|
||||
background-color: var(--color-info-item-base);
|
||||
}
|
||||
|
||||
&.accent--success {
|
||||
background-color: var(--color-success-data);
|
||||
background-color: var(--color-success-item-base);
|
||||
}
|
||||
|
||||
&.accent--warning {
|
||||
background-color: var(--color-warning-data);
|
||||
background-color: var(--color-warning-item-base);
|
||||
}
|
||||
|
||||
&.accent--danger {
|
||||
background-color: var(--color-danger-data);
|
||||
background-color: var(--color-danger-item-base);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
<!-- v7 -->
|
||||
<!-- v5 -->
|
||||
<template>
|
||||
<span :class="className" class="ui-tag typo-body-regular-small">
|
||||
<VtsIcon :name="icon" size="current" />
|
||||
<slot />
|
||||
<button v-if="removable" :aria-label="t('action:remove')" class="remove" type="button" @click.stop="emit('remove')">
|
||||
<VtsIcon name="action:close-cancel-clear" size="medium" />
|
||||
@@ -11,7 +10,6 @@
|
||||
|
||||
<script lang="ts" setup>
|
||||
import VtsIcon from '@core/components/icon/VtsIcon.vue'
|
||||
import type { IconName } from '@core/icons'
|
||||
import { toVariants } from '@core/utils/to-variants.util.ts'
|
||||
import { computed } from 'vue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
@@ -22,7 +20,6 @@ type TagVariant = 'primary' | 'secondary'
|
||||
const { accent, variant } = defineProps<{
|
||||
accent: TagAccent
|
||||
variant: TagVariant
|
||||
icon?: IconName
|
||||
removable?: boolean
|
||||
}>()
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<!-- v1 -->
|
||||
<template>
|
||||
<span class="ui-label-value-tag" :class="className">
|
||||
<span class="ui-tertiary-tag" :class="className">
|
||||
<UiTag :accent variant="primary" class="term">
|
||||
<slot name="term" />
|
||||
</UiTag>
|
||||
@@ -35,7 +35,7 @@ const className = computed(() => toVariants({ truncate, wrap }))
|
||||
</script>
|
||||
|
||||
<style lang="postcss" scoped>
|
||||
.ui-label-value-tag {
|
||||
.ui-tertiary-tag {
|
||||
display: inline-grid;
|
||||
grid-template-columns: auto auto;
|
||||
|
||||
@@ -12,8 +12,8 @@ export const useChartTheme = (pinia?: Pinia) => {
|
||||
background: style.getPropertyValue('--color-neutral-background-primary'),
|
||||
text: style.getPropertyValue('--color-neutral-txt-secondary'),
|
||||
splitLine: style.getPropertyValue('--color-neutral-border'),
|
||||
primary: style.getPropertyValue('--color-brand-data'),
|
||||
secondary: style.getPropertyValue('--color-warning-data'),
|
||||
primary: style.getPropertyValue('--color-brand-item-base'),
|
||||
secondary: style.getPropertyValue('--color-warning-item-base'),
|
||||
})
|
||||
|
||||
const colors = ref(getColors())
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
import type { IconName } from '@core/icons'
|
||||
import { computed, type MaybeRefOrGetter, toValue } from 'vue'
|
||||
|
||||
export type CheckboxModel = boolean | undefined | string[]
|
||||
|
||||
export function useCheckboxState(model: MaybeRefOrGetter<CheckboxModel>, value: MaybeRefOrGetter<string | undefined>) {
|
||||
const isIndeterminate = computed(() => toValue(model) === undefined)
|
||||
|
||||
const isChecked = computed(() => {
|
||||
const modelValue = toValue(model)
|
||||
|
||||
return Array.isArray(modelValue) ? modelValue.some(item => item === toValue(value)) : modelValue === true
|
||||
})
|
||||
|
||||
const icon = computed<IconName>(() => {
|
||||
if (isIndeterminate.value) {
|
||||
return 'status:checkbox-partially-checked'
|
||||
}
|
||||
|
||||
return isChecked.value ? 'status:checkbox-checked' : 'status:checkbox'
|
||||
})
|
||||
|
||||
return { isIndeterminate, isChecked, icon }
|
||||
}
|
||||
@@ -1,50 +0,0 @@
|
||||
import { type CheckboxModel, useCheckboxState } from '@core/composables/checkbox-state.composable.ts'
|
||||
import { ref } from 'vue'
|
||||
|
||||
describe('useCheckboxState', () => {
|
||||
it('is partly checked when the model is undefined', () => {
|
||||
const { isIndeterminate, isChecked, icon } = useCheckboxState(undefined, undefined)
|
||||
|
||||
expect(isIndeterminate.value).toBe(true)
|
||||
expect(isChecked.value).toBe(false)
|
||||
expect(icon.value).toBe('status:checkbox-partially-checked')
|
||||
})
|
||||
|
||||
it.each([
|
||||
{ model: true, checked: true, icon: 'status:checkbox-checked' },
|
||||
{ model: false, checked: false, icon: 'status:checkbox' },
|
||||
])('reads a $model boolean model', ({ model, checked, icon }) => {
|
||||
const state = useCheckboxState(model, undefined)
|
||||
|
||||
expect(state.isIndeterminate.value).toBe(false)
|
||||
expect(state.isChecked.value).toBe(checked)
|
||||
expect(state.icon.value).toBe(icon)
|
||||
})
|
||||
|
||||
it.each([
|
||||
{ value: 'nfs', checked: true, icon: 'status:checkbox-checked' },
|
||||
{ value: 'smb', checked: false, icon: 'status:checkbox' },
|
||||
])('checks an array model only when it contains the $value value', ({ value, checked, icon }) => {
|
||||
const state = useCheckboxState(['s3', 'nfs'], value)
|
||||
|
||||
expect(state.isIndeterminate.value).toBe(false)
|
||||
expect(state.isChecked.value).toBe(checked)
|
||||
expect(state.icon.value).toBe(icon)
|
||||
})
|
||||
|
||||
it('follows the model and the value', () => {
|
||||
const model = ref<CheckboxModel>(['s3'])
|
||||
const value = ref('nfs')
|
||||
const state = useCheckboxState(model, value)
|
||||
|
||||
expect(state.isChecked.value).toBe(false)
|
||||
|
||||
value.value = 's3'
|
||||
|
||||
expect(state.isChecked.value).toBe(true)
|
||||
|
||||
model.value = undefined
|
||||
|
||||
expect(state.icon.value).toBe('status:checkbox-partially-checked')
|
||||
})
|
||||
})
|
||||
@@ -160,18 +160,24 @@ export const statusIcons = defineIconPack({
|
||||
'checkbox-checked': [
|
||||
{
|
||||
icon: faSquare,
|
||||
color: 'var(--checkbox-mark-color, var(--color-neutral-background-primary))',
|
||||
color: 'var(--color-brand-txt-item)',
|
||||
size: 10,
|
||||
},
|
||||
constructIcon(faSquareCheck),
|
||||
{
|
||||
icon: faSquareCheck,
|
||||
color: 'var(--color-brand-item-base)',
|
||||
},
|
||||
],
|
||||
'checkbox-partially-checked': [
|
||||
{
|
||||
icon: faSquare,
|
||||
color: 'var(--checkbox-mark-color, var(--color-neutral-background-primary))',
|
||||
color: 'var(--color-brand-txt-item)',
|
||||
size: 10,
|
||||
},
|
||||
constructIcon(faSquareMinus),
|
||||
{
|
||||
icon: faSquareMinus,
|
||||
color: 'var(--color-brand-item-base)',
|
||||
},
|
||||
],
|
||||
'radio-button': constructIcon(circleEmpty),
|
||||
'radio-button-checked': [
|
||||
|
||||
@@ -17,15 +17,12 @@
|
||||
"action:add-network-in-xo-5": "Přidat síť v XO-5",
|
||||
"action:add-sort": "Přidat řazení",
|
||||
"action:add-vifs-in-xo-5": "Přidat virtuální síť. rozhraní v XO-5",
|
||||
"action:apply": "Použít",
|
||||
"action:attach": "Připojit",
|
||||
"action:attach-vdi": "@:attach-vdi",
|
||||
"action:back": "Zpět",
|
||||
"action:boot-vm": "Nastartovat virt. stroj",
|
||||
"action:change-state": "Změnit stav",
|
||||
"action:clear-selection": "vyčistit výběr",
|
||||
"action:close": "Zavřít",
|
||||
"action:configure": "Nastavit",
|
||||
"action:confirm": "Potvrdit",
|
||||
"action:connect": "Připojit",
|
||||
"action:connect-n": "Připojit {n}",
|
||||
@@ -34,7 +31,6 @@
|
||||
"action:connect-n-vdis": "Připojit 1 obraz virt. disku | Připojit {n} obrazy virt. disků | Připojit {n} obrazů virt. disků",
|
||||
"action:connect-n-vifs": "Připojit 1 virt. síťové rozhraní | Připojit {n} síťová rozhraní | Připojit {n} síťových rozhraní",
|
||||
"action:connect-pool": "Připojit fond",
|
||||
"action:continue": "Pokračovat",
|
||||
"action:copy": "Zkopírovat",
|
||||
"action:copy-all": "Zkopírovat vše",
|
||||
"action:copy-host": "Zkopírovat hostitele",
|
||||
@@ -44,12 +40,10 @@
|
||||
"action:create-bonded-network": "Vytvořit spřaženou síť",
|
||||
"action:create-internal-network": "Vytvořit interní síť",
|
||||
"action:create-network": "Vytvořit síť",
|
||||
"action:create-new-br": "Vytvořit nový repozitář záloh",
|
||||
"action:create-traffic-rule": "Vytvořit pravidlo pro provoz",
|
||||
"action:create-vdi": "Vytvořit obraz virt. disku",
|
||||
"action:create-vif": "Vytvořit virt. síťové rozhraní",
|
||||
"action:delete": "Smazat",
|
||||
"action:delete-configuration": "Smazat nastavení",
|
||||
"action:delete-filter": "Smazat filtr",
|
||||
"action:delete-group": "Smazat skupinu",
|
||||
"action:delete-n-networks": "Smazat 1 síť | Smazat {n} sítě | Smazat {n} sítí",
|
||||
@@ -62,14 +56,12 @@
|
||||
"action:deploy": "Nasadit",
|
||||
"action:deploy-xoa": "Nasadit XOA",
|
||||
"action:detach": "Zrušit přiložení",
|
||||
"action:detach-host": "@:action:detach host",
|
||||
"action:detach-n-vdis": "Zrušit přiložení 1 obrazu virt. disku | Zrušit přiložení {n} obrazů virt. disků",
|
||||
"action:detach-vdi": "Zrušit přiložení obrazu virt. disku",
|
||||
"action:disable": "Zakázat",
|
||||
"action:disable-and-evacuate-vms": "Zakázat a evakuovat virt. stroje",
|
||||
"action:disable-host": "Zakázat hostitele",
|
||||
"action:disable-host-and-evacuate-vms": "Zakázat hostitele a evakuovat virt. stroje",
|
||||
"action:disable-load-at-startup": "Nenačítat při spouštění",
|
||||
"action:disconnect": "Odpojit",
|
||||
"action:disconnect-n": "Odpojit {n}",
|
||||
"action:disconnect-n-srs": "Odpojit 1 repozitář úložiště | Odpojit {n} repozitáře úložiště | Odpojit {n} repozitářů úložiště",
|
||||
@@ -81,16 +73,11 @@
|
||||
"action:duplicate": "Zduplikovat",
|
||||
"action:duplicate-n-vms": "Zduplikovat 1 virt. stroj | Zduplikovat {n} virt. stroje | Zduplikovat {n} virt. strojů",
|
||||
"action:edit": "Upravit",
|
||||
"action:edit-br": "@:action:edit BR",
|
||||
"action:edit-config": "Upravit nastavení",
|
||||
"action:edit-n-brs": "@:action:edit {n} repozitáře záloh",
|
||||
"action:edit-traffic-rule": "@:action:edit @.lower:traffic-rule",
|
||||
"action:emergency-shutdown": "Nouzové vypnutí",
|
||||
"action:emergency-shutdown-host": "@:action:emergency-shutdown hostitele",
|
||||
"action:enable": "Povolit",
|
||||
"action:enable-host": "Povolit hostitele",
|
||||
"action:enable-light-mode": "Zapnout světlý režim",
|
||||
"action:enable-load-at-startup": "Povolit načítání při spouštění",
|
||||
"action:export": "Export",
|
||||
"action:export-content": "Exportovat obsah",
|
||||
"action:export-n-vms": "Exportovat 1 virt. stroj | Exportovat {n} virt. strojů",
|
||||
@@ -98,8 +85,6 @@
|
||||
"action:export-table-to": "Exportovat tabulku do {type}",
|
||||
"action:export-vdi": "Exportovat obraz virt. disku",
|
||||
"action:export-vm": "Exportovat virt. stroj | Exportovat virt. stroje",
|
||||
"action:fill-empty-networks": "Doplňte prázdné sítě",
|
||||
"action:fill-empty-srs": "Doplňte prázdné repozitáře úložiště",
|
||||
"action:filter": "Filtrovat",
|
||||
"action:force-migrate-on-sr": "Vynutit přestěhování na repozitář úložiště",
|
||||
"action:force-reboot": "Vynutit restart",
|
||||
@@ -107,8 +92,6 @@
|
||||
"action:force-shutdown": "Vynutit vypnutí",
|
||||
"action:forget": "Zapomenout",
|
||||
"action:forget-host": "Zapomenout hostitele",
|
||||
"action:forget-n-brs": "@:action:forget 1 repozitář záloh | @:action:forget {n} repozitáře záloh | @:action:forget {n} repozitářů záloh",
|
||||
"action:forget-n-pifs": "Zapomenout 1 fyzické rozhraní | Zapomenout {n} fyzická rozhraní | Zapomenout {n} fyzických rozhraní",
|
||||
"action:go-back": "Přejít zpět",
|
||||
"action:group": "Skupina",
|
||||
"action:hide": "Skrýt",
|
||||
@@ -116,7 +99,6 @@
|
||||
"action:import-export": "Import/Export",
|
||||
"action:install-app": "Nainstalovat {name}",
|
||||
"action:install-guest-tools": "Nainstalovat nástroje do hosta",
|
||||
"action:load": "Načíst",
|
||||
"action:load-now": "Načíst nyní",
|
||||
"action:log-out": "Odhlásit",
|
||||
"action:migrate": "Přestěhovat",
|
||||
@@ -134,16 +116,13 @@
|
||||
"action:reboot": "Restartovat",
|
||||
"action:reboot-host": "@:action:reboot host",
|
||||
"action:reformat": "Přeformátovat",
|
||||
"action:reset-all-networks": "Resetovat veškeré sítě",
|
||||
"action:reset-all-srs": "Resetovat veškeré repozitáře úložiště",
|
||||
"action:reset-to-default": "Vrátit na výchozí",
|
||||
"action:restart-toolstack": "Restartovat toolstack",
|
||||
"action:resume": "Navázat v chodu",
|
||||
"action:revert-to-snapshot": "Vrátit zpět do podoby ze zachyceného stavu",
|
||||
"action:revert-vm-here": "Vrátit virt. stroj do stavu zde",
|
||||
"action:save": "Uložit",
|
||||
"action:search": "Hledat",
|
||||
"action:search-treeview": "@:action:search ve stromovém pohledu ({shortcut})",
|
||||
"action:search-treeview": "Hledat ve stromovém pohledu",
|
||||
"action:see-all": "Zobrazit vše",
|
||||
"action:see-less": "Vidět méně",
|
||||
"action:see-n-more": "Viz {n} další",
|
||||
@@ -173,11 +152,7 @@
|
||||
"action:start-host": "Spustit hostitele",
|
||||
"action:start-on-host": "Spustit na konkrétním hostiteli",
|
||||
"action:suspend": "Uspat",
|
||||
"action:test": "Vyzkoušet",
|
||||
"action:test-plugin": "Vyzkoušet zásuvný modul",
|
||||
"action:test-speed": "Otestovat rychlost",
|
||||
"action:turn-into-group": "Přeměnit na skupinu",
|
||||
"action:unload": "Zrušit načtení",
|
||||
"action:update": "Aktualizovat",
|
||||
"action:use-query-builder": "Použít nástroj pro sestavování dotazů",
|
||||
"add-or": "+NEBO",
|
||||
@@ -203,12 +178,9 @@
|
||||
"all-done!": "Vše dokončeno!",
|
||||
"all-good!": "Všechno v pořádku!",
|
||||
"all-quiet-launchpad": "Na startovní rampě klid",
|
||||
"all-srs-shared-storage-migration-optional": "Všechny repozitáře úložiště jsou sdílené, stěhování úložiště je volitelné.",
|
||||
"all-vifs-follow-vm": "Všechna virtuální síťová rozhraní následují virt. stroj na jeho nového hostitele: v rámci fondu se jejich sítě nezmění.",
|
||||
"allocated-space": "Přidělený prostor",
|
||||
"allow": "Umožnit",
|
||||
"allow-self-signed-ssl": "Je možné že bude třeba ve vámi využívaném prohlížeči povolit samy sebou podepsané SSL certifikáty",
|
||||
"allow-unauthorized": "Umožnit nepověřené",
|
||||
"allowed-ips": "Umožněné IP adresy",
|
||||
"allowed-ips-example": "Například: 192.168.0.1; 2001:db8::1",
|
||||
"and": "A",
|
||||
@@ -219,7 +191,6 @@
|
||||
"archives": "Archivy",
|
||||
"aria:breadcrumb:label": "Drobečková navigace",
|
||||
"ascending": "vzestupně",
|
||||
"at-least-one-enabled": "Alespoň jedno povolené",
|
||||
"attach-vdi": "Připojit existující obraz virt. disku",
|
||||
"auto-generated": "Automaticky vytvořeno",
|
||||
"auto-power": "Automatické zapínání",
|
||||
@@ -233,25 +204,18 @@
|
||||
"backup": "Záloha",
|
||||
"backup-and-replication": "Zálohování a replikace",
|
||||
"backup-archive-status": "Stav archivu zálohy",
|
||||
"backup-date": "@:backup @.lower:date",
|
||||
"backup-format": "Formát přírůstkové zálohy",
|
||||
"backup-issues": "Problémy se zálohou",
|
||||
"backup-job": "Úlohy zálohování",
|
||||
"backup-jobs": "Zálohovací úlohy",
|
||||
"backup-jobs:see-all": "Zobrazit veškeré úlohy zálohování",
|
||||
"backup-logs": "@:backup @.lower:logs",
|
||||
"backup-network": "Síť pro zálohování",
|
||||
"backup-repositories": "Repozitáře zálohy",
|
||||
"backup-repository": "Repozitář pro zálohy",
|
||||
"backup-repository-path": "Popis umístění repozitáře záloh",
|
||||
"backup-repository-type": "Repozitář pro zálohy (lokální, NFS, SMB)",
|
||||
"backup-targets": "Cíle zálohování",
|
||||
"backup:last-replication": "Poslední replikace",
|
||||
"backup:pool-metadata": "Metadata fondu",
|
||||
"backup:rolling-snapshot": "Průběžně zachycovaný stav",
|
||||
"backup:vms-backup": "Záloha virt. strojů",
|
||||
"backup:vms-mirror": "Zrcadlo virt. strojů",
|
||||
"backup:vms-replication": "Replikace virt. strojů",
|
||||
"backup:xo-config": "Nastavení XO",
|
||||
"backups": "Zálohy",
|
||||
"backups:jobs:disabled": "Zakázané",
|
||||
@@ -273,7 +237,6 @@
|
||||
"bios-default": "bios (výchozí)",
|
||||
"bios-info": "Informace o BIOS",
|
||||
"block-based": "Blokové",
|
||||
"block-based-hint": "Jsou zapotřebí specifická rozhraní – přečtěte si dokumentaci.",
|
||||
"bond": "Spřažení",
|
||||
"bond-devices": "Zařízení spřažení",
|
||||
"bond-mode": "Režim spřažení",
|
||||
@@ -281,8 +244,6 @@
|
||||
"bond-status": "Stav spřažení",
|
||||
"boot-firmware": "Firmware zavádění",
|
||||
"bootable": "Zaveditelné",
|
||||
"br-details": "Podrobnosti o repozitáři záloh",
|
||||
"br-type-details": "Podrobnosti {type}",
|
||||
"bucket-name": "Název buketu",
|
||||
"build-number": "Číslo sestavení",
|
||||
"by": "Od",
|
||||
@@ -313,7 +274,6 @@
|
||||
"confirm-cancel?": "Opravdu chcete zrušit?",
|
||||
"confirm-delete": "Chystáte se smazat {name}",
|
||||
"confirm-disconnect": "Chystáte se odpojit {0}",
|
||||
"confirm-forget": "Chystáte se zapomenout {name}",
|
||||
"confirm-vm-revert": "Potvrďte navrácení virt. stroje do předchozího stavu",
|
||||
"connect": "Připojit",
|
||||
"connected": "Připojeno",
|
||||
@@ -325,10 +285,7 @@
|
||||
"console": "Konzole",
|
||||
"console-actions": "Akce ohledně konzole",
|
||||
"console-clipboard": "Schránka konzole",
|
||||
"console-keyboard-layout": "Rozložení klávesnice hosta",
|
||||
"console-keyboard-layout-not-applicable": "Neuplatnitelné: znaky jsou na tuto konzoli zaslány, jak jsou",
|
||||
"console-offline": "Konzole nemá spojení",
|
||||
"console-type-text-skipped": "Nenapsáno – chybí ve zvoleném rozložení klávesnice: {chars}",
|
||||
"console-unavailable": "Konzole není k dispozici",
|
||||
"console-unavailable-reason": "Konzole je není v tuto chvíli k dispozici, protože {type} je vypnutý.",
|
||||
"container-name": "Název kontejneru",
|
||||
@@ -378,12 +335,7 @@
|
||||
"deploy-xoa-status:waiting": "Čeká se až XOA odpoví…",
|
||||
"descending": "sestupně",
|
||||
"description": "Popis",
|
||||
"destination-host": "Cílový hostitel",
|
||||
"destination-network": "Cílová síť",
|
||||
"destination-network-required": "Je zapotřebí cílová síť.",
|
||||
"destination-sr": "Cílový repozitář úložiště",
|
||||
"destination-sr-required": "Je zapotřebí cílový repozitář úložiště.",
|
||||
"details": "Podrobnosti",
|
||||
"device": "Zařízení",
|
||||
"device-config": "Nastavení zařízení",
|
||||
"dhcp": "DHCP",
|
||||
@@ -413,17 +365,10 @@
|
||||
"drop": "Zahodit",
|
||||
"duplication-method": "Metoda duplikace",
|
||||
"duration": "Doba trvání",
|
||||
"edit-vif": "Upravit virt. rozhraní",
|
||||
"edit-vif:error-message": "Při upravování virt rozhraní došlo k chybě. Zkontrolujte nastavení vašeho uspořádání a zkuste to znovu.",
|
||||
"editing-vif": "Upravování virt. rozhraní",
|
||||
"email": "E-mail",
|
||||
"empty": "Prázdné",
|
||||
"enabled": "Povoleno",
|
||||
"encrypted": "Šifrováno",
|
||||
"encryption": "Šifrování",
|
||||
"encryption-available-for-block-modes-only": "Šifrování je k dispozici pouze pro blokové režimy.",
|
||||
"encryption-key-invalid": "Je třeba, aby klíč obsahoval právě {n} šestnáctkových znaků.",
|
||||
"encryption-key-loss-warning": "Pokud šifrovací klíč ztratíte, ke svým datům už se nedostanete.",
|
||||
"ended": "Skončilo",
|
||||
"endpoint-url": "URL koncového bodu",
|
||||
"engines-off": "Motory vypnuté, oběžná dráha stabilní",
|
||||
@@ -451,27 +396,14 @@
|
||||
"for-replication": "Pro replikaci",
|
||||
"force-reboot-blocked": "Vynucený restart blokován",
|
||||
"force-shutdown-blocked": "Vynucené vypnutí blokováno",
|
||||
"form:error:field-integer": "Je třeba, aby {field} bylo celé číslo",
|
||||
"form:error:field-maximum": "Je třeba, aby {field} bylo {max} nebo méně",
|
||||
"form:error:field-min-items": "Je třeba, by {field} obsahovalo alespoň {n} položku | Je třeba, aby {field} obsahovalo alespoň {n} položky | Je třeba, aby {field} obsahovalo alespoň {n} položek",
|
||||
"form:error:field-minimum": "Je třeba, aby {field} bylo {min} nebo více",
|
||||
"form:error:field-required": "{field} je třeba vyplnit",
|
||||
"form:error:integer": "Je třeba, aby bylo celé číslo",
|
||||
"form:error:maximum": "Je třeba, aby bylo {max} nebo méně",
|
||||
"form:error:min-items": "Je třeba, aby obsahovalo alespoň {n} položku | Je třeba, aby obsahovalo alespoň {n} položky | Je třeba, aby obsahovalo alespoň {n} položek",
|
||||
"form:error:minimum": "Je třeba, aby bylo {min} nebo více",
|
||||
"form:error:required": "Tuto kolonku je třeba vyplnit",
|
||||
"form:n-errors-summary": "{n} kolonka vyžaduje pozornost | {n} kolonky vyžadují pozornost | {n} kolonek vyžaduje pozornost",
|
||||
"form:warning:out-of-range": "Mělo by být z rozmezí {min} až {max}",
|
||||
"format": "Formát",
|
||||
"free-space": "Volný prostor",
|
||||
"free-space-on-sr": "Volný prostor na repozitáři úložiště",
|
||||
"from-device": "Ze zařízení",
|
||||
"from-network": "Ze sítě",
|
||||
"from-sr": "Z repozitáře úložiště",
|
||||
"from-vlan": "Z VLAN",
|
||||
"from-vm": "Od virt. stroje",
|
||||
"full": "Plné",
|
||||
"full-copy": "Úplná kopie",
|
||||
"fullscreen": "Na celou obrazovku",
|
||||
"gateway": "Brána",
|
||||
@@ -487,8 +419,6 @@
|
||||
"gzip": "GZIP",
|
||||
"hardware": "Hardware",
|
||||
"hardware-specifications": "Hardwarové specifikace",
|
||||
"health-check": "Kontrola vitálnosti",
|
||||
"health-check-sr": "@:health-check repozitáře úložiště",
|
||||
"heartbeat-storage-repository": "Repozitář úložiště kontroly stavu",
|
||||
"here": "Zde",
|
||||
"high-availability": "Vysoká dostupnost (HA)",
|
||||
@@ -499,10 +429,8 @@
|
||||
"host-enable-title": "Opravdu chcete hostitele {host} povolit?",
|
||||
"host-internal-networks": "Interní sítě hostitele",
|
||||
"host-missing": "Hostitel chybí",
|
||||
"host-name": "Název hostitele",
|
||||
"host-not-running": "Hostitel není spuštěný",
|
||||
"host-not-running": "Hostitel nespuštěný",
|
||||
"host-off": "Hostitel je vypnutý",
|
||||
"host-or-ip-address": "Název hostitele nebo IP adresa",
|
||||
"host:status:active": "@:status:active",
|
||||
"host:status:disabled": "@:status:disabled",
|
||||
"host:status:halted": "@:status:halted",
|
||||
@@ -518,7 +446,6 @@
|
||||
"in-last-three-runs": "V jejich posledních 3 spuštěních",
|
||||
"in-progress": "V přípravě",
|
||||
"included": "Včetně",
|
||||
"incremental": "Přírůstkové",
|
||||
"info": "Informace",
|
||||
"info:vdi-attached-rw": "Tento obraz virt. disku už je v režimu čtení-zápis připojen k jinému virt. stroji.",
|
||||
"infos": "Informace",
|
||||
@@ -531,9 +458,7 @@
|
||||
"invalid-field": "Neplatný obsah kolonky",
|
||||
"invalid-ip-addresses": "Jedna nebo více neplatných IP adres",
|
||||
"invalid-mac-address": "Neplatná MAC adresa",
|
||||
"invalid-port": "Neplatný port",
|
||||
"invalid-rate-limit": "Omezování rychlosti nemůže být záporné",
|
||||
"invalid-username-or-password": "Neplatné uživatelské jméno a/nebo heslo.",
|
||||
"ip-address": "IP adresa",
|
||||
"ip-address-info": "Pravidlo je možné uplatnit na jednotlivou IP adresu nebo podsíť (v CIDR formátu). Příklady: 192.168.1.10, nebo 10.20.0.0/16",
|
||||
"ip-address-invalid": "Formát IP adresy není platný.",
|
||||
@@ -549,10 +474,8 @@
|
||||
"is-primary-host": "{name} je hlavní hostitel",
|
||||
"iscsi-iqn": "iSCSI IQN název",
|
||||
"iso-dvd": "ISO/DVD",
|
||||
"item": "Položka",
|
||||
"job": "Úloha",
|
||||
"job:arg:allocated-space-required": "Přidělené místo je třeba zadat",
|
||||
"job:arg:backup-repository-required": "Je zapotřebí repozitář záloh",
|
||||
"job:arg:bond-mode-required": "@:bond-mode-required",
|
||||
"job:arg:direction-required": "Směr je třeba zadat",
|
||||
"job:arg:file-required": "Soubor je vyžadován",
|
||||
@@ -560,7 +483,6 @@
|
||||
"job:arg:ip-range-required": "Rozsah IP adres je vyžadován",
|
||||
"job:arg:missing-payload": "Chybí náklad",
|
||||
"job:arg:name-required": "@:name-required",
|
||||
"job:arg:nbd-and-insecure-nbd-exclusive": "Není možné, aby souběžně bylo povolené NBD a nezabezpečené NBD",
|
||||
"job:arg:password-required": "Je zapotřebí heslo",
|
||||
"job:arg:pif-id-required": "Je zapotřebí identifikátor fyzického rozhraní",
|
||||
"job:arg:pif-ids-required": "Je zapotřebí alespoň jeden identifikátor fyzického rozhraní",
|
||||
@@ -571,27 +493,13 @@
|
||||
"job:arg:sr-vdi-required": "Je třeba, aby VDI mělo repozitář úložiště",
|
||||
"job:arg:target-id-required": "Je zapotřebí identifikátor cíle",
|
||||
"job:arg:template-uuid-required": "Je zapotřebí UUID šablony",
|
||||
"job:arg:url-required": "Je zapotřebí URL",
|
||||
"job:arg:username-required": "Je zapotřebí uživatelské jméno",
|
||||
"job:arg:vdi-id-required": "Je zapotřebí identif. obrazu virt. disku",
|
||||
"job:arg:vlan-required": "@:vlan-required",
|
||||
"job:arg:vm-id-required": "Je zapotřebí identifikátor virt. stroje",
|
||||
"job:backup-repository-benchmark:in-progress": "Probíhá test rychlosti repozitáře záloh…",
|
||||
"job:backup-repository-benchmark:missing-backup-repository": "Chybí repozitář záloh",
|
||||
"job:backup-repository-benchmark:n-repositories-disabled": "1 označený repozitář záloha je zakázán | {n} označené repozitáře záloha jsou zakázané | {n} označených repozitářů záloha je zakázáno",
|
||||
"job:backup-repository-benchmark:repository-disabled": "Repozitář záloh zakázán",
|
||||
"job:backup-repository-bulk-edit:in-progress": "Probíhá upravování repozitářů záloh…",
|
||||
"job:backup-repository-bulk-edit:missing-backup-repository": "Žádné repozitáře záloh k upravení",
|
||||
"job:backup-repository-bulk-edit:missing-payload": "Chybí změny pro repozitář záloh",
|
||||
"job:backup-repository-change-state:in-progress": "Probíhá změna stavu repozitáře záloh…",
|
||||
"job:backup-repository-change-state:missing-backup-repository": "Žádný repozitář záloh k připojení nebo zakázání",
|
||||
"job:backup-repository-create:encryption-requires-block": "Šifrování vyžaduje blokový formát záloh",
|
||||
"job:backup-repository-edit:encryption-key-locked": "Šifrovací klíč není možné změnit",
|
||||
"job:backup-repository-edit:encryption-requires-block": "Šifrování vyžaduje blokový formát záloh",
|
||||
"job:backup-repository-edit:unknown-type": "Neznámý typ repozitáře záloh",
|
||||
"job:backup-repository-forget:in-progress": "Probíhá zapomínání repozitáře záloh…",
|
||||
"job:backup-repository-forget:missing-backup-repository": "Žádný repozitář záloh k zapomenutí",
|
||||
"job:backup-repository-forget:used-by-n-backup-jobs": "Využíváno 1 úlohou zálohování – nejprve z ní odeberte | Využíváno {n} úlohami zálohování – nejprve z nich odeberte | Využíváno {n} úlohami zálohování – nejprve z nich odeberte",
|
||||
"job:connect:in-progress": "Probíhá připojování…",
|
||||
"job:create:in-progress": "Probíhá vytváření…",
|
||||
"job:delete:in-progress": "Probíhá mazání…",
|
||||
@@ -600,32 +508,30 @@
|
||||
"job:edit:in-progress": "Probíhá úprava…",
|
||||
"job:enable:in-progress": "Povolování v běhu…",
|
||||
"job:export:in-progress": "Probíhá export…",
|
||||
"job:host-detach:bad-power-state": "@:host-not-running",
|
||||
"job:host-detach:in-progress": "Probíhá odpojení hostitele…",
|
||||
"job:host-detach:master-host": "Hlavního hostitele není možné odpojit",
|
||||
"job:host-detach:missing-host": "Žádný hostitel k odpojení",
|
||||
"job:host-disable:bad-power-state": "@:host-not-running",
|
||||
"job:host-disable:bad-power-state": "Hostitel není zapnutý",
|
||||
"job:host-disable:missing-host": "@:host-missing",
|
||||
"job:host-enable:missing-host": "@:host-missing",
|
||||
"job:host-evacuate:in-progress": "Probíhá evakuace z hostitele…",
|
||||
"job:host-forget:bad-power-state": "Hostitel je spuštěný",
|
||||
"job:host-forget:in-progress": "Probíhá zapomínání hostitele…",
|
||||
"job:host-forget:missing-host": "Žádný hostitel k zapomenutí",
|
||||
"job:host-reboot:bad-power-state": "@:host-not-running",
|
||||
"job:host-reboot:bad-power-state": "Hostitel není spuštěný",
|
||||
"job:host-reboot:evacuate-in-progress": "Probíhá evakuace virt. strojů…",
|
||||
"job:host-reboot:in-progress": "Probíhá restart hostitele…",
|
||||
"job:host-reboot:missing-host": "Žádný hostitel k restartování",
|
||||
"job:host-restart-toolstack:bad-power-state": "@:host-not-running",
|
||||
"job:host-restart-toolstack:ha-enabled": "Pokud je na fondu zapnutá vysoká dostupnost, pak restartování vrstev nástrojů není dovoleno",
|
||||
"job:host-restart-toolstack:bad-power-state": "Hostitel není spuštěný",
|
||||
"job:host-restart-toolstack:in-progress": "Probíhá restart toolstack vrstev hostitele…",
|
||||
"job:host-restart-toolstack:missing-host": "Žádný hostitel na kterém restartovat toolstack",
|
||||
"job:host-scan-pifs:bad-power-state": "@:host-not-running",
|
||||
"job:host-scan-pifs:bad-power-state": "Hostitel není spuštěný",
|
||||
"job:host-scan-pifs:in-progress": "@:scan-pifs probíhá…",
|
||||
"job:host-scan-pifs:missing-host": "@:host-missing",
|
||||
"job:host-shutdown:bad-power-state": "Hostitel už je zastavený",
|
||||
"job:host-shutdown:in-progress": "Probíhá vypínání hostitele…",
|
||||
"job:host-shutdown:missing-host": "Žádný hostitel k vypnutí",
|
||||
"job:host-smart-reboot:bad-power-state": "@:host-not-running",
|
||||
"job:host-smart-reboot:bad-power-state": "Hostitel není spuštěný",
|
||||
"job:host-smart-reboot:in-progress": "Probíhá inteligentní restart hostitele…",
|
||||
"job:host-smart-reboot:missing-host": "Žádný hostitel k inteligentnímu restartování",
|
||||
"job:host-smart-reboot:vm-clean-shutdown-in-progress": "Probíhá korektní vypínání virt. strojů…",
|
||||
@@ -645,30 +551,10 @@
|
||||
"job:pbd-plug:pbd-connected": "Jedno nebo více fyzických blokových zařízení už je připojeno",
|
||||
"job:pbd-unplug:missing-pbd": "Žádná fyzická bloková zařízení k odpojení",
|
||||
"job:pbd-unplug:pbd-disconnected": "Jedno nebo více fyzyckých blokových zařízení už je odpojeno",
|
||||
"job:pif-forget:in-progress": "Probíhá zapomínání fyzického rozhraní…",
|
||||
"job:pif-forget:is-management-interface": "Není možné zapomenout správní rozhraní hostitele",
|
||||
"job:pif-forget:missing-pif": "Žádná fyzická rozhraní k zapomenutí",
|
||||
"job:pif-management-reconfigure:bad-power-state": "@:host-not-running",
|
||||
"job:pif-management-reconfigure:bad-power-state": "Hostitel není spuštěný",
|
||||
"job:pif-management-reconfigure:current-pif": "Stávající fyzické rozhraní",
|
||||
"job:pif-management-reconfigure:in-progress": "Probíhá přenastavování rozhraní pro správu…",
|
||||
"job:pif-management-reconfigure:missing-ip": "Chybí IP adresa",
|
||||
"job:plugin-autoload:missing-plugin": "@:plugin-missing",
|
||||
"job:plugin-change-state:already-loaded": "Zásuvný modul už načten",
|
||||
"job:plugin-change-state:already-unloaded": "Načtení zásuvného modulu už zrušeno",
|
||||
"job:plugin-change-state:load-in-progress": "Probíhá načítání zásuvného modulu…",
|
||||
"job:plugin-change-state:missing-plugin": "@:plugin-missing",
|
||||
"job:plugin-change-state:not-configured": "Aby ho bylo možné načíst je třeba, aby byl zásuvný modul nastaven",
|
||||
"job:plugin-change-state:not-unloadable": "Načtení zásuvného modulu nebylo možné zrušit",
|
||||
"job:plugin-change-state:unload-in-progress": "Probíhá rušení načtení zásuvného modulu…",
|
||||
"job:plugin-configure:missing-plugin": "@:plugin-missing",
|
||||
"job:plugin-configure:not-configurable": "@:plugin:not-configurable",
|
||||
"job:plugin-delete-configuration:loaded": "Aby bylo možné smazat jeho nastavení, je třeba zrušit načtení zásuvného modulu",
|
||||
"job:plugin-delete-configuration:missing-plugin": "@:plugin-missing",
|
||||
"job:plugin-delete-configuration:no-configuration": "Tento zásuvný modul nemá žádná nastavení",
|
||||
"job:plugin-test:in-progress": "Probíhá zkoušení zásuvného modulu…",
|
||||
"job:plugin-test:missing-plugin": "@:plugin-missing",
|
||||
"job:plugin-test:not-loaded": "Aby ho bylo možné zkoušet, je třeba, aby byl zásuvný modul načtený",
|
||||
"job:plugin-test:not-testable": "Tento zásuvný modul není možné zkoušet",
|
||||
"job:server-connect:missing-server": "Žádné servery k připojení",
|
||||
"job:server-disconnect:missing-server": "Žádné servery k odpojení",
|
||||
"job:server-disconnect:server-disconnected": "Jeden nebo vícero serverů už je odpojeno",
|
||||
@@ -689,7 +575,7 @@
|
||||
"job:vdi-export:format-required": "Je vyžadován formát exportu obrazu virt. disku",
|
||||
"job:vdi-export:missing-vdi": "Žádný obraz virt. disku k exportu",
|
||||
"job:vdi-migrate:in-progress": "Probíhá stěhování…",
|
||||
"job:vdi-migrate:missing-sr": "@:destination-sr-required",
|
||||
"job:vdi-migrate:missing-sr": "Je zapotřebí repozitář úložiště",
|
||||
"job:vdi-migrate:missing-vdi": "Nevybrán žádný obraz virt. disku",
|
||||
"job:vif-connect:missing-vif": "Žádná virt. síťová rozhraní k připojení",
|
||||
"job:vif-connect:vif-already-connected": "Virt. síťové rozhraní už je připojeno",
|
||||
@@ -717,11 +603,9 @@
|
||||
"job:vm-force-shutdown:in-progress": "Probíhá vynucené vypnutí…",
|
||||
"job:vm-force-shutdown:missing-vm": "Žádné virt. stroje k vynucenému vypnutí",
|
||||
"job:vm-migrate:bad-power-state": "Je třeba, aby virt. stroj byl spuštěný",
|
||||
"job:vm-migrate:blocked-operation": "Stěhování virt. stroje je blokováno",
|
||||
"job:vm-migrate:in-progress": "Probíhá stěhování…",
|
||||
"job:vm-migrate:missing-host": "Je třeba zadat cílového hostitele",
|
||||
"job:vm-migrate:missing-vm": "Žádné virt. stroje k přestěhování",
|
||||
"job:vm-migrate:paused": "Je třeba, aby virt. stroj nebyl pozastavený",
|
||||
"job:vm-not-running": "Je třeba, aby virt. stroj byl spuštěný",
|
||||
"job:vm-pause:bad-power-state": "Je třeba, aby virt. stroj byl spuštěný",
|
||||
"job:vm-pause:blocked-operation": "Pozastavení chodu virt. stroje je blokováno",
|
||||
@@ -754,15 +638,9 @@
|
||||
"job:vm-suspend:in-progress": "Probíhá uspávání…",
|
||||
"job:vm-suspend:missing-vm": "Žádné virt. stroje k uspání",
|
||||
"jobs": "Úlohy",
|
||||
"json-schema:hide-examples": "Skrýt příklady",
|
||||
"json-schema:nested-label": "{parent} › {label}",
|
||||
"json-schema:numbered-item": "{label} {n}",
|
||||
"json-schema:show-examples-n": "Ukázat příklad ({n}) | Ukázat příklady ({n}) | Ukázat příklady ({n})",
|
||||
"json-schema:unsupported-field": "Kolonku „{label}“ není možné z tohoto rozhraní upravovat",
|
||||
"keep-me-logged": "Neodhlašovat",
|
||||
"keep-page-open": "Panel prohlížeče nenačítejte znovu nebo ho neopouštějte dokud nasazení neskončí.",
|
||||
"key": "Klíč",
|
||||
"keywords": "Klíčová slova",
|
||||
"language": "Jazyk",
|
||||
"language-preferences": "Předvolby jazyka",
|
||||
"last": "Poslední",
|
||||
@@ -782,20 +660,16 @@
|
||||
"license-socket": "Licencovat patici",
|
||||
"license-type": "Typ licence",
|
||||
"licensing": "Licencování",
|
||||
"load-at-startup": "Načítat při spouštění",
|
||||
"load-average": "Průměrné vytížení",
|
||||
"loaded": "Načteno",
|
||||
"loading": "Načítání",
|
||||
"local": "Lokální",
|
||||
"locked": "Uzamčeno",
|
||||
"locking-mode": "Režim zamykání",
|
||||
"locking-mode-default": "Výchozí režim zamykání",
|
||||
"log-name": "Záznam událostí {date}",
|
||||
"login": "Přihlášení",
|
||||
"login-only-on-master": "Přihlášení je možné pouze na hlavním hostiteli",
|
||||
"logs": "Záznamy událostí",
|
||||
"mac-address": "MAC adresa",
|
||||
"mac-address-change-cut-connection": "Změna MAC adresy dočasně přeruší spojení",
|
||||
"mac-addresses": "MAC adresy",
|
||||
"manage-citrix-pv-drivers-via-windows-update": "Spravovat citrix PV ovladače prostřednictvím Windows Update",
|
||||
"management": "Správa",
|
||||
@@ -812,21 +686,14 @@
|
||||
"memory-usage": "Využití paměti",
|
||||
"merge-backups-synchronously": "Sloučit zálohy synchronně",
|
||||
"message": "Zpráva",
|
||||
"migration-blocked": "Stěhování blokováno",
|
||||
"migration-compression": "Komprese při stěhování",
|
||||
"migration-network": "Síť přes kterou stěhovat",
|
||||
"minimum-dynamic-memory": "Dynamicky přidělované paměti nejméně",
|
||||
"minimum-static-memory": "Staticky přidělené paměti nejméně",
|
||||
"missing-patches": "Chybějící záplaty",
|
||||
"missing-translations?": "Chybějící překlady nebo by mohly být příhodnější?",
|
||||
"mixed-value": "[Smíšené]",
|
||||
"modal:action:vm-force-migrate": "@:action:force-migrate virt. stroje",
|
||||
"modal:backup-repository-forget-message": "Zapomenutí tohoto repozitáře záloh ho nevratně odebere ze systému. Existující zálohy v tomto repozitáři už nebudou dostupné prostřednictvím této platformy. Tuto akci nelze vzít zpět. Pokračujte obezřetně. | Zapomenutí těchto repozitářů záloh je nevratně odebere ze systému. Existující zálohy v těchto repozitářích už nebudou dostupné prostřednictvím této platformy. Tuto akci nelze vzít zpět. Pokračujte obezřetně.",
|
||||
"modal:backup-repository-forget-title": "Chystáte se zapomenout repozitář záloh | Chystáte se zapomenout {n} repozitáře záloh | Chystáte se zapomenout {n} repozitářů záloh",
|
||||
"modal:confirm-host-detach?": "Opravdu chcete {host} odpojit?",
|
||||
"modal:confirm-host-disable-and-evacuate-vms?": "Opravdu chcete {host} zakázat a evakuovat z něj virt. stroje?",
|
||||
"modal:confirm-host-disable?": "Opravdu chcete {host} zakázat?",
|
||||
"modal:confirm-host-emergency-shutdown?": "Opravdu provést nouzové vypnutí {host}?",
|
||||
"modal:confirm-host-enable?": "Opravdu chcete {host} povolit?",
|
||||
"modal:confirm-host-force-reboot?": "Opravdu chcete {host} vynuceně restartovat?",
|
||||
"modal:confirm-host-forget?": "Opravdu chcete {host} zapomenout?",
|
||||
@@ -838,7 +705,6 @@
|
||||
"modal:host-detach-message": "Tento hostitel bude odpojen od fondu a jeho lokální úložiště resetováno. Ujistěte se, že na něm nejsou spuštěné žádné virt. stroje a že vše, co potřebujete z jeho lokálního úložiště, bylo zazálohováno.",
|
||||
"modal:host-disable-and-evacuate-vms-message": "Hostitel bude zakázán a na něm spuštěné virt. stroje budou automaticky přestěhování na ostatní hostitele ve fondu – bez přerušení (pokud to dostupné prostředky dovolí).",
|
||||
"modal:host-disable-message": "Hostitel bude označen jako nedostupný pro spouštění nebo přijímání nových virt. strojů. Už běžící virt. stroje tím nebudou ovlivněny.",
|
||||
"modal:host-emergency-shutdown-message": "Toto hostitele vypne. Než se tak stane, budou na něm spuštěné virt. stroje uspány (bez přestěhování). Ty virt. stroje, které nebude možné uspat, budou vypnuty.",
|
||||
"modal:host-enable-message": "Hostitel se stane znovu dostupným pro spouštění nebo přijímání virt. strojů.",
|
||||
"modal:host-force-reboot-message": "Hostitel bude restartován. Pokud to bude možné, na něm spuštěné virt. stroje budou přestěhování na ostatní hostitele. Ale ty, u kterých to nepůjde, budou vynuceně vypnuty. Může dojít ke ztrátě dat.",
|
||||
"modal:host-forget-message": "Toto hostitele trvale odebere z databáze fondu. Toto udělejte pouze pokud je hostitel fyzicky nefunkční a nepopravitelný – pokud je možné ho přivést zpět k fungování, použijte namísto toho Odpojit. Tuto akci nelze vzít zpět.",
|
||||
@@ -846,7 +712,6 @@
|
||||
"modal:host-restart-toolstack-message": "Chystá se restart služby správy hostitele (toolstack). Spuštěné virt. stroje nebudou přerušeny, ale budou dočasně (několik minut) nespravovatelné.",
|
||||
"modal:host-shutdown-message": "Toto hostitele vypne. Jakékoli virt. stroje které na něm jsou pořád ještě spuštěné budou přestěhovány na jiného hostitele v provozu.",
|
||||
"modal:host-smart-reboot-message": "Všechny spuštěné virt. stroje na tomto hostiteli budou uspány na disk, hostitel bude restartován a poté budou virtuální stroje automaticky probuzeny. To způsobí dočasnou nedostupnost. Pokud na tomto hostiteli je provozováno i samotné Xen Orchestra, může se stát, že virt. stroje nebudou automaticky probuzeny.",
|
||||
"modal:pif-forget-message": "Tato akce zapomene označené fyzické rozhraní z tohoto hostitele. | Tato akce zapomene označená fyzická rozhraní z tohoto hostitele. | Tato akce zapomene označená fyzická rozhraní z tohoto hostitele.",
|
||||
"modal:pif-management-reconfigure-info": "Nastavení tohoto fyzického rozhraní jako správní z něj udělá výchozí používané pro provoz správy. Než budete pokračovat zajistěte, aby toto rozhraní bylo správně nastavené a dosažitelné.",
|
||||
"modal:pif-management-reconfigure-title": "Chystáte se toto nastavit jako fyzické síťové rozhraní pro správu",
|
||||
"modal:pool-disconnect-message": "Fond už nebude spravovatelný z XO. Je ovšem možné ho později znovu připojit.",
|
||||
@@ -860,23 +725,17 @@
|
||||
"mtu": "MTU",
|
||||
"mtu-default-value-message": "1500 je výchozí",
|
||||
"multi-creation": "Vícenásobné vytvoření",
|
||||
"multi-edit-brs-different-types": "Označené repozitáře záloh jsou odlišných typů: jejich podrobnosti proto nelze upravovat hromadně.",
|
||||
"multi-pathing": "Propojování vícero cestami",
|
||||
"multiple-schedules": "Vícero plánů",
|
||||
"multiple-schedules-advice": "Doporučujeme rozdělení úlohy zálohování s vícero plány do vícero úloh zálohování s jedním plánem pro každou z nich.",
|
||||
"n-bonded-networks": "1 síť se spřaženými rozhraními | {n} sítě se spřaženými rozhraními | {n} sítí se spřaženými rozhraními",
|
||||
"n-brs": "1 repozitář záloh | {n} repozitáře záloh | {n} repozitářů záloh",
|
||||
"n-gb": "{n} GB",
|
||||
"n-gb-left": "{n} GB zbývá",
|
||||
"n-gb-required": "{n} GB vyžadováno",
|
||||
"n-hexadecimal-characters": "{n} šestnáctkových znaků.",
|
||||
"n-hosts": "1 hostitel | {n} hostitelů",
|
||||
"n-hosts-awaiting-patch": "{n} hostitel čeká na tuto záplatu | {n} hostitelů čeká na tuto záplatu",
|
||||
"n-internal-networks": "1 interní síť | {n} interní sítě | {n} interních sítí",
|
||||
"n-missing": "{n} chybí",
|
||||
"n-networks": "1 síť | {n} sítě | {n} sítí",
|
||||
"n-percent": "{n}%",
|
||||
"n-pifs": "1 fyzické rozhraní | {n} fyzická rozhraní | {n} fyzických rozhraní",
|
||||
"n-snapshots": "1 zachycený stav | {n} zachycené stavy | {n} zachycených stavů",
|
||||
"n-srs": "1 repozitář úložiště | {n} repozitáře úložiště | {n} repozitářů úložiště",
|
||||
"n-traffic-rules": "1 pravidlo pro provoz | {n} pravidla pro provoz | {n} pravidel pro provoz",
|
||||
@@ -887,11 +746,6 @@
|
||||
"n-vms": "1 virt. stroj | {n} virt. strojů",
|
||||
"name": "Název",
|
||||
"name-required": "Je zapotřebí název.",
|
||||
"native": "Nativní",
|
||||
"nbd:disabled": "Zakázáno",
|
||||
"nbd:insecure": "Nezabezpečené (nešifrováno)",
|
||||
"nbd:insecure-warning": "Data disku záloh budou po této síti cestovat nešifrovaně. Toto povolte pouze na síti vyhrazené pro zálohy a izolované od virt. strojů a uživatelů (vyhrazená VLAN nebo fyzická síť).",
|
||||
"nbd:secure": "Zabezpečené (TLS)",
|
||||
"nested-virtualization": "Vnořená virtualizace",
|
||||
"netmask": "Maska sítě",
|
||||
"network": "Síť",
|
||||
@@ -943,7 +797,6 @@
|
||||
"new-vm:user-config-variables-name": "{'{name}'}: název virt. stroje. Nemůže obsahovat „_“ (podtržítko)",
|
||||
"news": "Novinky",
|
||||
"news-name": "Novinky v {name}",
|
||||
"next-run": "Příští spuštění",
|
||||
"nfs": "NFS",
|
||||
"nic-type": "Typ síťového rozhraní",
|
||||
"no-active-backup-jobs": "Na této lokalitě nejsou žádné aktivní úlohy zálohování.",
|
||||
@@ -952,14 +805,10 @@
|
||||
"no-backup-job-available": "Nejsou k dispozici žádné úlohy zálohování",
|
||||
"no-backup-repository-detected": "Nezjištěny žádné repozitáře záloh",
|
||||
"no-backup-run-available": "Nejsou k dispozici žádné běhy zálohy",
|
||||
"no-br-selected": "Nevybrán žádný repozitář záloh",
|
||||
"no-config": "Žádné nastavení",
|
||||
"no-custom-field-detected": "Nezjištěny žádné uživatelsky určené kolonky",
|
||||
"no-data": "Žádné údaje",
|
||||
"no-data-to-calculate": "Žádná data k výpočtu",
|
||||
"no-default-network-configured": "Nenastavena žádná výchozí síť.",
|
||||
"no-empty-network-to-fill": "Žádná prázdná síť k vyplnění",
|
||||
"no-empty-sr-to-fill": "Žádný prázdný repozitář záloh k vyplnění",
|
||||
"no-group-attached": "Nepřipojena žádná skupina",
|
||||
"no-host-attached": "Nepřipojeni žádní hostitelé",
|
||||
"no-host-detected": "Nezjištěni žádní hostitelé",
|
||||
@@ -967,12 +816,10 @@
|
||||
"no-network-detected": "Nezjištěny žádné sítě",
|
||||
"no-pbd-attached": "Nepřipojená žádná PBD",
|
||||
"no-pif-detected": "Nezjištěna žádná fyz. rozhraní",
|
||||
"no-plugin-detected": "Nezjištěny žádné zásuvné moduly",
|
||||
"no-pools-detected": "Nezjištěny žádné fondy",
|
||||
"no-replicated-vm": "Tento virt. stroj není replikován. Pokud chcete zapnout replikaci, vytvořte úlohu replikování.",
|
||||
"no-result": "Nic nenalezeno",
|
||||
"no-role-applied": "Neuplatněna žádná role",
|
||||
"no-run": "Žádný běh",
|
||||
"no-running-vm-detected": "Nezjištěny žádné spuštěné virt. stroje",
|
||||
"no-selected-vm-can-be-exported": "Žádný z označených virt. strojů není možné exportovat",
|
||||
"no-selected-vm-can-be-migrated": "Žádný z označených virt. strojů není možné přestěhovat",
|
||||
@@ -1013,7 +860,6 @@
|
||||
"operation:force-reboot": "Vynucené restartování",
|
||||
"operation:force-shutdown": "Vynucené vypínání",
|
||||
"operation:import": "Importování",
|
||||
"operation:migrate": "Stěhující",
|
||||
"operation:pause": "Pozastavování",
|
||||
"operation:resume": "Obnovování chodu",
|
||||
"operation:shutdown": "Vypínání",
|
||||
@@ -1025,7 +871,6 @@
|
||||
"operation:vm-clean-shutdown": "Korektní vypínání virt. strojů",
|
||||
"operation:vm-hard-shutdown": "Vynucené vypínání virt. strojů",
|
||||
"operation:vm-suspend": "Uspávání virt. strojů",
|
||||
"optional": "Volitelné",
|
||||
"options": "Možnosti",
|
||||
"or": "Nebo",
|
||||
"os-kernel": "Jádro operačního systému",
|
||||
@@ -1039,14 +884,11 @@
|
||||
"partially-connected": "Částečně připojeno",
|
||||
"password": "Heslo",
|
||||
"password-invalid": "Neplatné heslo",
|
||||
"password-required": "Je zapotřebí heslo.",
|
||||
"patch-name": "Název opravy",
|
||||
"patches": "Záplaty",
|
||||
"patches-up-to-date": "Záplaty aktuální",
|
||||
"path": "Popis umístění",
|
||||
"path-in-bucket": "Popis umístění v buketu",
|
||||
"path-in-container": "Popis umístění v kontejneru",
|
||||
"path-must-be-absolute-on-proxy-host": "Je třeba, aby popis umístění na hostiteli proxy byl absolutní. Příklad: /var/lib/xoa/backups",
|
||||
"path-on-share": "Popis umístění na sdílení",
|
||||
"pause": "Pozastavit",
|
||||
"pause-blocked": "Pozastavení blokováno",
|
||||
@@ -1058,18 +900,6 @@
|
||||
"pifs-status": "Stav fyzických rozhraní",
|
||||
"please-confirm-to-continue": "Tuto akci nelze vzít zpět. Opravdu chcete pokračovat?",
|
||||
"please-wait": "Čekejte prosím",
|
||||
"plugin": "Zásuvný modul",
|
||||
"plugin-missing": "Zásuvný modul chybí",
|
||||
"plugin:configuration-of": "nastavení {name}",
|
||||
"plugin:configuration-presets": "Přednastavené konfigurace",
|
||||
"plugin:configuration-presets-info": "Vyplnit formulář předdefinovaným nastavením",
|
||||
"plugin:delete-configuration-info": "Nastavení zásuvného modulu bude ztraceno.",
|
||||
"plugin:needs-configuration": "Dokud nebude nastavený, tento zásuvný modul není možné načíst.",
|
||||
"plugin:needs-configuration-short": "Než ho bude možné načíst, je třeba nastavit.",
|
||||
"plugin:not-configurable": "Tento zásuvný modul není možné nijak nastavovat",
|
||||
"plugin:test-info": "Vyzkoušet zásuvný modul s jeho uloženým nastavením.",
|
||||
"plugins": "Zásuvné moduly",
|
||||
"plus-n": "+{n}",
|
||||
"policy": "Zásada",
|
||||
"pool": "Fond",
|
||||
"pool-connection-ip-info": "Zadejte adresu hlavního hostitele fondu, ke kterému se chcete připojit.",
|
||||
@@ -1177,17 +1007,14 @@
|
||||
"resources-overview": "Přehled prostředků",
|
||||
"rest-api": "REST API",
|
||||
"retry": "Zkusit znovu",
|
||||
"review-and-confirm": "Zkontrolovat a potvrdit",
|
||||
"roles": "Role",
|
||||
"roles-applied": "Role uplatněny",
|
||||
"root-by-default": "Výchozí je „root“.",
|
||||
"rule-type": "Typ pravidla",
|
||||
"run": "Spustit",
|
||||
"run-interrupted": "Běh byl přerušen před dokončením",
|
||||
"running-vm": "Spuštěný virt. stroj | Spuštěné virt. stroje",
|
||||
"s3": "S3",
|
||||
"s3-backup-repository": "S3 repozitář záloh",
|
||||
"s3-endpoint-sample": "Příklad: s3.us-west-1.amazonaws.com",
|
||||
"scan-pifs": "Skenovat fyzická rozhraní",
|
||||
"schedule": "Plán",
|
||||
"schedules": "Plány",
|
||||
@@ -1198,8 +1025,6 @@
|
||||
"select-destination-host": "Vyberte cílového hostitele",
|
||||
"select-format": "Vyberte formát",
|
||||
"select-host": "Vybrat hostitele",
|
||||
"select-pool": "Vybrat fond",
|
||||
"select-preset": "Vybrat přednastavení",
|
||||
"select-to-see-details": "Podrobnosti si zobrazíte kliknutím na {icon}",
|
||||
"selected-vms-in-execution": "Některé z vybraných virt. strojů jsou spuštěné",
|
||||
"self-signed-certificates": "Samy sebou podepsané certifikáty",
|
||||
@@ -1210,14 +1035,10 @@
|
||||
"show-by": "Položek/stránku",
|
||||
"shutdown-blocked": "Vypnutí blokováno",
|
||||
"size": "Velikost",
|
||||
"size-and-speed": "@:size a @.lower:speed",
|
||||
"size-on-disk": "Velikost na disku",
|
||||
"skipped": "Přeskočeno",
|
||||
"smart-mode": "Inteligentní režim",
|
||||
"smb": "SMB",
|
||||
"smb-intended-for-windows": "SMB vzdálené jsou zamýšlené pro Windows servery. Pro linuxové systémy (včetně většiny NAS zařízení, využívající Samba), namísto toho použijte NFS.",
|
||||
"smb-share-sample": "Příklad: [adresa\\sdileni]",
|
||||
"smb-subfolder-sample": "Příklad: [popis\\umisteni\\zalohy]",
|
||||
"snapshot": "Zachytit stav",
|
||||
"snapshot-created-on": "Zachycený stav vytvořen",
|
||||
"snapshot-delete-warning": "Smazání 1 zachyceného stavu může vést k nevratné ztrátě dat. Tato akce je trvalá a nelze ji vzít zpět. | Smazání {n} zachycených stavů může vést k nevratné ztrátě dat. Tato akce je trvalá a nelze ji vzít zpět.",
|
||||
@@ -1267,13 +1088,11 @@
|
||||
"stats": "Statistiky",
|
||||
"status": "Stav",
|
||||
"status:active": "Aktivní",
|
||||
"status:configured": "Nastaveno",
|
||||
"status:connected": "Připojeno",
|
||||
"status:disabled": "Zakázáno",
|
||||
"status:disconnected": "Odpojeno",
|
||||
"status:halted": "Zastaveno | Zastavené",
|
||||
"status:inactive": "Neaktivní",
|
||||
"status:not-configured": "Nenastaveno",
|
||||
"status:paused": "Pozastaveno",
|
||||
"status:running": "Spuštěné",
|
||||
"status:suspended": "Uspáno",
|
||||
@@ -1287,7 +1106,6 @@
|
||||
"storage-repositories": "Repozitáře úložiště",
|
||||
"storage-repository": "Repozitář úložiště",
|
||||
"storage-usage": "Využití úložiště",
|
||||
"subfolder": "Podsložka",
|
||||
"success": "Úspěch",
|
||||
"summary": "Souhrn",
|
||||
"support": "Podpora",
|
||||
@@ -1314,7 +1132,6 @@
|
||||
"tasks-page": "Stránka Úkoly",
|
||||
"template": "Šablona",
|
||||
"template-has-bios-strings": "Šablona už obsahuje řetězec BIOS",
|
||||
"test-data": "Vyzkoušet data",
|
||||
"theme": "Motiv vzhledu",
|
||||
"theme-auto": "Automaticky",
|
||||
"theme-dark": "Tmavý",
|
||||
@@ -1334,9 +1151,6 @@
|
||||
"this-vm-cant-be-migrated": "Tento virt. stroj není možné přestěhovat",
|
||||
"timeout": "Časový limit",
|
||||
"timezone": "Časové pásmo",
|
||||
"to-network": "Na síť",
|
||||
"to-sr": "Na repozitář úložiště",
|
||||
"to-vlan": "Na VLAN",
|
||||
"toolstack-uptime": "Doba chodu vrstev nástrojů",
|
||||
"top-#": "Nej {n}",
|
||||
"topology": "Topologie",
|
||||
@@ -1359,7 +1173,6 @@
|
||||
"traffic-rules:format-warning": "Chyba nastavení: Pravidla pro provoz nejsou v očekávaném formátu. {check-doc} ohledně toho, jak je převést.",
|
||||
"traffic-rules:format-warning:check-doc": "Podívejte se do neaktuálnější dokumentace",
|
||||
"traffic-rules:no-traffic-rules-detected": "Nezjištěna žádná pravidla pro provoz",
|
||||
"traffic-rules:target-on": "@.capitalize:direction-on",
|
||||
"traffic-rules:xapi-plugin-required": "Vyžaduje režim XAPI zásuvného modulu",
|
||||
"translation-tool": "Nástroj pro překládání",
|
||||
"treeview": "Stromové zobrazení",
|
||||
@@ -1373,11 +1186,8 @@
|
||||
"unable-to-create-new-network": "Nebylo možné vytvořit novou síť",
|
||||
"unable-to-create-new-vif": "Nebylo možné vytvořit nové virt. síťové rozhraní",
|
||||
"unable-to-delete-network": "Síť nebylo možné smazat",
|
||||
"unable-to-edit-vif": "Virt. rozhraní nebylo možné upravit",
|
||||
"unable-to-migrate-vdi": "Nebylo možné přestěhovat obraz virt. disku na repozitář úložiště",
|
||||
"unauthorized": "Nepověřené",
|
||||
"unknown": "Neznámé",
|
||||
"unknown-error": "Neznámá chyba",
|
||||
"unlocked": "Odemčeno",
|
||||
"unnamed": "Bez názvu",
|
||||
"unreachable-hosts": "Nedosažitelní hostitelé",
|
||||
@@ -1386,7 +1196,6 @@
|
||||
"untranslated-text-helper": "Nepřeložené texty budou v angličtině (výchozí).",
|
||||
"up-to-date": "Aktuální",
|
||||
"url": "URL",
|
||||
"use-https": "Použít HTTPS",
|
||||
"used": "Využito",
|
||||
"used-for-backup": "Použito pro zálohu",
|
||||
"used-space": "Využitý prostor",
|
||||
@@ -1395,10 +1204,8 @@
|
||||
"user-config": "Nastavení uživatele",
|
||||
"user-management": "Správa uživatelů",
|
||||
"username": "Uživatelské jméno",
|
||||
"username-required": "Je zapotřebí uživatelské jméno.",
|
||||
"users": "Uživatelé",
|
||||
"uuid": "UUID",
|
||||
"value-by-default": "{value} ve výchozím stavu",
|
||||
"vcpu": "virt. procesor",
|
||||
"vcpu-at-startup": "Virt. procesor při spuštění",
|
||||
"vcpus": "virt. procesory",
|
||||
@@ -1408,7 +1215,6 @@
|
||||
"vdi-connect-title": "Chystáte se připojit 1 obraz virt. disku | Chystáte se připojit {n} obrazy virt. disků | Chystáte se připojit {n} obrazů virt. disků",
|
||||
"vdi-delete-warning": "Toto trvale smaže vybraný virt. disk a veškerá data na něm uložená. Tuto akci nelze vzít zpět!",
|
||||
"vdi-description": "Popis obrazu virt. disku",
|
||||
"vdi-destination-sr-required": "{name}: @:destination-sr-required",
|
||||
"vdi-detach-info": "Toto zruší přiložení označených obrazů virt. disků k virt. stroji. Disk nebude smazán a je možné ho později znovu přiložit.",
|
||||
"vdi-detach-title": "Chystáte se zrušit přiložení 1 obraz virt. disku | Chystáte se zrušit přiložení {n} obrazy virt. disků | Chystáte se zrušit přiložení {n} obrazů virt. disků",
|
||||
"vdi-disconnect-info": "Virt. stroj už nebude mít přístup k obrazu virt. disku. Ten zůstane přiložený a je možné znovu připojit později.",
|
||||
@@ -1422,17 +1228,12 @@
|
||||
"vdi-throughput": "Objemy čtení/zápisů na virt. disky",
|
||||
"vdis": "Virt. disky",
|
||||
"vdis-allocated-space": "Prostor přidělený obrazům virt. disků",
|
||||
"vdis-must-be-migrated": "Je třeba, aby obrazy virt. disků byly přestěhovány.",
|
||||
"version": "Verze",
|
||||
"version-number": "Verze {version}",
|
||||
"vga": "VGA",
|
||||
"vhd-file": "VHD soubor",
|
||||
"vhd-file-hint": "Je třeba, aby velikost disku byla < 2 TB",
|
||||
"video-ram": "Videopaměť",
|
||||
"vif": "Virt. rozhraní",
|
||||
"vif-connect-title": "Chystáte se připojit 1 virt. síťové rozhraní | Chystáte se připojit {n} virt. síťová rozhraní | Chystáte se připojit {n} virt. síťových rozhraní",
|
||||
"vif-connected": "Virt. síťové rozhraní připojeno",
|
||||
"vif-destination-network-required": "{name}: @:destination-network-required",
|
||||
"vif-device": "Virt. rozhraní č. {device}",
|
||||
"vif-disconnect-info": "Virt. stroj už nebude mít přístup k síti. Virt. rozhraní zůstává připojené a je možné ho znovu připojit později.",
|
||||
"vif-disconnect-title": "Chystáte se odpojit 1 virt. síťové rozhraní | Chystáte se odpojit {n} síťová zařízení | Chystáte se odpojit {n} síťových zařízení",
|
||||
@@ -1440,7 +1241,6 @@
|
||||
"vif-required": "Virt. síťové rozhraní je potřebné.",
|
||||
"vif-status": "Stav virt. rozhraní",
|
||||
"vifs": "Virt. rozhraní",
|
||||
"vifs-must-be-reassigned": "Je třeba znovu přiřadit virt. sítě.",
|
||||
"viridian": "Viridian",
|
||||
"virtual-tpm": "Virtuální TPM (VTPM)",
|
||||
"virtualization-boot-settings": "Nastavení virtualizace a zavádění systému",
|
||||
@@ -1450,24 +1250,18 @@
|
||||
"vlan-required": "Je zapotřebí VLAN.",
|
||||
"vm": "Virt. stroj",
|
||||
"vm-backup-failure-number-of-retries": "Počet opakovaných pokusů, pokud se záloha virt. stroje nezdaří",
|
||||
"vm-delete-warning": "Toto virt. stroj nevratně smaže (včetně jeho zachycených stavů a disků). Disky připojené k jinému virt. stroji jsou ponechány. Tuto akci nelze vzít zpět.",
|
||||
"vm-disable-blocked-protection": "Pokud chcete pokračovat, je možné ochranu vypnout v nastavení virt. stroje.",
|
||||
"vm-disable-delete-protection": "Pokud ho chcete oderat, upravte jeho nastavení (vypněte ochranu proti smazání).",
|
||||
"vm-disable-migration-protection": "Pro pokračování prosím upravte jeho nastavení a vypněte ochranu před stěhováním.",
|
||||
"vm-is-running": "Virt. stroj je spuštěný",
|
||||
"vm-limit-topology": "Limit topologie virt. stroje",
|
||||
"vm-management": "Správa virt. stroje",
|
||||
"vm-name": "Název virt. stroje",
|
||||
"vm-name-required": "Je zapotřebí název virt. stroje.",
|
||||
"vm-not-found": "@:vm @.lower:not-found",
|
||||
"vm-not-running": "Virt. stroj není spuštěný",
|
||||
"vm-not-running-intra-pool-nothing-to-migrate": "Virt. stroj není spuštěný: v rámci jeho fondu zde není žádná aktivní RAM, kterou přestěhovat. Pokud nejsou žádné z disků stěhovány na jiný repozitář úložiště, pak není co stěhovat.",
|
||||
"vm-not-running-no-disk-nothing-to-migrate": "Nic ke stěhování: virt. stroj není spuštěný a nemá žádný disk.",
|
||||
"vm-off": "Tento virtuální stroj je vypnutý.",
|
||||
"vm-protected-deletion": "Tento virt. stroje je v tuto chvíli chráněný proti smazání.",
|
||||
"vm-protected-force-reboot": "Tento virt. stroje je chráněný proti vynucení restartu.",
|
||||
"vm-protected-force-shutdown": "Tento virt. stroje je chráněný proti vynucení vypnutí.",
|
||||
"vm-protected-migration": "Tento virt. stroj je chráněn proti stěhování.",
|
||||
"vm-protected-pause": "Tento virt. stroje je chráněný proti pozastavení.",
|
||||
"vm-protected-reboot": "Tento virt. stroje je chráněný proti restartu.",
|
||||
"vm-protected-shutdown": "Tento virt. stroje je chráněný proti vypnutí.",
|
||||
@@ -1528,6 +1322,5 @@
|
||||
"xoa-ssh-password-confirm-different": "Heslo pro SSH nebylo zadáno dvakrát stejně",
|
||||
"xva": "XVA",
|
||||
"you-are-currently-on": "V tuto chvíli se nacházíte na: {0}",
|
||||
"your-default-network-is": "Vaše výchozí síť je {name}",
|
||||
"zstd": "ZSTD"
|
||||
}
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
"action:add-network-in-xo-5": "Tilføj netværk i XO-5",
|
||||
"action:add-sort": "Tilføj sortering",
|
||||
"action:add-vifs-in-xo-5": "Tilføj VIF",
|
||||
"action:apply": "Anvend",
|
||||
"action:attach": "Tilknyt",
|
||||
"action:attach-vdi": "@:attach-vdi",
|
||||
"action:back": "Tilbage",
|
||||
@@ -25,7 +24,6 @@
|
||||
"action:change-state": "Skift tilstand",
|
||||
"action:clear-selection": "ryd valg",
|
||||
"action:close": "Luk",
|
||||
"action:configure": "Konfigurér",
|
||||
"action:confirm": "Bekræft",
|
||||
"action:connect": "Forbind",
|
||||
"action:connect-n": "Forbind {n}",
|
||||
@@ -49,7 +47,6 @@
|
||||
"action:create-vdi": "Opret VDI",
|
||||
"action:create-vif": "Opret VIF",
|
||||
"action:delete": "Slet",
|
||||
"action:delete-configuration": "Slet konfiguration",
|
||||
"action:delete-filter": "Slet filter",
|
||||
"action:delete-group": "Slet gruppe",
|
||||
"action:delete-n-networks": "Slet 1 netværk | Slet {n} netværk",
|
||||
@@ -69,7 +66,6 @@
|
||||
"action:disable-and-evacuate-vms": "Deaktiver og evakuer VM'er",
|
||||
"action:disable-host": "Deaktiver host",
|
||||
"action:disable-host-and-evacuate-vms": "Deaktiver host og evakuer VM'er",
|
||||
"action:disable-load-at-startup": "Slå indlæsning fra ved opstart",
|
||||
"action:disconnect": "Afbryd",
|
||||
"action:disconnect-n": "Afbryd {n}",
|
||||
"action:disconnect-n-srs": "Afbryd 1 SR | Afbryd {n} SR'er",
|
||||
@@ -88,7 +84,6 @@
|
||||
"action:enable": "Aktiver",
|
||||
"action:enable-host": "Aktiver host",
|
||||
"action:enable-light-mode": "Skift til lys tilstand",
|
||||
"action:enable-load-at-startup": "Slå indlæsning til ved opstart",
|
||||
"action:export": "Eksporter",
|
||||
"action:export-content": "Eksporter indhold",
|
||||
"action:export-n-vms": "Eksporter 1 VM | Eksporter {n} VM'er",
|
||||
@@ -96,8 +91,6 @@
|
||||
"action:export-table-to": "Eksportér tabel til {type}",
|
||||
"action:export-vdi": "Eksporter en VDI",
|
||||
"action:export-vm": "Eksportér VM | Eksportér VM'er",
|
||||
"action:fill-empty-networks": "Udfyld tomme netværk",
|
||||
"action:fill-empty-srs": "Udfyld tomme SRs",
|
||||
"action:filter": "Filtrer",
|
||||
"action:force-migrate-on-sr": "Tving migrering til SR",
|
||||
"action:force-reboot": "Tving genstart",
|
||||
@@ -105,8 +98,6 @@
|
||||
"action:force-shutdown": "Tving nedlukning",
|
||||
"action:forget": "Glem",
|
||||
"action:forget-host": "Glem host",
|
||||
"action:forget-n-brs": "@:action:forget 1 BR | @:action:forget {n} BRs",
|
||||
"action:forget-n-pifs": "Glem 1 PIF | Glem {n} PIFs",
|
||||
"action:go-back": "Gå tilbage",
|
||||
"action:group": "Gruppe",
|
||||
"action:hide": "Skjul",
|
||||
@@ -114,7 +105,6 @@
|
||||
"action:import-export": "Import/Eksport",
|
||||
"action:install-app": "Installer {name}",
|
||||
"action:install-guest-tools": "Installation af gæst integrations værktøjer",
|
||||
"action:load": "Indlæs",
|
||||
"action:load-now": "Indlæs nu",
|
||||
"action:log-out": "Log ud",
|
||||
"action:migrate": "Migrer",
|
||||
@@ -132,16 +122,13 @@
|
||||
"action:reboot": "Genstart",
|
||||
"action:reboot-host": "@:action:reboot host",
|
||||
"action:reformat": "Omformater",
|
||||
"action:reset-all-networks": "Nulstil alle netværk",
|
||||
"action:reset-all-srs": "Nulstil alle SRs",
|
||||
"action:reset-to-default": "Nulstil til standard",
|
||||
"action:restart-toolstack": "Genstart toolstack",
|
||||
"action:resume": "Forsæt",
|
||||
"action:revert-to-snapshot": "Gendan til snapshot",
|
||||
"action:revert-vm-here": "Gendan VM her",
|
||||
"action:save": "Gem",
|
||||
"action:search": "Søg",
|
||||
"action:search-treeview": "@:action:search i træ struktur ({shortcut})",
|
||||
"action:search-treeview": "Søg i træ struktur",
|
||||
"action:see-all": "Se alt",
|
||||
"action:see-less": "Se mindre",
|
||||
"action:see-n-more": "Se {n} mere",
|
||||
@@ -171,11 +158,7 @@
|
||||
"action:start-host": "Start host",
|
||||
"action:start-on-host": "Start på en specifik host",
|
||||
"action:suspend": "Suspendere",
|
||||
"action:test": "Test",
|
||||
"action:test-plugin": "Test plugin",
|
||||
"action:test-speed": "Test hastighed",
|
||||
"action:turn-into-group": "Lav om til gruppe",
|
||||
"action:unload": "Aflæs",
|
||||
"action:update": "Opdater",
|
||||
"action:use-query-builder": "Brug forespørgselsbygger",
|
||||
"add-or": "+ELLER",
|
||||
@@ -201,8 +184,6 @@
|
||||
"all-done!": "Alt færdigt!",
|
||||
"all-good!": "Alt er godt!",
|
||||
"all-quiet-launchpad": "Ingen alarmer - alt er OK",
|
||||
"all-srs-shared-storage-migration-optional": "Alle SRs er delt, lager migrering af valgfrit.",
|
||||
"all-vifs-follow-vm": "Alle VIFer følger med VMen til dets nye host: inden for puljen, ændres deres netværk ikke.",
|
||||
"allocated-space": "Allokeret plads",
|
||||
"allow": "Tillad",
|
||||
"allow-self-signed-ssl": "Du skal muligvis tillade selvsignerede SSL-certifikater i din browser",
|
||||
@@ -217,7 +198,6 @@
|
||||
"archives": "Arkiver",
|
||||
"aria:breadcrumb:label": "Brødkrumme",
|
||||
"ascending": "stigende",
|
||||
"at-least-one-enabled": "Mindst én slås til",
|
||||
"attach-vdi": "Tilknyt eksisterende VDI",
|
||||
"auto-generated": "Automatisk genereret",
|
||||
"auto-power": "Automatisk tænd",
|
||||
@@ -245,9 +225,6 @@
|
||||
"backup:last-replication": "Sidste replikering",
|
||||
"backup:pool-metadata": "Pool metadata",
|
||||
"backup:rolling-snapshot": "Rullende snapshot",
|
||||
"backup:vms-backup": "VMs backup",
|
||||
"backup:vms-mirror": "VMs spejl",
|
||||
"backup:vms-replication": "VMs replikering",
|
||||
"backup:xo-config": "XO konfiguration",
|
||||
"backups": "Backups",
|
||||
"backups:jobs:disabled": "Deaktiveret",
|
||||
@@ -309,7 +286,6 @@
|
||||
"confirm-cancel?": "Er du sikker på, at du vil annullere?",
|
||||
"confirm-delete": "Du er ved at slette {name}",
|
||||
"confirm-disconnect": "Du er ved at afbryde {0}",
|
||||
"confirm-forget": "Du er ved at glemme {name}",
|
||||
"confirm-vm-revert": "Bekræft gendannelse af VM",
|
||||
"connect": "Forbind",
|
||||
"connected": "Forbundet",
|
||||
@@ -321,10 +297,7 @@
|
||||
"console": "Konsol",
|
||||
"console-actions": "Konsolhandlinger",
|
||||
"console-clipboard": "Konsol udklipsholder",
|
||||
"console-keyboard-layout": "Gæst tastatur layout",
|
||||
"console-keyboard-layout-not-applicable": "Ikke relevant: karakterer bliver sent som de er til denne konsol",
|
||||
"console-offline": "Konsol offline",
|
||||
"console-type-text-skipped": "Ikke skrevet, manglende fra det valgte tastatur layout: {chars}",
|
||||
"console-unavailable": "Konsol ikke tilgængelig",
|
||||
"console-unavailable-reason": "Konsollen er i øjeblikket utilgængelig, fordi {type} er slukket.",
|
||||
"container-name": "Containernavn",
|
||||
@@ -374,12 +347,7 @@
|
||||
"deploy-xoa-status:waiting": "Venter på at XOA svarer…",
|
||||
"descending": "faldende",
|
||||
"description": "Beskrivelse",
|
||||
"destination-host": "Destination host",
|
||||
"destination-network": "Destinations netværk",
|
||||
"destination-network-required": "Destinations netværk er påkrævet.",
|
||||
"destination-sr": "Destinations-SR",
|
||||
"destination-sr-required": "Destinations SR er påkrævet.",
|
||||
"details": "Detaljer",
|
||||
"device": "Enhed",
|
||||
"device-config": "Enhedskonfiguration",
|
||||
"dhcp": "DHCP",
|
||||
@@ -444,27 +412,14 @@
|
||||
"for-replication": "Til replikering",
|
||||
"force-reboot-blocked": "Tvungen genstart blokeret",
|
||||
"force-shutdown-blocked": "Tvungen nedlukning blokeret",
|
||||
"form:error:field-integer": "{field} skal være et heltal",
|
||||
"form:error:field-maximum": "{field} skal være {max} eller mindre",
|
||||
"form:error:field-min-items": "{field} skal indholde mindst {n} ting | {field} skal indholde mindst {n} ting",
|
||||
"form:error:field-minimum": "{field} skal være {min} eller mere",
|
||||
"form:error:field-required": "{field} er påkrævet",
|
||||
"form:error:integer": "Skal være et heltal",
|
||||
"form:error:maximum": "Skal være {max} eller mindre",
|
||||
"form:error:min-items": "Skal indeholde mindst {n} ting | Skal indeholde mindst {n} ting",
|
||||
"form:error:minimum": "Skal være {min} eller mere",
|
||||
"form:error:required": "Dette felt er påkrævet",
|
||||
"form:n-errors-summary": "{n} felter kræver opmærksomhed | {n} felter kræver opmærksomhed",
|
||||
"form:warning:out-of-range": "Bør være mellem {min} og {max}",
|
||||
"format": "Format",
|
||||
"free-space": "Ledig plads",
|
||||
"free-space-on-sr": "Ledig plads på SR",
|
||||
"from-device": "Fra enhed",
|
||||
"from-network": "Fra netværk",
|
||||
"from-sr": "Fra SR",
|
||||
"from-vlan": "Fra VLAN",
|
||||
"from-vm": "Fra VM",
|
||||
"full": "Fuld",
|
||||
"full-copy": "Fuld kopi",
|
||||
"fullscreen": "Fuldskærm",
|
||||
"gateway": "Gateway",
|
||||
@@ -480,8 +435,6 @@
|
||||
"gzip": "GZIP",
|
||||
"hardware": "Hardware",
|
||||
"hardware-specifications": "Hardware specifikationer",
|
||||
"health-check": "Helbredscheck",
|
||||
"health-check-sr": "@:health-check SR",
|
||||
"heartbeat-storage-repository": "Heartbeat storage repository",
|
||||
"here": "Her",
|
||||
"high-availability": "Høj tilgængelighed (HA)",
|
||||
@@ -511,7 +464,6 @@
|
||||
"in-last-three-runs": "I deres sidste 3 kørsler",
|
||||
"in-progress": "I gang",
|
||||
"included": "Inkluderet",
|
||||
"incremental": "Inkremental",
|
||||
"info": "Info",
|
||||
"info:vdi-attached-rw": "Denne VDI er allerede tilknyttet i læse-skrive-tilstand til en anden VM.",
|
||||
"infos": "Info",
|
||||
@@ -542,10 +494,8 @@
|
||||
"is-primary-host": "{name} er primær host",
|
||||
"iscsi-iqn": "iSCSI IQN",
|
||||
"iso-dvd": "ISO/DVD",
|
||||
"item": "Ting",
|
||||
"job": "Job",
|
||||
"job:arg:allocated-space-required": "Allokeret plads er påkrævet",
|
||||
"job:arg:backup-repository-required": "Backup repository er påkrævet",
|
||||
"job:arg:bond-mode-required": "@:bond-mode-required",
|
||||
"job:arg:direction-required": "Retning er påkrævet",
|
||||
"job:arg:file-required": "Fil er påkrævet",
|
||||
@@ -553,7 +503,6 @@
|
||||
"job:arg:ip-range-required": "IP-område er påkrævet",
|
||||
"job:arg:missing-payload": "Payload mangler",
|
||||
"job:arg:name-required": "@:name-required",
|
||||
"job:arg:nbd-and-insecure-nbd-exclusive": "NBD og usikker NBD kan ikke være til på samme tid",
|
||||
"job:arg:password-required": "Password er påkrævet",
|
||||
"job:arg:pif-id-required": "PIF-ID er påkrævet",
|
||||
"job:arg:pif-ids-required": "Mindst ét PIF-ID er påkrævet",
|
||||
@@ -571,20 +520,8 @@
|
||||
"job:arg:vm-id-required": "VM-ID er påkrævet",
|
||||
"job:backup-repository-benchmark:in-progress": "Benchmark af backup-repository i gang…",
|
||||
"job:backup-repository-benchmark:missing-backup-repository": "Backup-repository mangler",
|
||||
"job:backup-repository-benchmark:n-repositories-disabled": "1 valgt backup repository er slået fra | {n} valgte backup repositorys er slået fra",
|
||||
"job:backup-repository-benchmark:repository-disabled": "Backup-repository deaktiveret",
|
||||
"job:backup-repository-bulk-edit:in-progress": "Backup repository ændringer i gang…",
|
||||
"job:backup-repository-bulk-edit:missing-backup-repository": "Ingen backup repository at ændre",
|
||||
"job:backup-repository-bulk-edit:missing-payload": "Manglende ændringer for et backup repository",
|
||||
"job:backup-repository-change-state:in-progress": "Backup repository status ændring i gang…",
|
||||
"job:backup-repository-change-state:missing-backup-repository": "Ingen backup repository at forbinde til eller at ændre",
|
||||
"job:backup-repository-create:encryption-requires-block": "Kryptering kræver det blokbaserede backupformat",
|
||||
"job:backup-repository-edit:encryption-key-locked": "Krypteringsnøgle kan ikke ændres",
|
||||
"job:backup-repository-edit:encryption-requires-block": "Kryptering kræver blok-baseret backup format",
|
||||
"job:backup-repository-edit:unknown-type": "Ukendt backup repository type",
|
||||
"job:backup-repository-forget:in-progress": "Glemmer backup repository…",
|
||||
"job:backup-repository-forget:missing-backup-repository": "Intet backup repository at glemme",
|
||||
"job:backup-repository-forget:used-by-n-backup-jobs": "Bruges af 1 backup job, slet den fra jobbet først | Bruges af {n} backup jobs, slet den fra jobbene først",
|
||||
"job:connect:in-progress": "Forbindelse i gang…",
|
||||
"job:create:in-progress": "Oprettelse i gang…",
|
||||
"job:delete:in-progress": "Sletning er i gang…",
|
||||
@@ -638,15 +575,10 @@
|
||||
"job:pbd-plug:pbd-connected": "En eller flere PBD'er er allerede forbundet",
|
||||
"job:pbd-unplug:missing-pbd": "Ingen PBD'er at afbryde",
|
||||
"job:pbd-unplug:pbd-disconnected": "En eller flere PBD'er er allerede afbrudt",
|
||||
"job:pif-forget:in-progress": "PIF glemmes…",
|
||||
"job:pif-forget:is-management-interface": "Kan ikke glemme en host's management interface",
|
||||
"job:pif-forget:missing-pif": "Ingen PIFs at glemme",
|
||||
"job:pif-management-reconfigure:bad-power-state": "@:host-not-running",
|
||||
"job:pif-management-reconfigure:current-pif": "Nuværende PIF",
|
||||
"job:pif-management-reconfigure:in-progress": "Omkonfiguration af management-grænseflade i gang…",
|
||||
"job:pif-management-reconfigure:missing-ip": "IP-adresse mangler",
|
||||
"job:plugin-autoload:missing-plugin": "@:plugin-missing",
|
||||
"job:plugin-change-state:already-loaded": "Plugin allerede indlæst",
|
||||
"job:server-connect:missing-server": "Ingen servere at forbinde",
|
||||
"job:server-disconnect:missing-server": "Ingen servere at afbryde",
|
||||
"job:server-disconnect:server-disconnected": "En eller flere servere er allerede afbrudt",
|
||||
|
||||
@@ -84,7 +84,7 @@
|
||||
"action:resume": "Fortsetzen",
|
||||
"action:save": "Speichern",
|
||||
"action:search": "Suchen",
|
||||
"action:search-treeview": "In Baumstruktur suchen ({shortcut})",
|
||||
"action:search-treeview": "In Baumstruktur suchen",
|
||||
"action:see-all": "Alles ansehen",
|
||||
"action:see-less": "Weniger anzeigen",
|
||||
"action:see-n-more": "{n} mehr anzeigen",
|
||||
|
||||
@@ -258,8 +258,8 @@
|
||||
"allow-unauthorized": "Allow unauthorized",
|
||||
"allowed-ips": "Allowed IPs",
|
||||
"allowed-ips-example": "For example: 192.168.0.1; 2001:db8::1",
|
||||
"also-on": "Also on",
|
||||
"always": "Always",
|
||||
"also-on": "Also on",
|
||||
"and": "And",
|
||||
"any-file-type": "Any file type",
|
||||
"any-property": "Any property",
|
||||
@@ -487,9 +487,9 @@
|
||||
"disk": "Disk",
|
||||
"disk-name": "Disk name",
|
||||
"disk-space": "Disk space",
|
||||
"disks": "Disks",
|
||||
"distribute-backups-across-backup-repositories": "Distribute backups across the selected backup repositories",
|
||||
"distribute-replicas-across-storage-repositories": "Distribute replicas across the selected storage repositories",
|
||||
"disks": "Disks",
|
||||
"dns": "DNS",
|
||||
"do-you-have-needs": "You have needs and/or expectations? Let us know",
|
||||
"do-you-really-want-to-leave-this-page?": "Some changes are still being deployed. Do you really want to leave this page?",
|
||||
@@ -509,8 +509,8 @@
|
||||
"email-already-added": "This email address has already been added",
|
||||
"email-mandatory": "Email address is mandatory",
|
||||
"empty": "Empty",
|
||||
"empty-tag": "{'<'}empty tag{'>'}",
|
||||
"enable-health-check": "@:action:enable @.lower:health-check",
|
||||
"empty-tag": "{'<'}empty tag{'>'}",
|
||||
"enabled": "Enabled",
|
||||
"encapsulation": "Encapsulation",
|
||||
"encapsulation-required": "Encapsulation is required.",
|
||||
@@ -553,11 +553,11 @@
|
||||
"file-based": "File based",
|
||||
"file-types-and-max-size": "{types}, Max {size}",
|
||||
"filter-actions": "Filter actions",
|
||||
"filters": "Filters",
|
||||
"first-of-day": "first of day",
|
||||
"first-of-month": "first of month",
|
||||
"first-of-week": "first of week",
|
||||
"first-of-year": "first of year",
|
||||
"filters": "Filters",
|
||||
"following-hosts-unreachable": "The following hosts are unreachable",
|
||||
"for-backup": "For backup",
|
||||
"for-replication": "For replication",
|
||||
@@ -803,7 +803,6 @@
|
||||
"job:pif-management-reconfigure:bad-power-state": "@:host-not-running",
|
||||
"job:pif-management-reconfigure:current-pif": "Current PIF",
|
||||
"job:pif-management-reconfigure:in-progress": "Management interface reconfiguration in progress…",
|
||||
"job:pif-management-reconfigure:invalid-mtu": "MTU must be {mtu}",
|
||||
"job:pif-management-reconfigure:missing-ip": "IP address missing",
|
||||
"job:plugin-autoload:missing-plugin": "@:plugin-missing",
|
||||
"job:plugin-change-state:already-loaded": "Plugin already loaded",
|
||||
@@ -971,8 +970,8 @@
|
||||
"long-term-retention:yearly": "yearly",
|
||||
"lvm": "LVM",
|
||||
"mac-address": "MAC address",
|
||||
"mac-address-change-cut-connection": "Changing the MAC address will temporarily cut the connection",
|
||||
"mac-addresses": "MAC addresses",
|
||||
"mac-address-change-cut-connection": "Changing the MAC address will temporarily cut the connection",
|
||||
"manage-citrix-pv-drivers-via-windows-update": "Manage citrix PV drivers via Windows Update",
|
||||
"management": "Management",
|
||||
"management-agent-not-detected": "Management agent not detected",
|
||||
@@ -1105,10 +1104,10 @@
|
||||
"name": "Name",
|
||||
"name-required": "Name is required.",
|
||||
"native": "Native",
|
||||
"navigation": "Navigation",
|
||||
"nbd-backup-info": "If NBD is enabled, it must also be enabled on the network used for backups. Otherwise, qcow2 disks will always be transferred in full, without NBD optimization.",
|
||||
"nbd-concurrency-per-disk": "NBD concurrency per disk",
|
||||
"nbd-concurrency-per-disk-mandatory": "NBD concurrency per disk is mandatory.",
|
||||
"navigation": "Navigation",
|
||||
"nbd:disabled": "Disabled",
|
||||
"nbd:insecure": "Insecure (not encrypted)",
|
||||
"nbd:insecure-warning": "The disk data of the backups will travel unencrypted on this network. Only enable it on a network dedicated to backups and isolated from the VMs and the users (dedicated VLAN or physical network).",
|
||||
@@ -1336,6 +1335,7 @@
|
||||
"planning": "Planning",
|
||||
"please-confirm-to-continue": "This action cannot be undone. Are you sure you want to continue?",
|
||||
"please-wait": "Please wait",
|
||||
"plus-n": "+{n}",
|
||||
"plugin": "Plugin",
|
||||
"plugin-missing": "Plugin is missing",
|
||||
"plugin:configuration-of": "the configuration of {name}",
|
||||
@@ -1347,7 +1347,6 @@
|
||||
"plugin:not-configurable": "This plugin is not configurable",
|
||||
"plugin:test-info": "Test the plugin with its saved configuration.",
|
||||
"plugins": "Plugins",
|
||||
"plus-n": "+{n}",
|
||||
"policy": "Policy",
|
||||
"pool": "Pool",
|
||||
"pool-add-host:ip-info": "Provide the address of the host you want to add to the pool.",
|
||||
@@ -1487,8 +1486,8 @@
|
||||
"resources-overview": "Resources overview",
|
||||
"rest-api": "REST API",
|
||||
"resulting-expression": "Resulting expression",
|
||||
"resume": "Resume",
|
||||
"retention": "Retention",
|
||||
"resume": "Resume",
|
||||
"retry": "Retry",
|
||||
"review": "Review",
|
||||
"review-and-confirm": "Review & confirm",
|
||||
@@ -1672,8 +1671,8 @@
|
||||
"tag-mandatory": "Tag is mandatory.",
|
||||
"tags": "Tags",
|
||||
"target": "Target",
|
||||
"target-network": "Target network",
|
||||
"target-proxy": "Target proxy",
|
||||
"target-network": "Target network",
|
||||
"target-sr": "Target SR",
|
||||
"task": "Task",
|
||||
"task-type": "Task type",
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user