Skip to content

Commit

Permalink
rebase on master
Browse files Browse the repository at this point in the history
  • Loading branch information
CzechSebastian committed Jan 20, 2025
1 parent ea4fe91 commit 3652351
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 20 deletions.
Empty file.
5 changes: 1 addition & 4 deletions @xen-orchestra/lite/src/views/host/HostConsoleView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@
<UiStatusPanel v-else-if="!isHostRunning" :image-source="monitor" :title="$t('power-on-host-for-console')" />
<template v-else-if="host && hostConsole">
<VtsLayoutConsole>
<VtsRemoteConsole v-if="url" ref="consoleElement" :url :is-console-available="isConsoleAvailable" :location="hostConsole.location"
class="remote-console"
@focus="focused = true"
@blur="focused = false" />
<VtsRemoteConsole v-if="url" ref="consoleElement" :url :is-console-available="isConsoleAvailable" />
<template #actions>
<VtsActionsConsole
:open-in-new-tab="openInNewTab"
Expand Down
6 changes: 1 addition & 5 deletions @xen-orchestra/lite/src/views/vm/VmConsoleView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@
<UiStatusPanel v-else-if="!isVmRunning" :image-source="monitor" :title="$t('power-on-vm-for-console')" />
<template v-else-if="vm && vmConsole">
<VtsLayoutConsole>
<VtsRemoteConsole v-if="url" ref="consoleElement" :url :is-console-available="isConsoleAvailable" :location="vmConsole.location" class="remote-console"
@focus="focused = true"
@blur="focused = false"
/>
<VtsRemoteConsole v-if="url" ref="consoleElement" :url :is-console-available="isConsoleAvailable" />
<template #actions>
<VtsActionsConsole
:open-in-new-tab="openInNewTab"
Expand Down Expand Up @@ -105,7 +102,6 @@ const isConsoleAvailable = computed(() =>
)
const consoleElement = ref()
const focused = ref(false)
const sendCtrlAltDel = () => consoleElement.value?.sendCtrlAltDel()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ async function createVncConnection() {
vncClient.addEventListener('disconnect', handleDisconnectionEvent)
vncClient.addEventListener('connect', handleConnectionEvent)
const canvas = consoleContainer.value?.querySelector('canvas') as HTMLCanvasElement | null
if (canvas) {
if (canvas !== null) {
canvas.addEventListener('focus', () => {
canvas.classList.add('focused')
})
Expand Down
8 changes: 3 additions & 5 deletions @xen-orchestra/web/src/pages/host/[id]/console.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<p v-if="!isHostConsoleRunning" class="typo h5-medium">{{ $t('power-on-host-for-console') }}</p>
<VtsLayoutConsole v-else :focused>
<VtsRemoteConsole :url :is-console-available="isHostConsoleAvailable" @focus="focused = true" @blur="focused = false" />
<VtsLayoutConsole v-else>
<VtsRemoteConsole :url :is-console-available="isHostConsoleAvailable" />
<template #actions>
<VtsActionsConsole />
<VtsDivider type="stretch" />
Expand All @@ -18,7 +18,7 @@ import VtsClipboardConsole from '@core/components/console/VtsClipboardConsole.vu
import VtsLayoutConsole from '@core/components/console/VtsLayoutConsole.vue'
import VtsRemoteConsole from '@core/components/console/VtsRemoteConsole.vue'
import VtsDivider from '@core/components/divider/VtsDivider.vue'
import { computed, ref } from 'vue'
import { computed } from 'vue'
const props = defineProps<{
host: XoHost
Expand All @@ -28,8 +28,6 @@ const { isHostOperationPending } = useHostStore().subscribe()
const STOP_OPERATIONS = [HOST_OPERATION.SHUTDOWN, HOST_OPERATION.REBOOT]
const focused = ref(false)
const url = computed(
() => new URL(`/api/consoles/${props.host.controlDomain}`, window.location.origin.replace(/^http/, 'ws'))
)
Expand Down
8 changes: 3 additions & 5 deletions @xen-orchestra/web/src/pages/vm/[id]/console.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<p v-if="!isVmConsoleRunning" class="typo h5-medium">{{ $t('power-on-vm-for-console') }}</p>
<VtsLayoutConsole v-else :focused>
<VtsRemoteConsole :url :is-console-available="isConsoleAvailable" @focus="focused = true" @blur="focused = false" />
<VtsLayoutConsole v-else>
<VtsRemoteConsole :url :is-console-available="isConsoleAvailable" />
<template #actions>
<VtsActionsConsole />
<VtsDivider type="stretch" />
Expand All @@ -19,7 +19,7 @@ import VtsClipboardConsole from '@core/components/console/VtsClipboardConsole.vu
import VtsLayoutConsole from '@core/components/console/VtsLayoutConsole.vue'
import VtsRemoteConsole from '@core/components/console/VtsRemoteConsole.vue'
import VtsDivider from '@core/components/divider/VtsDivider.vue'
import { computed, ref } from 'vue'
import { computed } from 'vue'
const props = defineProps<{
vm: XoVm
Expand All @@ -37,8 +37,6 @@ const STOP_OPERATIONS = [
VM_OPERATION.SUSPEND,
]
const focused = ref(false)
const url = computed(() => new URL(`/api/consoles/${props.vm.id}`, window.location.origin.replace(/^http/, 'ws')))
const isVmConsoleRunning = computed(() => props.vm.power_state === 'Running' && props.vm.other.disable_pv_vnc !== '1')
Expand Down

0 comments on commit 3652351

Please sign in to comment.