From 73755c0e8cebbf88104eb21906c82595723a3a9a Mon Sep 17 00:00:00 2001 From: Pierre Donias Date: Mon, 22 Jul 2024 11:10:34 +0200 Subject: [PATCH 01/39] feat(lite/XoaButton): support `xo-server`'s setting `http.publicUrl` (#7849) See https://xcp-ng.org/forum/topic/9392 `xo-server` has a config setting `http.publicUrl` that allows the user to force XO to report a custom URL in the pool's other_config (along with the `networkInterfaces` fallback). With this change, the "Access XOA" button in XO Lite will open that URL if it exists and fallback to `networkInterfaces` otherwise. --- @xen-orchestra/lite/CHANGELOG.md | 1 + @xen-orchestra/lite/src/components/XoaButton.vue | 10 ++++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/@xen-orchestra/lite/CHANGELOG.md b/@xen-orchestra/lite/CHANGELOG.md index 79229d7d291..62dd3944089 100644 --- a/@xen-orchestra/lite/CHANGELOG.md +++ b/@xen-orchestra/lite/CHANGELOG.md @@ -4,6 +4,7 @@ - [Pool/Dashboard] Add missing translations for hosts and VMs statuses (PR [#7744](https://github.com/vatesfr/xen-orchestra/pull/7744)) - [i18n] Add Persian translation (based on the contribution made by [@Jokar-xen](https://github.com/Jokar-xen)) (PR [#7775](https://github.com/vatesfr/xen-orchestra/pull/7775)) +- [Access XOA] Support `xo-server`'s' setting `http.publicUrl` to redirect to a custom URL when "Access XOA" button is clicked in XO Lite [Forum#9392](https://xcp-ng.org/forum/topic/9392) (PR [#7849](https://github.com/vatesfr/xen-orchestra/pull/7849)) ## **0.2.3** (2024-05-31) diff --git a/@xen-orchestra/lite/src/components/XoaButton.vue b/@xen-orchestra/lite/src/components/XoaButton.vue index 4f580544635..0e592542a5d 100644 --- a/@xen-orchestra/lite/src/components/XoaButton.vue +++ b/@xen-orchestra/lite/src/components/XoaButton.vue @@ -30,7 +30,8 @@ interface InterfaceInfo { interface ClientInfo { lastConnected: number - networkInterfaces: Record + networkInterfaces?: Record + publicUrl?: string } const xoasInfo = computed(() => { @@ -60,7 +61,12 @@ const xoaAddress = computed(() => { return } - const { networkInterfaces } = xoaInfo.value + const { networkInterfaces, publicUrl } = xoaInfo.value + + if (publicUrl !== undefined) { + return publicUrl + } + if (networkInterfaces === undefined || Object.keys(networkInterfaces).length === 0) { return } From 8542b83f7cb0dee9d5b6968c148bd2e0013fbd82 Mon Sep 17 00:00:00 2001 From: Julien Fontanet Date: Mon, 22 Jul 2024 15:12:47 +0200 Subject: [PATCH 02/39] fix(xen-api/cli): use @xen-orchestra/log Follows 0702454fa --- packages/xen-api/cli-lib.mjs | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/packages/xen-api/cli-lib.mjs b/packages/xen-api/cli-lib.mjs index 2635826b61c..1e833254e46 100644 --- a/packages/xen-api/cli-lib.mjs +++ b/packages/xen-api/cli-lib.mjs @@ -1,12 +1,14 @@ /* eslint-disable no-console */ import blocked from 'blocked' -import createDebug from 'debug' import filter from 'lodash/filter.js' import find from 'lodash/find.js' import L from 'lodash' import minimist from 'minimist' import pw from 'pw' +import transportConsole from '@xen-orchestra/log/transports/console' import { asCallback, fromCallback, fromEvent } from 'promise-toolbox' +import { createLogger } from '@xen-orchestra/log' +import { configure } from '@xen-orchestra/log/configure' import { diff } from 'jest-diff' import { getBoundPropertyDescriptor } from 'bind-property-descriptor' import { start as createRepl } from 'repl' @@ -62,10 +64,15 @@ export async function main(createClient) { } if (opts.verbose) { - // Does not work perfectly. - // - // https://github.com/visionmedia/debug/pull/156 - createDebug.enable('xen-api,xen-api:*') + const { env } = process + configure({ + // display warnings or above, and all that are enabled via DEBUG or + // NODE_DEBUG env + filter: [env.DEBUG, env.NODE_DEBUG, 'xen-api,xen-api:*'].filter(Boolean).join(','), + level: 'info', + + transport: transportConsole(), + }) } let auth @@ -77,9 +84,9 @@ export async function main(createClient) { } { - const debug = createDebug('xen-api:perf') + const { debug } = createLogger('xen-api:perf') blocked(ms => { - debug('blocked for %sms', ms | 0) + debug(`blocked for ${ms | 0}ms`) }) } From a97d55c53c39b5168a3982071895b4bd42c79a52 Mon Sep 17 00:00:00 2001 From: OlivierFL <66562640+OlivierFL@users.noreply.github.com> Date: Mon, 22 Jul 2024 16:31:44 +0200 Subject: [PATCH 03/39] feat(xo-stack): add text-ellipsis utility class (#7843) --- .../lite/src/components/infra/InfraItemLabel.vue | 10 ++-------- .../src/components/pool/dashboard/alarm/AlarmRow.vue | 11 ++++------- .../web-core/lib/assets/css/_typography.pcss | 1 + .../web-core/lib/assets/css/typography/_utils.pcss | 6 ++++++ @xen-orchestra/web-core/lib/components/UiTag.vue | 10 +++------- .../lib/components/cell-object/CellObject.vue | 9 +-------- .../web-core/lib/components/chip/UiChip.vue | 7 +++---- .../web-core/lib/components/dropdown/DropdownItem.vue | 5 +---- .../web-core/lib/components/head-bar/HeadBar.vue | 5 +---- .../lib/components/stacked-bar/StackedBarSegment.vue | 10 ++-------- .../web-core/lib/components/tree/TreeItemLabel.vue | 5 +---- @xen-orchestra/web/src/components/vm/VmHeader.vue | 8 +------- 12 files changed, 26 insertions(+), 61 deletions(-) create mode 100644 @xen-orchestra/web-core/lib/assets/css/typography/_utils.pcss diff --git a/@xen-orchestra/lite/src/components/infra/InfraItemLabel.vue b/@xen-orchestra/lite/src/components/infra/InfraItemLabel.vue index e42dd764d83..50ae6864869 100644 --- a/@xen-orchestra/lite/src/components/infra/InfraItemLabel.vue +++ b/@xen-orchestra/lite/src/components/infra/InfraItemLabel.vue @@ -5,9 +5,9 @@ class="infra-item-label" v-bind="$attrs" > - + -
+
@@ -77,12 +77,6 @@ defineProps<{ font-size: 2rem; } -.text { - overflow: hidden; - white-space: nowrap; - text-overflow: ellipsis; -} - .actions { display: flex; align-items: center; diff --git a/@xen-orchestra/lite/src/components/pool/dashboard/alarm/AlarmRow.vue b/@xen-orchestra/lite/src/components/pool/dashboard/alarm/AlarmRow.vue index 046a3af56c3..63c729d7533 100644 --- a/@xen-orchestra/lite/src/components/pool/dashboard/alarm/AlarmRow.vue +++ b/@xen-orchestra/lite/src/components/pool/dashboard/alarm/AlarmRow.vue @@ -1,12 +1,12 @@