-
Notifications
You must be signed in to change notification settings - Fork 265
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(web-stack): implement actions and clipboard for VM console (#8125)
- Loading branch information
Showing
18 changed files
with
242 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
67 changes: 67 additions & 0 deletions
67
@xen-orchestra/web-core/lib/components/console/VtsActionsConsole.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
<template> | ||
<UiCardTitle>{{ $t('console-actions') }}</UiCardTitle> | ||
<UiButton | ||
v-tooltip="toggleFullScreen === undefined ? $t('coming-soon') : undefined" | ||
class="button" | ||
:disabled="toggleFullScreen === undefined" | ||
accent="info" | ||
variant="tertiary" | ||
size="medium" | ||
:left-icon="isFullscreen ? faDownLeftAndUpRightToCenter : faUpRightAndDownLeftFromCenter" | ||
@click="toggleFullScreen" | ||
> | ||
{{ $t(isFullscreen ? 'exit-fullscreen' : 'fullscreen') }} | ||
</UiButton> | ||
<UiButton | ||
v-tooltip="openInNewTab === undefined ? $t('coming-soon') : undefined" | ||
class="button" | ||
:disabled="openInNewTab === undefined" | ||
accent="info" | ||
variant="tertiary" | ||
size="medium" | ||
:left-icon="faArrowUpRightFromSquare" | ||
@click="openInNewTab" | ||
> | ||
{{ $t('open-console-in-new-tab') }} | ||
</UiButton> | ||
<UiButton | ||
v-tooltip="sendCtrlAltDel === undefined ? $t('coming-soon') : undefined" | ||
class="button" | ||
accent="info" | ||
variant="tertiary" | ||
size="medium" | ||
:disabled="sendCtrlAltDel === undefined" | ||
:left-icon="faKeyboard" | ||
@click="sendCtrlAltDel" | ||
> | ||
{{ $t('send-ctrl-alt-del') }} | ||
</UiButton> | ||
</template> | ||
|
||
<script lang="ts" setup> | ||
import UiButton from '@core/components/ui/button/UiButton.vue' | ||
import UiCardTitle from '@core/components/ui/card-title/UiCardTitle.vue' | ||
import { vTooltip } from '@core/directives/tooltip.directive' | ||
import { | ||
faArrowUpRightFromSquare, | ||
faDownLeftAndUpRightToCenter, | ||
faKeyboard, | ||
faUpRightAndDownLeftFromCenter, | ||
} from '@fortawesome/free-solid-svg-icons' | ||
// temporary undefined for xo6 | ||
defineProps<{ | ||
openInNewTab?: () => void | ||
toggleFullScreen?: () => void | ||
sendCtrlAltDel?: () => void | ||
isFullscreen?: boolean | ||
}>() | ||
</script> | ||
|
||
<style lang="postcss" scoped> | ||
.button { | ||
align-self: start; | ||
gap: 0.8rem; | ||
text-align: left; | ||
} | ||
</style> |
38 changes: 38 additions & 0 deletions
38
@xen-orchestra/web-core/lib/components/console/VtsClipboardConsole.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<template> | ||
<div class="vts-clipboard-console"> | ||
<UiCardTitle>{{ $t('console-clipboard') }}</UiCardTitle> | ||
<UiTextarea v-tooltip="$t('coming-soon')" accent="info" disabled :model-value="modelValue" /> | ||
<div class="buttons-container"> | ||
<UiButton v-tooltip="$t('coming-soon')" accent="info" variant="primary" size="medium" disabled> | ||
{{ $t('send') }} | ||
</UiButton> | ||
<UiButton v-tooltip="$t('coming-soon')" accent="info" variant="secondary" size="medium" disabled> | ||
{{ $t('receive') }} | ||
</UiButton> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import UiButton from '@core/components/ui/button/UiButton.vue' | ||
import UiCardTitle from '@core/components/ui/card-title/UiCardTitle.vue' | ||
import UiTextarea from '@core/components/ui/input/UiTextarea.vue' | ||
import { vTooltip } from '@core/directives/tooltip.directive' | ||
import { ref } from 'vue' | ||
const modelValue = ref('') | ||
</script> | ||
|
||
<style lang="postcss" scoped> | ||
.vts-clipboard-console { | ||
display: flex; | ||
flex-direction: column; | ||
gap: 0.8rem; | ||
width: 100%; | ||
.buttons-container { | ||
display: flex; | ||
gap: 0.8rem; | ||
} | ||
} | ||
</style> |
40 changes: 40 additions & 0 deletions
40
@xen-orchestra/web-core/lib/components/console/VtsLayoutConsole.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<template> | ||
<div :class="uiStore.isMobile ? 'mobile' : undefined" class="vts-layout-console"> | ||
<slot /> | ||
<UiCard class="card"> | ||
<slot name="actions" /> | ||
</UiCard> | ||
</div> | ||
</template> | ||
|
||
<script lang="ts" setup> | ||
import UiCard from '@core/components/ui/card/UiCard.vue' | ||
import { useUiStore } from '@core/stores/ui.store' | ||
defineSlots<{ | ||
default(): any | ||
actions(): any | ||
}>() | ||
const uiStore = useUiStore() | ||
</script> | ||
|
||
<style lang="postcss" scoped> | ||
.vts-layout-console { | ||
display: flex; | ||
gap: 2.4rem; | ||
height: 100%; | ||
padding: 0.8rem; | ||
&.mobile { | ||
flex-direction: column; | ||
} | ||
.card { | ||
height: fit-content; | ||
gap: 1.6rem; | ||
padding: 1.6rem; | ||
width: 43rem; | ||
} | ||
} | ||
</style> |
Oops, something went wrong.