bfg-common 1.4.532 → 1.4.534

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (129) hide show
  1. package/assets/img/icons/icons-sprite-dark-1.svg +407 -407
  2. package/assets/img/icons/icons-sprite-dark-2.svg +343 -343
  3. package/assets/img/icons/icons-sprite-dark-3.svg +227 -227
  4. package/assets/img/icons/icons-sprite-dark-4.svg +255 -255
  5. package/assets/img/icons/icons-sprite-dark-5.svg +488 -488
  6. package/assets/img/icons/icons-sprite-dark-6.svg +94 -94
  7. package/assets/img/icons/icons-sprite-light-1.svg +407 -407
  8. package/assets/img/icons/icons-sprite-light-2.svg +343 -343
  9. package/assets/img/icons/icons-sprite-light-3.svg +227 -227
  10. package/assets/img/icons/icons-sprite-light-4.svg +255 -255
  11. package/assets/img/icons/icons-sprite-light-5.svg +488 -488
  12. package/assets/img/icons/icons-sprite-light-6.svg +94 -94
  13. package/assets/localization/local_be.json +3 -1
  14. package/assets/localization/local_en.json +3 -1
  15. package/assets/localization/local_hy.json +3 -1
  16. package/assets/localization/local_kk.json +3 -1
  17. package/assets/localization/local_ru.json +3 -1
  18. package/assets/localization/local_zh.json +3 -1
  19. package/components/atoms/TheIcon3.vue +50 -50
  20. package/components/atoms/modal/bySteps/BySteps.vue +253 -253
  21. package/components/atoms/stack/StackBlock.vue +185 -185
  22. package/components/atoms/table/dataGrid/DataGrid.vue +1633 -1633
  23. package/components/atoms/table/dataGrid/DataGridColumnSwitch.vue +222 -222
  24. package/components/common/browse/blocks/lib/models/types.ts +1 -1
  25. package/components/common/browse/lib/models/interfaces.ts +5 -5
  26. package/components/common/context/lib/models/interfaces.ts +30 -30
  27. package/components/common/context/recursion/Recursion.vue +86 -86
  28. package/components/common/context/recursion/RecursionNew.vue +199 -199
  29. package/components/common/context/recursion/RecursionOld.vue +213 -213
  30. package/components/common/diagramMain/Header.vue +211 -211
  31. package/components/common/diagramMain/adapter/AdapterItems.vue +61 -61
  32. package/components/common/diagramMain/lib/config/initial.ts +50 -50
  33. package/components/common/diagramMain/lib/models/enums.ts +44 -44
  34. package/components/common/diagramMain/lib/models/types.ts +21 -21
  35. package/components/common/diagramMain/lib/utils/utils.ts +331 -331
  36. package/components/common/diagramMain/modals/ManagePhysicalAdaptersModal.vue +330 -330
  37. package/components/common/diagramMain/modals/editSettings/ConfirmTeamingSettingsModal.vue +40 -40
  38. package/components/common/diagramMain/modals/editSettings/EditSettings.vue +497 -497
  39. package/components/common/diagramMain/modals/editSettings/EditSettingsModal.vue +812 -812
  40. package/components/common/diagramMain/modals/editSettings/tabs/NetworkProperties.vue +214 -214
  41. package/components/common/diagramMain/modals/editSettings/tabs/Security.vue +189 -189
  42. package/components/common/diagramMain/modals/editSettings/tabs/SwitchProperties.vue +163 -163
  43. package/components/common/diagramMain/modals/editSettings/tabs/TeamingFailover.vue +175 -175
  44. package/components/common/diagramMain/modals/editSettings/tabs/TrafficShaping.vue +398 -398
  45. package/components/common/diagramMain/modals/editSettings/tabs/port/IpvFourSettings.vue +346 -346
  46. package/components/common/diagramMain/modals/editSettings/tabs/port/PortProperties.vue +205 -205
  47. package/components/common/diagramMain/modals/lib/config/diagramConfig.ts +23 -23
  48. package/components/common/diagramMain/modals/lib/config/initial.ts +180 -180
  49. package/components/common/diagramMain/modals/lib/config/vmKernelAdapter.ts +90 -90
  50. package/components/common/diagramMain/modals/lib/mappers/mappers.ts +87 -87
  51. package/components/common/diagramMain/modals/lib/utils/index.ts +24 -24
  52. package/components/common/diagramMain/modals/migrateVmkernelAdapter/MigrateVmkernelAdapter.vue +537 -537
  53. package/components/common/diagramMain/modals/migrateVmkernelAdapter/lib/config/steps.ts +114 -114
  54. package/components/common/diagramMain/modals/migrateVmkernelAdapter/steps/ConnectionSettings.vue +169 -169
  55. package/components/common/diagramMain/modals/migrateVmkernelAdapter/steps/SelectVmkernelAdapter.vue +159 -159
  56. package/components/common/diagramMain/modals/migrateVmkernelAdapter/validations/common.ts +14 -14
  57. package/components/common/diagramMain/modals/migrateVmkernelAdapter/validations/connectionSettings.ts +137 -137
  58. package/components/common/diagramMain/modals/migrateVmkernelAdapter/validations/selectVmkernelAdapter.ts +52 -52
  59. package/components/common/diagramMain/modals/migrateVmkernelAdapter/validations/validations.ts +19 -19
  60. package/components/common/diagramMain/port/Ports.vue +47 -47
  61. package/components/common/layout/theHeader/helpMenu/About.vue +85 -85
  62. package/components/common/layout/theHeader/helpMenu/aboutNew/AboutNew.vue +103 -103
  63. package/components/common/mainNavigationPanel/MainNavigationPanel.vue +152 -152
  64. package/components/common/modals/confirmation/Confirmation.vue +70 -70
  65. package/components/common/spiceConsole/Drawer.vue +299 -273
  66. package/components/common/vm/actions/add/Add.vue +617 -617
  67. package/components/common/vm/actions/clone/lib/config/steps.ts +129 -129
  68. package/components/common/vm/actions/common/customizeHardware/CustomizeHardware.vue +267 -267
  69. package/components/common/vm/actions/common/customizeHardware/CustomizeHardwareNew.vue +264 -264
  70. package/components/common/vm/actions/common/customizeHardware/virtualHardware/bus/BusNew.vue +118 -118
  71. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cdDvdDrive/CdDvdDriveNew.vue +163 -163
  72. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cdDvdDrive/media/Media.vue +25 -25
  73. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cdDvdDrive/media/MediaNew.vue +55 -55
  74. package/components/common/vm/actions/common/customizeHardware/virtualHardware/lib/config/dropdownItems.ts +147 -147
  75. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/sharing/SharingNew.vue +44 -44
  76. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newNetwork/NewNetworkNew.vue +124 -124
  77. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newNetwork/location/LocationOld.vue +134 -134
  78. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newNetwork/location/new/New.vue +63 -63
  79. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newNetwork/location/new/table/Table.vue +74 -74
  80. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newNetwork/location/new/table/lib/config/config.ts +95 -95
  81. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newNetwork/macAddress/MacAddress.vue +119 -119
  82. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newNetwork/macAddress/MacAddressNew.vue +69 -69
  83. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newNetwork/macAddress/MacAddressOld.vue +83 -83
  84. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/NewPciDeviceNew.vue +85 -85
  85. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/NewPciDeviceOld.vue +91 -91
  86. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/directPathIo/DirectPathIoNew.vue +35 -35
  87. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/dynamicDirectPathIo/DynamicDirectPathIoNew.vue +48 -48
  88. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/note/Note.vue +15 -15
  89. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/note/NoteNew.vue +42 -42
  90. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/note/NoteOld.vue +30 -30
  91. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/nvidiaGrid/NvidiaGridNew.vue +30 -30
  92. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/typeSelection/TypeSelectionNew.vue +46 -46
  93. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newUsbController/NewUsbControllerNew.vue +56 -56
  94. package/components/common/vm/actions/common/customizeHardware/virtualHardware/other/Other.vue +16 -16
  95. package/components/common/vm/actions/common/customizeHardware/virtualHardware/other/OtherNew.vue +27 -27
  96. package/components/common/vm/actions/common/customizeHardware/virtualHardware/videoCard/totalVideoMemory/TotalVideoMemoryNew.vue +54 -54
  97. package/components/common/vm/actions/common/customizeHardware/vmoptions/Vmoptions.vue +145 -145
  98. package/components/common/vm/actions/common/customizeHardware/vmoptions/VmoptionsNew.vue +102 -102
  99. package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/BootOptionsNew.vue +75 -75
  100. package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/delay/Delay.vue +26 -26
  101. package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/firmware/Firmware.vue +57 -57
  102. package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/firmware/FirmwareNew.vue +42 -42
  103. package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/menu/MenuNew.vue +25 -25
  104. package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/order/Order.vue +171 -171
  105. package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/order/OrderNew.vue +50 -50
  106. package/components/common/vm/actions/common/customizeHardware/vmoptions/generalOptions/GeneralOptionsNew.vue +141 -141
  107. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/New.vue +140 -140
  108. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/copyPaste/CopyPasteNew.vue +30 -30
  109. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/fileTransfer/FileTransferNew.vue +30 -30
  110. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/folderSharing/FolderSharingNew.vue +30 -30
  111. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/keymap/Keymap.vue +32 -32
  112. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/keymap/KeymapNew.vue +39 -39
  113. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/password/PasswordNew.vue +100 -100
  114. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/usbRedirection/UsbRedirectionNew.vue +38 -38
  115. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/usbRedirection/UsbRedirectionOld.vue +44 -44
  116. package/components/common/vm/actions/common/select/storage/Storage.vue +130 -130
  117. package/components/common/vm/actions/common/select/storage/StorageOld.vue +129 -129
  118. package/components/common/vm/actions/common/select/storage/new/New.vue +159 -159
  119. package/components/common/vm/actions/editSettings/EditSettings.vue +214 -214
  120. package/components/common/vm/actions/editSettings/EditSettingsOld.vue +182 -182
  121. package/components/common/wizards/network/add/lib/config/steps.ts +464 -464
  122. package/composables/productNameLocal.ts +30 -30
  123. package/package.json +1 -1
  124. package/plugins/date.ts +233 -233
  125. package/plugins/recursion.ts +311 -311
  126. package/public/spice-console/lib/images/bitmap.js +203 -203
  127. package/public/spice-console/network/spicechannel.js +383 -383
  128. package/store/main/mutations.ts +7 -7
  129. package/store/main/state.ts +7 -7
