-
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
- Loading branch information
Showing
15 changed files
with
190 additions
and
79 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
58 changes: 58 additions & 0 deletions
58
@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,58 @@ | ||
<template> | ||
<UiCardTitle>{{ $t('console-actions') }}</UiCardTitle> | ||
<UiButton | ||
v-tooltip="openInNewTab === undefined ? $t('coming-soon') : undefined" | ||
:disabled="openInNewTab === undefined" | ||
accent="info" | ||
variant="tertiary" | ||
size="medium" | ||
:left-icon="faArrowUpRightFromSquare" | ||
@click="openInNewTab" | ||
> | ||
{{ $t('open-console-in-new-tab') }} | ||
</UiButton> | ||
<UiButton | ||
v-tooltip="toggleFullScreen === undefined ? $t('coming-soon') : undefined" | ||
:disabled="toggleFullScreen === undefined" | ||
accent="info" | ||
variant="tertiary" | ||
size="medium" | ||
:left-icon="faUpRightAndDownLeftFromCenter" | ||
@click="toggleFullScreen" | ||
> | ||
{{ $t('fullscreen') }} | ||
</UiButton> | ||
<UiButton | ||
v-tooltip="sendCtrlAltDel === undefined ? $t('coming-soon') : undefined" | ||
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, faKeyboard, faUpRightAndDownLeftFromCenter } from '@fortawesome/free-solid-svg-icons' | ||
// temporary undefined for xo6 | ||
defineProps<{ | ||
openInNewTab?: () => void | ||
toggleFullScreen?: () => void | ||
sendCtrlAltDel?: () => void | ||
}>() | ||
</script> | ||
|
||
<style lang="postcss" scoped> | ||
.ui-button { | ||
align-self: start; | ||
gap: 0.8rem; | ||
text-align: left; | ||
} | ||
</style> |
37 changes: 37 additions & 0 deletions
37
@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,37 @@ | ||
<template> | ||
<div class="vts-clipboard-console"> | ||
<UiCardTitle>{{ $t('console-clipboard') }}</UiCardTitle> | ||
<UiTextarea accent="info" :model-value="modelValue" /> | ||
<div class="btn"> | ||
<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%; | ||
} | ||
.btn { | ||
display: flex; | ||
gap: 0.8rem; | ||
} | ||
</style> |
38 changes: 38 additions & 0 deletions
38
@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,38 @@ | ||
<template> | ||
<div :class="uiStore.isMobile ? 'mobile' : undefined" class="vts-layout-console"> | ||
<slot /> | ||
<UiCard> | ||
<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; | ||
padding: 0.8rem; | ||
&.mobile { | ||
flex-direction: column; | ||
} | ||
} | ||
.ui-card { | ||
height: fit-content; | ||
gap: 1.6rem; | ||
padding: 1.6rem; | ||
width: 43rem; | ||
} | ||
</style> |
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
Oops, something went wrong.