@@ -1,273 +1,299 @@
1
- <template>
2
- <div
3
- :class="['vmw-drawer animation', { show: isShow }]"
4
- data-id="spice-console-drawer"
5
- @click.capture="onInputManagerFocus"
6
- >
7
- <div
8
- v-if="!isShow"
9
- ref="grab"
10
- data-id="spice-console-drawer-toggle"
11
- class="vmw-drawer__open"
12
- :style="`top: ${y}px;`"
13
- @click="toggleDrawer"
14
- >
15
- <atoms-the-icon name="arrow" class="vmw-drawer__open-icon" />
16
- <atoms-the-icon2 name="drag" class="vmw-drawer__drag-icon" />
17
- </div>
18
-
19
- <div class="vmw-drawer-header">
20
- <h3>{{ localization.common.consolePanel }}</h3>
21
- <atoms-the-icon
22
- class="vmw-drawer-header__close"
23
- data-id="spice-console-drawer-toggle-icon"
24
- name="close"
25
- @click="toggleDrawer"
26
- />
27
- </div>
28
-
29
- <div class="vmw-drawer-body">
30
- <div
31
- class="vmw-drawer-body__btn animation toggle-fullscreen"
32
- data-id="spice-console-drawer-toggle-fullscreen"
33
- @click="emits('toggle-fullscreen')"
34
- >
35
- {{ localization.common.toggleFullscreenMode }}
36
- </div>
37
- <div
38
- class="vmw-drawer-body__btn animation toggle-fullscreen"
39
- @click="emits('send-alt-command')"
40
- >
41
- {{ localization.common.sendAltCommand }}
42
- </div>
43
-
44
- <select
45
- v-model="codec"
46
- @mouseenter="hover = true"
47
- @mouseleave="hover = false"
48
- @change="onChangeCodec"
49
- >
50
- <option :value="1">MJPEG</option>
51
- <option :value="2">VP8</option>
52
- <option :value="3">H264</option>
53
- <option :value="4" disabled>VP9</option>
54
- <option :value="5">H265</option>
55
- </select>
56
-
57
- <hr />
58
- <div
59
- class="vmw-drawer-body__btn animation show-keyboard"
60
- @click="onToggleKeyboard"
61
- >
62
- {{ showOrHideKeyboard }}
63
- </div>
64
- </div>
65
-
66
- <div class="vmw-drawer-footer">
67
- <div class="size-info">
68
- <p class="size-info-text">View size: {{viewSize}}</p>
69
- <p class="size-info-text">Canvas size: {{canvasSize}}</p>
70
- </div>
71
- <div id="debug-stream"></div>
72
- </div>
73
- <div v-if="isKeyboardShown">
74
- <common-spice-console-keyboard />
75
- </div>
76
- </div>
77
- </template>
78
- <script setup lang="ts">
79
- import { useDraggable } from '@vueuse/core'
80
- import type { UI_I_Localization } from '~/lib/models/interfaces'
81
- import type { UI_T_CODEC } from '~/components/common/spiceConsole/lib/models/types'
82
-
83
- const emits = defineEmits<{
84
- (event: 'toggle-fullscreen'): void
85
- (event: 'send-alt-command'): void
86
- }>()
87
-
88
- const codec = ref<UI_T_CODEC>(1)
89
- const onChangeCodec = (): void => {
90
- // @ts-ignore
91
- if (!window.app) return
92
- // @ts-ignore
93
- const channels = window.app.spiceConnection.channels
94
- for (let i in channels) {
95
- const channel = channels[i]
96
- if (channel.channel === wdi.SpiceVars.SPICE_CHANNEL_DISPLAY) {
97
- channel.changeCodec(codec.value)
98
- }
99
- }
100
- document.getElementById('inputmanager')?.focus()
101
- }
102
-
103
- const isKeyboardShown = ref<boolean>(false)
104
- const onToggleKeyboard = (): void => {
105
- isKeyboardShown.value = !isKeyboardShown.value
106
- }
107
-
108
- const isShow = ref<boolean>(false)
109
- const grab = ref<HTMLDivElement | null>(null)
110
- const localization = computed<UI_I_Localization>(() => useLocal())
111
- const initialTop = window.innerHeight / 2 - 15
112
- const { y } = useDraggable(grab, {
113
- initialValue: { x: -30, y: initialTop },
114
- })
115
-
116
- const showOrHideKeyboard = computed<string>(() =>
117
- isKeyboardShown.value
118
- ? localization.value.common.hideKeyboard
119
- : localization.value.common.showKeyboard
120
- )
121
-
122
- watch(y, () => {
123
- isDrag = true
124
- })
125
-
126
- let isDrag = false
127
- const toggleDrawer = () => {
128
- if (isDrag) {
129
- isDrag = false
130
- return
131
- }
132
- isShow.value = !isShow.value
133
- }
134
-
135
- const hover = ref<boolean>(false)
136
- const onInputManagerFocus = (): void => {
137
- if (hover.value) return
138
- document.getElementById('inputmanager')?.focus()
139
- }
140
-
141
- const viewSize = ref<string>('0 x 0')
142
- const canvasSize = ref<string>('0 x 0')
143
- const displaySizeInfo = (): void => {
144
- const layout = document.getElementById('eventLayer')
145
- viewSize.value = `${window.innerWidth}px x ${window.innerHeight}px`
146
- if (layout) {
147
- canvasSize.value = `${layout.width || 0}px x ${layout.height || 0}px`
148
- }
149
-
150
- requestAnimationFrame(displaySizeInfo)
151
- }
152
- displaySizeInfo()
153
-
154
- </script>
155
- <style lang="scss" scoped>
156
- .vmw-drawer {
157
- background-color: #314351;
158
- position: absolute;
159
- top: 0;
160
- right: -300px;
161
- width: 300px;
162
- height: 100vh;
163
- padding: 20px;
164
-
165
- &.show {
166
- right: 0;
167
-
168
- .vmw-drawer__open {
169
- z-index: -1;
170
- }
171
- }
172
-
173
- &__open {
174
- width: 65px;
175
- height: 40px;
176
- background-color: #314351;
177
- position: absolute;
178
- left: -30px;
179
- cursor: pointer;
180
- border-top-left-radius: 20px;
181
- border-bottom-left-radius: 20px;
182
- box-shadow: 0 0 15px 5px #31435169;
183
- transition: left 0.5s;
184
- user-select: none;
185
-
186
- &.moving {
187
- cursor: grabbing;
188
- }
189
-
190
- &:hover {
191
- left: -60px;
192
- }
193
-
194
- & .vmw-drawer__open-icon {
195
- fill: #ffffff;
196
- transform: rotate(-90deg);
197
- width: 30px;
198
- height: 40px;
199
- z-index: 2222222222222222;
200
- }
201
-
202
- & .vmw-drawer__drag-icon {
203
- fill: #ffffff;
204
- width: 40px;
205
- position: absolute;
206
- left: 21px;
207
- z-index: 1;
208
- cursor: grabbing;
209
- }
210
- }
211
-
212
- .vmw-drawer-header {
213
- & h3 {
214
- color: #fff;
215
- font-weight: bold;
216
- font-size: 20px;
217
- text-align: center;
218
- }
219
-
220
- &__close {
221
- width: 30px;
222
- fill: #fff;
223
- position: absolute;
224
- right: 10px;
225
- top: 10px;
226
- cursor: pointer;
227
- }
228
- }
229
-
230
- .vmw-drawer-body {
231
- margin-top: 50px;
232
-
233
- & select,
234
- &__btn {
235
- width: 100%;
236
- color: #fff;
237
- cursor: pointer;
238
- font-size: 15px;
239
- border: 1px solid #fff;
240
- padding: 5px;
241
- border-radius: 5px;
242
- text-align: center;
243
- margin-bottom: 20px;
244
-
245
- &:not(.disable):hover {
246
- background-color: #ffffff;
247
- color: #314351;
248
- }
249
-
250
- &.disable {
251
- opacity: 0.5;
252
- cursor: not-allowed;
253
- }
254
- }
255
-
256
- & > hr {
257
- margin-bottom: 20px;
258
- border-color: #ffffff40;
259
- box-shadow: 0 0 20px 0.5px #ffffff2e;
260
- }
261
- }
262
-
263
- .vmw-drawer-footer {
264
- .size-info {
265
- margin-bottom: 10px;
266
-
267
- .size-info-text {
268
- color: #ffffff;
269
- }
270
- }
271
- }
272
- }
273
- </style>
1
+ <template>
2
+ <div
3
+ :class="['vmw-drawer animation', { show: isShow }]"
4
+ data-id="spice-console-drawer"
5
+ @click.capture="onInputManagerFocus"
6
+ >
7
+ <div
8
+ v-if="!isShow"
9
+ ref="grab"
10
+ data-id="spice-console-drawer-toggle"
11
+ class="vmw-drawer__open"
12
+ :style="`top: ${y}px;`"
13
+ @click="toggleDrawer"
14
+ >
15
+ <atoms-the-icon name="arrow" class="vmw-drawer__open-icon" />
16
+ <atoms-the-icon2 name="drag" class="vmw-drawer__drag-icon" />
17
+ </div>
18
+
19
+ <div class="vmw-drawer-header">
20
+ <h3>{{ localization.common.consolePanel }}</h3>
21
+ <atoms-the-icon
22
+ class="vmw-drawer-header__close"
23
+ data-id="spice-console-drawer-toggle-icon"
24
+ name="close"
25
+ @click="toggleDrawer"
26
+ />
27
+ </div>
28
+
29
+ <div class="vmw-drawer-body">
30
+ <button
31
+ class="vmw-drawer-body__btn animation toggle-fullscreen"
32
+ data-id="spice-console-drawer-toggle-fullscreen"
33
+ @click="emits('toggle-fullscreen')"
34
+ >
35
+ {{ localization.common.toggleFullscreenMode }}
36
+ </button>
37
+ <button
38
+ class="vmw-drawer-body__btn animation toggle-fullscreen"
39
+ @click="emits('send-alt-command')"
40
+ >
41
+ {{ localization.common.sendAltCommand }}
42
+ </button>
43
+ <label
44
+ for="upload-folder"
45
+ class="vmw-drawer-body__btn animation toggle-fullscreen"
46
+ >
47
+ {{ localization.remoteConsole.uploadFolder }}
48
+ </label>
49
+ <input
50
+ id="upload-folder"
51
+ type="file"
52
+ webkitdirectory
53
+ directory
54
+ multiple
55
+ />
56
+
57
+ <label
58
+ for="upload-files"
59
+ class="vmw-drawer-body__btn animation toggle-fullscreen"
60
+ >
61
+ {{ localization.remoteConsole.uploadFiles }}
62
+ </label>
63
+ <input id="upload-files" type="file" multiple />
64
+
65
+ <select
66
+ v-model="codec"
67
+ @mouseenter="hover = true"
68
+ @mouseleave="hover = false"
69
+ @change="onChangeCodec"
70
+ >
71
+ <option :value="1">MJPEG</option>
72
+ <option :value="2">VP8</option>
73
+ <option :value="3">H264</option>
74
+ <option :value="4" disabled>VP9</option>
75
+ <option :value="5">H265</option>
76
+ </select>
77
+
78
+ <hr />
79
+ <button
80
+ class="vmw-drawer-body__btn animation show-keyboard"
81
+ @click="onToggleKeyboard"
82
+ >
83
+ {{ showOrHideKeyboard }}
84
+ </button>
85
+ </div>
86
+
87
+ <div class="vmw-drawer-footer">
88
+ <div class="size-info">
89
+ <p class="size-info-text">View size: {{ viewSize }}</p>
90
+ <p class="size-info-text">Canvas size: {{ canvasSize }}</p>
91
+ </div>
92
+ <div id="debug-stream"></div>
93
+ </div>
94
+ <div v-if="isKeyboardShown">
95
+ <common-spice-console-keyboard />
96
+ </div>
97
+ </div>
98
+ </template>
99
+ <script setup lang="ts">
100
+ import { useDraggable } from '@vueuse/core'
101
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
102
+ import type { UI_T_CODEC } from '~/components/common/spiceConsole/lib/models/types'
103
+
104
+ const emits = defineEmits<{
105
+ (event: 'toggle-fullscreen'): void
106
+ (event: 'send-alt-command'): void
107
+ }>()
108
+
109
+ const codec = ref<UI_T_CODEC>(1)
110
+ const onChangeCodec = (): void => {
111
+ // @ts-ignore
112
+ if (!window.app) return
113
+ // @ts-ignore
114
+ const channels = window.app.spiceConnection.channels
115
+ for (let i in channels) {
116
+ const channel = channels[i]
117
+ if (channel.channel === wdi.SpiceVars.SPICE_CHANNEL_DISPLAY) {
118
+ channel.changeCodec(codec.value)
119
+ }
120
+ }
121
+ document.getElementById('inputmanager')?.focus()
122
+ }
123
+
124
+ const isKeyboardShown = ref<boolean>(false)
125
+ const onToggleKeyboard = (): void => {
126
+ isKeyboardShown.value = !isKeyboardShown.value
127
+ }
128
+
129
+ const isShow = ref<boolean>(false)
130
+ const grab = ref<HTMLDivElement | null>(null)
131
+ const localization = computed<UI_I_Localization>(() => useLocal())
132
+ const initialTop = window.innerHeight / 2 - 15
133
+ const { y } = useDraggable(grab, {
134
+ initialValue: { x: -30, y: initialTop },
135
+ })
136
+
137
+ const showOrHideKeyboard = computed<string>(() =>
138
+ isKeyboardShown.value
139
+ ? localization.value.common.hideKeyboard
140
+ : localization.value.common.showKeyboard
141
+ )
142
+
143
+ watch(y, () => {
144
+ isDrag = true
145
+ })
146
+
147
+ let isDrag = false
148
+ const toggleDrawer = () => {
149
+ if (isDrag) {
150
+ isDrag = false
151
+ return
152
+ }
153
+ isShow.value = !isShow.value
154
+ }
155
+
156
+ const hover = ref<boolean>(false)
157
+ const onInputManagerFocus = (): void => {
158
+ if (hover.value) return
159
+ document.getElementById('inputmanager')?.focus()
160
+ }
161
+
162
+ const viewSize = ref<string>('0 x 0')
163
+ const canvasSize = ref<string>('0 x 0')
164
+ const displaySizeInfo = (): void => {
165
+ const layout = document.getElementById('eventLayer')
166
+ viewSize.value = `${window.innerWidth}px x ${window.innerHeight}px`
167
+ if (layout) {
168
+ canvasSize.value = `${layout.width || 0}px x ${layout.height || 0}px`
169
+ }
170
+
171
+ requestAnimationFrame(displaySizeInfo)
172
+ }
173
+ displaySizeInfo()
174
+ </script>
175
+ <style lang="scss" scoped>
176
+ .vmw-drawer {
177
+ background-color: #314351;
178
+ position: absolute;
179
+ top: 0;
180
+ right: -300px;
181
+ width: 300px;
182
+ height: 100vh;
183
+ padding: 20px;
184
+
185
+ &.show {
186
+ right: 0;
187
+
188
+ .vmw-drawer__open {
189
+ z-index: -1;
190
+ }
191
+ }
192
+
193
+ &__open {
194
+ width: 65px;
195
+ height: 40px;
196
+ background-color: #314351;
197
+ position: absolute;
198
+ left: -30px;
199
+ cursor: pointer;
200
+ border-top-left-radius: 20px;
201
+ border-bottom-left-radius: 20px;
202
+ box-shadow: 0 0 15px 5px #31435169;
203
+ transition: left 0.5s;
204
+ user-select: none;
205
+
206
+ &.moving {
207
+ cursor: grabbing;
208
+ }
209
+
210
+ &:hover {
211
+ left: -60px;
212
+ }
213
+
214
+ & .vmw-drawer__open-icon {
215
+ fill: #ffffff;
216
+ transform: rotate(-90deg);
217
+ width: 30px;
218
+ height: 40px;
219
+ z-index: 2222222222222222;
220
+ }
221
+
222
+ & .vmw-drawer__drag-icon {
223
+ fill: #ffffff;
224
+ width: 40px;
225
+ position: absolute;
226
+ left: 21px;
227
+ z-index: 1;
228
+ cursor: grabbing;
229
+ }
230
+ }
231
+
232
+ .vmw-drawer-header {
233
+ & h3 {
234
+ color: #fff;
235
+ font-weight: bold;
236
+ font-size: 20px;
237
+ text-align: center;
238
+ }
239
+
240
+ &__close {
241
+ width: 30px;
242
+ fill: #fff;
243
+ position: absolute;
244
+ right: 10px;
245
+ top: 10px;
246
+ cursor: pointer;
247
+ }
248
+ }
249
+
250
+ .vmw-drawer-body {
251
+ margin-top: 50px;
252
+
253
+ & select,
254
+ &__btn {
255
+ display: block;
256
+ width: 100%;
257
+ color: #fff;
258
+ cursor: pointer;
259
+ font-size: 15px;
260
+ border: 1px solid #fff;
261
+ padding: 5px;
262
+ border-radius: 5px;
263
+ text-align: center;
264
+ margin-bottom: 20px;
265
+ background-color: transparent;
266
+
267
+ &:not(.disable):hover {
268
+ background-color: #ffffff;
269
+ color: #314351;
270
+ }
271
+
272
+ &.disable {
273
+ opacity: 0.5;
274
+ cursor: not-allowed;
275
+ }
276
+
277
+ input[type='file'] {
278
+ display: none;
279
+ }
280
+ }
281
+
282
+ & > hr {
283
+ margin-bottom: 20px;
284
+ border-color: #ffffff40;
285
+ box-shadow: 0 0 20px 0.5px #ffffff2e;
286
+ }
287
+ }
288
+
289
+ .vmw-drawer-footer {
290
+ .size-info {
291
+ margin-bottom: 10px;
292
+
293
+ .size-info-text {
294
+ color: #ffffff;
295
+ }
296
+ }
297
+ }
298
+ }
299
+ </style>