bfg-common 1.5.508 → 1.5.510

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 (113) hide show
  1. package/CODE_STYLE.md +109 -109
  2. package/assets/img/icons/icons-sprite-dark-3.svg +227 -227
  3. package/assets/img/icons/icons-sprite-dark-5.svg +488 -488
  4. package/assets/img/icons/icons-sprite-light-3.svg +227 -227
  5. package/assets/img/icons/icons-sprite-light-5.svg +488 -488
  6. package/components/atoms/TheIcon3.vue +50 -50
  7. package/components/atoms/collapse/CollapseNav.vue +170 -170
  8. package/components/atoms/perPage/PerPage.vue +58 -58
  9. package/components/atoms/sortableView/SortableView.vue +528 -0
  10. package/components/atoms/table/dataGrid/DataGridPagination.vue +97 -97
  11. package/components/atoms/table/dataGrid/lib/config/settingsTable.ts +94 -94
  12. package/components/atoms/table/dataGrid/lib/utils/export.ts +16 -16
  13. package/components/common/backup/storage/actions/add/Add.vue +251 -251
  14. package/components/common/backup/storage/actions/add/lib/utils.ts +51 -51
  15. package/components/common/browse/blocks/contents/filesNew/Skeleton.vue +18 -18
  16. package/components/common/browse/blocks/lib/models/types.ts +1 -1
  17. package/components/common/browse/lib/models/interfaces.ts +5 -5
  18. package/components/common/diagramMain/network/Contents.vue +497 -497
  19. package/components/common/layout/theHeader/helpMenu/About.vue +79 -79
  20. package/components/common/layout/theHeader/helpMenu/aboutOld/AboutOld.vue +79 -79
  21. package/components/common/pages/backups/DetailView.vue +52 -52
  22. package/components/common/pages/backups/lib/models/interfaces.ts +36 -36
  23. package/components/common/pages/backups/modals/Modals.vue +243 -243
  24. package/components/common/pages/backups/modals/createBackup/configuration/Configuration.vue +29 -29
  25. package/components/common/pages/backups/modals/createBackup/configuration/maxBandwidth/lib/config/options.ts +6 -6
  26. package/components/common/pages/backups/modals/createBackup/datastores/tableView/TableView.vue +95 -95
  27. package/components/common/pages/backups/modals/createBackup/general/General.vue +141 -141
  28. package/components/common/pages/backups/modals/createBackup/lib/config/strategyOptions.ts +12 -12
  29. package/components/common/pages/backups/modals/lib/config/restore.ts +115 -115
  30. package/components/common/pages/backups/modals/lib/models/interfaces.ts +186 -186
  31. package/components/common/pages/backups/modals/restore/disks/Disks.vue +27 -27
  32. package/components/common/pages/backups/modals/restore/disks/tableView/lib/config/table.ts +117 -117
  33. package/components/common/pages/backups/modals/restore/name/Name.vue +166 -166
  34. package/components/common/pages/backups/modals/restore/name/lib/models/interfaces.ts +6 -6
  35. package/components/common/pages/backups/modals/restore/networks/Networks.vue +67 -67
  36. package/components/common/pages/backups/modals/restore/networks/table/Table.vue +214 -214
  37. package/components/common/pages/backups/modals/restore/types/lib/config/typeOptions.ts +25 -25
  38. package/components/common/pages/home/lib/models/interfaces.ts +48 -48
  39. package/components/common/pages/home/widgets/hosts/Hosts.vue +27 -27
  40. package/components/common/pages/home/widgets/hosts/lib/config/items.ts +23 -23
  41. package/components/common/pages/home/widgets/vms/VmsOld.vue +35 -35
  42. package/components/common/pages/home/widgets/vms/lib/config/items.ts +19 -19
  43. package/components/common/pages/scheduledTasks/lib/utils/utils.ts +84 -84
  44. package/components/common/readyToComplete/ReadyToComplete.vue +17 -17
  45. package/components/common/select/radio/RadioGroup.vue +137 -137
  46. package/components/common/spiceConsole/Drawer.vue +392 -419
  47. package/components/common/spiceConsole/SpiceConsole.vue +184 -184
  48. package/components/common/spiceConsole/lib/models/interfaces.ts +5 -5
  49. package/components/common/spiceConsole/lib/models/types.ts +0 -1
  50. package/components/common/tools/Actions.vue +207 -207
  51. package/components/common/treeView/TreeView.vue +52 -52
  52. package/components/common/vm/actions/add/Add.vue +895 -895
  53. package/components/common/vm/actions/add/New.vue +695 -695
  54. package/components/common/vm/actions/add/Old.vue +414 -414
  55. package/components/common/vm/actions/add/lib/config/steps.ts +347 -347
  56. package/components/common/vm/actions/clone/Clone.vue +863 -863
  57. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/Cpu.vue +368 -368
  58. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/shares/Shares.vue +140 -140
  59. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/shares/lib/config/options.ts +28 -28
  60. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/location/Location.vue +154 -154
  61. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newNetwork/location/new/table/Table.vue +99 -99
  62. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newNetwork/macAddress/MacAddress.vue +119 -119
  63. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/dynamicDirectPathIo/DynamicDirectPathIo.vue +31 -31
  64. package/components/common/vm/actions/common/customizeHardware/virtualHardware/other/Other.vue +16 -16
  65. package/components/common/vm/actions/common/customizeHardware/virtualHardware/videoCard/numberDisplays/NumberDisplays.vue +53 -53
  66. package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/delay/Delay.vue +32 -32
  67. package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/firmware/Firmware.vue +60 -60
  68. package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/order/Order.vue +174 -174
  69. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/keymap/Keymap.vue +32 -32
  70. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/password/Password.vue +103 -103
  71. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/usbRedirection/UsbRedirection.vue +28 -28
  72. package/components/common/vm/actions/common/select/compatibility/Old.vue +107 -107
  73. package/components/common/vm/actions/common/select/computeResource/ComputeResource.vue +143 -143
  74. package/components/common/vm/actions/common/select/computeResource/New.vue +184 -184
  75. package/components/common/vm/actions/common/select/computeResource/treeView/TreeView.vue +131 -131
  76. package/components/common/vm/actions/common/select/createType/CreateType.vue +38 -38
  77. package/components/common/vm/actions/common/select/createType/lib/models/interfaces.ts +5 -5
  78. package/components/common/vm/actions/common/select/os/Old.vue +152 -152
  79. package/components/common/vm/actions/common/select/os/Os.vue +139 -139
  80. package/components/common/vm/actions/common/select/storage/new/New.vue +320 -320
  81. package/components/common/vm/actions/common/select/storage/new/lib/models/interfaces.ts +5 -5
  82. package/components/common/vm/actions/common/select/storage/new/lib/utils/utils.ts +21 -21
  83. package/components/common/vm/actions/common/select/template/old/Old.vue +50 -50
  84. package/components/common/vm/actions/editSettings/new/Skeleton.vue +88 -88
  85. package/components/common/vm/actions/register/Register.vue +285 -285
  86. package/components/common/vm/actions/register/lib/config/steps.ts +86 -86
  87. package/components/common/wizards/common/steps/name/Name.vue +179 -179
  88. package/components/common/wizards/common/steps/name/New.vue +221 -221
  89. package/components/common/wizards/common/steps/name/Old.vue +121 -121
  90. package/components/common/wizards/common/steps/name/lib/models/interfaces.ts +4 -4
  91. package/components/common/wizards/common/steps/name/location/Location.vue +85 -85
  92. package/components/common/wizards/common/steps/name/location/New.vue +40 -40
  93. package/components/common/wizards/datastore/add/Add.vue +228 -228
  94. package/components/common/wizards/datastore/add/lib/utils.ts +85 -85
  95. package/components/common/wizards/datastore/add/steps/typeMode/lib/config/typeOptions.ts +43 -43
  96. package/components/common/wizards/vm/migrate/select/network/Network.vue +103 -103
  97. package/composables/useAppVersion.ts +21 -21
  98. package/composables/useLocal.ts +6 -6
  99. package/composables/useLocalCommon.ts +39 -39
  100. package/package.json +2 -2
  101. package/plugins/console.ts +22 -21
  102. package/plugins/date.ts +233 -233
  103. package/plugins/panelStates.ts +70 -70
  104. package/plugins/text.ts +59 -59
  105. package/public/spice-console/lib/images/bitmap.js +203 -203
  106. package/public/spice-console/network/spicechannel.js +440 -440
  107. package/public/spice-console/process/inputprocess.js +203 -227
  108. package/public/spice-console/process/mainprocess.js +78 -82
  109. package/public/spice-console/run.js +210 -210
  110. package/public/spice-console-minify/run.min.js +1 -1
  111. package/store/main/mutations.ts +7 -7
  112. package/store/main/state.ts +7 -7
  113. package/plugins/mouse.ts +0 -21
@@ -1,227 +1,203 @@
1
- /*
2
- Copyright (c) 2016 eyeOS
3
-
4
- This file is part of Open365.
5
-
6
- Open365 is free software: you can redistribute it and/or modify
7
- it under the terms of the GNU Affero General Public License as
8
- published by the Free Software Foundation, either version 3 of the
9
- License, or (at your option) any later version.
10
-
11
- This program is distributed in the hope that it will be useful,
12
- but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
- GNU Affero General Public License for more details.
15
-
16
- You should have received a copy of the GNU Affero General Public License
17
- along with this program. If not, see <http://www.gnu.org/licenses/>.
18
- */
19
-
20
- wdi.InputProcess = $.spcExtend(wdi.EventObject.prototype, {
21
- clientGui: null,
22
- spiceConnection: null,
23
- capsLockPressed: false,
24
- numLockPressed: false,
25
- shiftPressed: false,
26
- mouseLastX: -1,
27
- mouseLastY: -1,
28
-
29
- init: function (c) {
30
- this.superInit()
31
- this.clientGui = c.clientGui
32
- this.spiceConnection = c.spiceConnection
33
- },
34
-
35
- dispose: function () {
36
- this.clearEvents()
37
- this.clientGui = null
38
- this.spiceConnection = null
39
- },
40
-
41
- process: function (spiceMessage) {
42
- switch (spiceMessage.messageType) {
43
- case wdi.SpiceVars.SPICE_MSG_INPUTS_MOUSE_MOTION_ACK:
44
- this.clientGui.motion_ack()
45
- break
46
- }
47
- },
48
-
49
- send: function (data, type) {
50
- var packet, scanCodes, i
51
-
52
- const { $mouse } = useNuxtApp()
53
- if (type == 'mousemove') {
54
- if (
55
- $mouse.mode.value === wdi.SpiceMouseModeTypes.SPICE_MOUSE_MODE_CLIENT
56
- ) {
57
- packet = new wdi.SpiceMessage({
58
- messageType: wdi.SpiceVars.SPICE_MSGC_INPUTS_MOUSE_POSITION,
59
- channel: wdi.SpiceVars.SPICE_CHANNEL_INPUTS,
60
- args: new wdi.RedcMousePosition({
61
- x: data[1][0] + wdi.VirtualMouse.hotspot.x,
62
- y: data[1][1] + wdi.VirtualMouse.hotspot.y,
63
- buttons_state: data[1][2],
64
- display_id: 0,
65
- }),
66
- })
67
- } else if (
68
- $mouse.mode.value === wdi.SpiceMouseModeTypes.SPICE_MOUSE_MODE_SERVER
69
- ) {
70
- const dx = this.mouseLastX !== -1 ? data[1][0] - this.mouseLastX : 0
71
- const dy = this.mouseLastY !== -1 ? data[1][1] - this.mouseLastY : 0
72
- packet = new wdi.SpiceMessage({
73
- messageType: wdi.SpiceVars.SPICE_MSGC_INPUTS_MOUSE_MOTION,
74
- channel: wdi.SpiceVars.SPICE_CHANNEL_INPUTS,
75
- args: new wdi.RedcMouseMotion({
76
- x: dx,
77
- y: dy,
78
- buttons_state: 0,
79
- }),
80
- })
81
- this.mouseLastX = data[1][0]
82
- this.mouseLastY = data[1][1]
83
- }
84
-
85
- this.spiceConnection.send(packet)
86
- } else if (type == 'mousedown') {
87
- packet = new wdi.SpiceMessage({
88
- messageType: wdi.SpiceVars.SPICE_MSGC_INPUTS_MOUSE_PRESS,
89
- channel: wdi.SpiceVars.SPICE_CHANNEL_INPUTS,
90
- args: new wdi.RedcMousePress({
91
- button_id: data[1] + 1,
92
- buttons_state: 1 << data[1],
93
- }),
94
- })
95
- this.spiceConnection.send(packet)
96
- } else if (type == 'mouseup') {
97
- packet = new wdi.SpiceMessage({
98
- messageType: wdi.SpiceVars.SPICE_MSGC_INPUTS_MOUSE_RELEASE,
99
- channel: wdi.SpiceVars.SPICE_CHANNEL_INPUTS,
100
- args: new wdi.RedcMousePress({
101
- button_id: data[1] + 1,
102
- buttons_state: 0,
103
- }),
104
- })
105
- this.spiceConnection.send(packet)
106
- } else if (type == 'keydown' || type == 'keypress') {
107
- scanCodes = wdi.Keymap.getScanCodes(data[1][0])
108
-
109
- const originalEvent = data[1][0].originalEvent
110
-
111
- if (
112
- type == 'keydown' &&
113
- data[1][0].keyCode !== 20 &&
114
- ((!wdi.Keymap.isVirtualKeyboard &&
115
- originalEvent &&
116
- originalEvent.getModifierState &&
117
- wdi.Keymap.capsLock !== originalEvent.getModifierState('CapsLock')) ||
118
- (wdi.Keymap.isVirtualKeyboard &&
119
- wdi.Keymap.isVirtualCapsLockOn !== wdi.Keymap.capsLock))
120
- ) {
121
- const capsLockPacket = new wdi.SpiceMessage({
122
- messageType: wdi.SpiceVars.SPICE_MSGC_INPUTS_KEY_DOWN,
123
- channel: wdi.SpiceVars.SPICE_CHANNEL_INPUTS,
124
- args: new wdi.SpiceScanCode([58, 0, 0]),
125
- })
126
- this.capsLockPressed = true
127
- this.spiceConnection.send(capsLockPacket)
128
- }
129
-
130
- if (
131
- type == 'keydown' &&
132
- originalEvent &&
133
- originalEvent.getModifierState &&
134
- data[1][0].keyCode !== 144 &&
135
- wdi.Keymap.numLock !== originalEvent.getModifierState('NumLock')
136
- ) {
137
- const numLockPacket = new wdi.SpiceMessage({
138
- messageType: wdi.SpiceVars.SPICE_MSGC_INPUTS_KEY_DOWN,
139
- channel: wdi.SpiceVars.SPICE_CHANNEL_INPUTS,
140
- args: new wdi.SpiceScanCode([69, 0, 0]),
141
- })
142
- this.numLockPressed = true
143
- this.spiceConnection.send(numLockPacket)
144
- }
145
-
146
- for (i = 0; i < scanCodes.length; i++) {
147
- packet = new wdi.SpiceMessage({
148
- messageType: wdi.SpiceVars.SPICE_MSGC_INPUTS_KEY_DOWN,
149
- channel: wdi.SpiceVars.SPICE_CHANNEL_INPUTS,
150
- args: new wdi.SpiceScanCode(scanCodes[i]),
151
- })
152
-
153
- if (scanCodes[0] && scanCodes[0][0] === 42) {
154
- this.shiftPressed = true
155
- }
156
- this.spiceConnection.send(packet)
157
- }
158
- } else if (type == 'keyup') {
159
- scanCodes = wdi.Keymap.getScanCodes(data[1][0])
160
-
161
- if (
162
- scanCodes &&
163
- scanCodes[0] &&
164
- scanCodes[0][0] === 199 &&
165
- scanCodes[0][1] === 0 &&
166
- scanCodes[0][2] === 0
167
- ) {
168
- scanCodes = [[224, 199, 0, 0]]
169
- }
170
-
171
- if (this.capsLockPressed) {
172
- const capsLockPacket = new wdi.SpiceMessage({
173
- messageType: wdi.SpiceVars.SPICE_MSGC_INPUTS_KEY_UP,
174
- channel: wdi.SpiceVars.SPICE_CHANNEL_INPUTS,
175
- args: new wdi.SpiceScanCode([186, 0, 0]),
176
- })
177
- this.spiceConnection.send(capsLockPacket)
178
- this.capsLockPressed = false
179
- }
180
-
181
- if (this.numLockPressed) {
182
- const numLockPacket = new wdi.SpiceMessage({
183
- messageType: wdi.SpiceVars.SPICE_MSGC_INPUTS_KEY_UP,
184
- channel: wdi.SpiceVars.SPICE_CHANNEL_INPUTS,
185
- args: new wdi.SpiceScanCode([197, 0, 0]),
186
- })
187
- this.spiceConnection.send(numLockPacket)
188
- this.numLockPressed = false
189
- }
190
-
191
- if (scanCodes[0] && scanCodes[0][0] === 142) {
192
- this.shiftPressed = false
193
- }
194
-
195
- for (i = 0; i < scanCodes.length; i++) {
196
- packet = new wdi.SpiceMessage({
197
- messageType: wdi.SpiceVars.SPICE_MSGC_INPUTS_KEY_UP,
198
- channel: wdi.SpiceVars.SPICE_CHANNEL_INPUTS,
199
- args: new wdi.SpiceScanCode(scanCodes[i]),
200
- })
201
-
202
- this.spiceConnection.send(packet)
203
- }
204
- this.clientGui.inputManager.input.val('_')
205
- } else if (type == 'joystick') {
206
- packet = new wdi.SpiceMessage({
207
- messageType: wdi.SpiceVars.SPICE_MSGC_INPUTS_MOUSE_MOTION,
208
- channel: wdi.SpiceVars.SPICE_CHANNEL_INPUTS,
209
- args: new wdi.RedcMouseMotion({
210
- x: data[1][0],
211
- y: data[1][1],
212
- buttons_state: 0,
213
- }),
214
- })
215
- this.spiceConnection.send(packet)
216
- }
217
- },
218
-
219
- isKeyboardShortcut: function (type, event) {
220
- if (type === 'keydown') {
221
- var keycode = event['keyCode']
222
- wdi.Keymap.controlPressed(keycode, type, event)
223
- var ctrlShortcut = wdi.Keymap.handledByCtrlKeyCode(type, keycode, true)
224
- return ctrlShortcut
225
- }
226
- },
227
- })
1
+ /*
2
+ Copyright (c) 2016 eyeOS
3
+
4
+ This file is part of Open365.
5
+
6
+ Open365 is free software: you can redistribute it and/or modify
7
+ it under the terms of the GNU Affero General Public License as
8
+ published by the Free Software Foundation, either version 3 of the
9
+ License, or (at your option) any later version.
10
+
11
+ This program is distributed in the hope that it will be useful,
12
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ GNU Affero General Public License for more details.
15
+
16
+ You should have received a copy of the GNU Affero General Public License
17
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
18
+ */
19
+
20
+ wdi.InputProcess = $.spcExtend(wdi.EventObject.prototype, {
21
+ clientGui: null,
22
+ spiceConnection: null,
23
+ capsLockPressed: false,
24
+ numLockPressed: false,
25
+ shiftPressed: false,
26
+
27
+ init: function (c) {
28
+ this.superInit()
29
+ this.clientGui = c.clientGui
30
+ this.spiceConnection = c.spiceConnection
31
+ },
32
+
33
+ dispose: function () {
34
+ this.clearEvents()
35
+ this.clientGui = null
36
+ this.spiceConnection = null
37
+ },
38
+
39
+ process: function (spiceMessage) {
40
+ switch (spiceMessage.messageType) {
41
+ case wdi.SpiceVars.SPICE_MSG_INPUTS_MOUSE_MOTION_ACK:
42
+ this.clientGui.motion_ack()
43
+ break
44
+ }
45
+ },
46
+
47
+ send: function (data, type) {
48
+ var packet, scanCodes, i
49
+
50
+ if (type == 'mousemove') {
51
+ packet = new wdi.SpiceMessage({
52
+ messageType: wdi.SpiceVars.SPICE_MSGC_INPUTS_MOUSE_POSITION,
53
+ channel: wdi.SpiceVars.SPICE_CHANNEL_INPUTS,
54
+ args: new wdi.RedcMousePosition({
55
+ x: data[1][0] + wdi.VirtualMouse.hotspot.x,
56
+ y: data[1][1] + wdi.VirtualMouse.hotspot.y,
57
+ buttons_state: data[1][2],
58
+ display_id: 0,
59
+ }),
60
+ })
61
+ this.spiceConnection.send(packet)
62
+ } else if (type == 'mousedown') {
63
+ packet = new wdi.SpiceMessage({
64
+ messageType: wdi.SpiceVars.SPICE_MSGC_INPUTS_MOUSE_PRESS,
65
+ channel: wdi.SpiceVars.SPICE_CHANNEL_INPUTS,
66
+ args: new wdi.RedcMousePress({
67
+ button_id: data[1] + 1,
68
+ buttons_state: 1 << data[1],
69
+ }),
70
+ })
71
+ this.spiceConnection.send(packet)
72
+ } else if (type == 'mouseup') {
73
+ packet = new wdi.SpiceMessage({
74
+ messageType: wdi.SpiceVars.SPICE_MSGC_INPUTS_MOUSE_RELEASE,
75
+ channel: wdi.SpiceVars.SPICE_CHANNEL_INPUTS,
76
+ args: new wdi.RedcMousePress({
77
+ button_id: data[1] + 1,
78
+ buttons_state: 0,
79
+ }),
80
+ })
81
+ this.spiceConnection.send(packet)
82
+ } else if (type == 'keydown' || type == 'keypress') {
83
+ scanCodes = wdi.Keymap.getScanCodes(data[1][0])
84
+
85
+ const originalEvent = data[1][0].originalEvent
86
+
87
+ if (
88
+ type == 'keydown' &&
89
+ data[1][0].keyCode !== 20 &&
90
+ ((!wdi.Keymap.isVirtualKeyboard &&
91
+ originalEvent &&
92
+ originalEvent.getModifierState &&
93
+ wdi.Keymap.capsLock !== originalEvent.getModifierState('CapsLock')) ||
94
+ (wdi.Keymap.isVirtualKeyboard &&
95
+ wdi.Keymap.isVirtualCapsLockOn !== wdi.Keymap.capsLock))
96
+ ) {
97
+ const capsLockPacket = new wdi.SpiceMessage({
98
+ messageType: wdi.SpiceVars.SPICE_MSGC_INPUTS_KEY_DOWN,
99
+ channel: wdi.SpiceVars.SPICE_CHANNEL_INPUTS,
100
+ args: new wdi.SpiceScanCode([58, 0, 0]),
101
+ })
102
+ this.capsLockPressed = true
103
+ this.spiceConnection.send(capsLockPacket)
104
+ }
105
+
106
+ if (
107
+ type == 'keydown' &&
108
+ originalEvent &&
109
+ originalEvent.getModifierState &&
110
+ data[1][0].keyCode !== 144 &&
111
+ wdi.Keymap.numLock !== originalEvent.getModifierState('NumLock')
112
+ ) {
113
+ const numLockPacket = new wdi.SpiceMessage({
114
+ messageType: wdi.SpiceVars.SPICE_MSGC_INPUTS_KEY_DOWN,
115
+ channel: wdi.SpiceVars.SPICE_CHANNEL_INPUTS,
116
+ args: new wdi.SpiceScanCode([69, 0, 0]),
117
+ })
118
+ this.numLockPressed = true
119
+ this.spiceConnection.send(numLockPacket)
120
+ }
121
+
122
+ for (i = 0; i < scanCodes.length; i++) {
123
+ packet = new wdi.SpiceMessage({
124
+ messageType: wdi.SpiceVars.SPICE_MSGC_INPUTS_KEY_DOWN,
125
+ channel: wdi.SpiceVars.SPICE_CHANNEL_INPUTS,
126
+ args: new wdi.SpiceScanCode(scanCodes[i]),
127
+ })
128
+
129
+ if (scanCodes[0] && scanCodes[0][0] === 42) {
130
+ this.shiftPressed = true
131
+ }
132
+ this.spiceConnection.send(packet)
133
+ }
134
+ } else if (type == 'keyup') {
135
+ scanCodes = wdi.Keymap.getScanCodes(data[1][0])
136
+
137
+ if (
138
+ scanCodes &&
139
+ scanCodes[0] &&
140
+ scanCodes[0][0] === 199 &&
141
+ scanCodes[0][1] === 0 &&
142
+ scanCodes[0][2] === 0
143
+ ) {
144
+ scanCodes = [[224, 199, 0, 0]]
145
+ }
146
+
147
+ if (this.capsLockPressed) {
148
+ const capsLockPacket = new wdi.SpiceMessage({
149
+ messageType: wdi.SpiceVars.SPICE_MSGC_INPUTS_KEY_UP,
150
+ channel: wdi.SpiceVars.SPICE_CHANNEL_INPUTS,
151
+ args: new wdi.SpiceScanCode([186, 0, 0]),
152
+ })
153
+ this.spiceConnection.send(capsLockPacket)
154
+ this.capsLockPressed = false
155
+ }
156
+
157
+ if (this.numLockPressed) {
158
+ const numLockPacket = new wdi.SpiceMessage({
159
+ messageType: wdi.SpiceVars.SPICE_MSGC_INPUTS_KEY_UP,
160
+ channel: wdi.SpiceVars.SPICE_CHANNEL_INPUTS,
161
+ args: new wdi.SpiceScanCode([197, 0, 0]),
162
+ })
163
+ this.spiceConnection.send(numLockPacket)
164
+ this.numLockPressed = false
165
+ }
166
+
167
+ if (scanCodes[0] && scanCodes[0][0] === 142) {
168
+ this.shiftPressed = false
169
+ }
170
+
171
+ for (i = 0; i < scanCodes.length; i++) {
172
+ packet = new wdi.SpiceMessage({
173
+ messageType: wdi.SpiceVars.SPICE_MSGC_INPUTS_KEY_UP,
174
+ channel: wdi.SpiceVars.SPICE_CHANNEL_INPUTS,
175
+ args: new wdi.SpiceScanCode(scanCodes[i]),
176
+ })
177
+
178
+ this.spiceConnection.send(packet)
179
+ }
180
+ this.clientGui.inputManager.input.val('_')
181
+ } else if (type == 'joystick') {
182
+ packet = new wdi.SpiceMessage({
183
+ messageType: wdi.SpiceVars.SPICE_MSGC_INPUTS_MOUSE_MOTION,
184
+ channel: wdi.SpiceVars.SPICE_CHANNEL_INPUTS,
185
+ args: new wdi.RedcMouseMotion({
186
+ x: data[1][0],
187
+ y: data[1][1],
188
+ buttons_state: 0,
189
+ }),
190
+ })
191
+ this.spiceConnection.send(packet)
192
+ }
193
+ },
194
+
195
+ isKeyboardShortcut: function (type, event) {
196
+ if (type === 'keydown') {
197
+ var keycode = event['keyCode']
198
+ wdi.Keymap.controlPressed(keycode, type, event)
199
+ var ctrlShortcut = wdi.Keymap.handledByCtrlKeyCode(type, keycode, true)
200
+ return ctrlShortcut
201
+ }
202
+ },
203
+ })
@@ -1,82 +1,78 @@
1
- /*
2
- Copyright (c) 2016 eyeOS
3
-
4
- This file is part of Open365.
5
-
6
- Open365 is free software: you can redistribute it and/or modify
7
- it under the terms of the GNU Affero General Public License as
8
- published by the Free Software Foundation, either version 3 of the
9
- License, or (at your option) any later version.
10
-
11
- This program is distributed in the hope that it will be useful,
12
- but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
- GNU Affero General Public License for more details.
15
-
16
- You should have received a copy of the GNU Affero General Public License
17
- along with this program. If not, see <http://www.gnu.org/licenses/>.
18
- */
19
-
20
- wdi.MainProcess = $.spcExtend(wdi.EventObject.prototype, {
21
- init: function(c) {
22
- this.superInit();
23
- this.app = c.app;
24
- this.spiceConnection = c.app.spiceConnection;
25
- this.agent = c.app.agent;
26
- this.currentMouseMode = wdi.SpiceMouseModeTypes.SPICE_MOUSE_MODE_CLIENT;
27
- },
28
-
29
- dispose: function() {
30
- this.clearEvents();
31
- this.app = null;
32
- this.spiceConnection = null;
33
- this.agent = null;
34
- },
35
-
36
- process: function(spiceMessage) {
37
- var channel = this.spiceConnection.channels[wdi.SpiceVars.SPICE_CHANNEL_MAIN];
38
-
39
- switch(spiceMessage.messageType) {
40
- case wdi.SpiceVars.SPICE_MSG_MAIN_INIT:
41
- channel.connectionId = spiceMessage.args.session_id;
42
- channel.fire('connectionId', channel.connectionId);
43
- if(spiceMessage.args.agent_connected == 1) {
44
- channel.fire('initAgent', spiceMessage.args.agent_tokens);
45
- }
46
- if (spiceMessage.args.current_mouse_mode == 1) {
47
- channel.fire('mouseMode', spiceMessage.args.current_mouse_mode);
48
- }
49
- // the mouse mode must be change both if we have agent or not
50
- this.changeMouseMode();
51
- break;
52
- case wdi.SpiceVars.SPICE_MSG_MAIN_AGENT_DATA:
53
- var packet = spiceMessage.args;
54
- this.agent.onAgentData(packet);
55
- break;
56
- case wdi.SpiceVars.SPICE_MSG_MAIN_AGENT_CONNECTED:
57
- channel.fire('initAgent', spiceMessage.args.agent_tokens);
58
- this.changeMouseMode();
59
- break;
60
- case wdi.SpiceVars.SPICE_MSG_MAIN_MULTI_MEDIA_TIME:
61
- this.app.multimediaTime = spiceMessage.args.multimedia_time;
62
- break;
63
- case wdi.SpiceVars.SPICE_MSG_MAIN_CHANNELS_LIST:
64
- channel.fire('channelListAvailable', spiceMessage.args.channels);
65
- break;
66
- }
67
- },
68
-
69
- changeMouseMode: function(mode = wdi.SpiceMouseModeTypes.SPICE_MOUSE_MODE_CLIENT) {
70
- var packet = new wdi.SpiceMessage({
71
- messageType: wdi.SpiceVars.SPICE_MSGC_MAIN_MOUSE_MODE_REQUEST,
72
- channel: wdi.SpiceVars.SPICE_CHANNEL_MAIN,
73
- args: new wdi.SpiceMouseModeRequest({
74
- request_mode: mode // Custom code
75
- })
76
- });
77
- this.spiceConnection.send(packet);
78
- this.currentMouseMode = mode // Custom code
79
- const { $mouse } = useNuxtApp()
80
- $mouse.changeMode(mode)
81
- }
82
- });
1
+ /*
2
+ Copyright (c) 2016 eyeOS
3
+
4
+ This file is part of Open365.
5
+
6
+ Open365 is free software: you can redistribute it and/or modify
7
+ it under the terms of the GNU Affero General Public License as
8
+ published by the Free Software Foundation, either version 3 of the
9
+ License, or (at your option) any later version.
10
+
11
+ This program is distributed in the hope that it will be useful,
12
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ GNU Affero General Public License for more details.
15
+
16
+ You should have received a copy of the GNU Affero General Public License
17
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
18
+ */
19
+
20
+ wdi.MainProcess = $.spcExtend(wdi.EventObject.prototype, {
21
+ init: function(c) {
22
+ this.superInit();
23
+ this.app = c.app;
24
+ this.spiceConnection = c.app.spiceConnection;
25
+ this.agent = c.app.agent;
26
+ },
27
+
28
+ dispose: function() {
29
+ this.clearEvents();
30
+ this.app = null;
31
+ this.spiceConnection = null;
32
+ this.agent = null;
33
+ },
34
+
35
+ process: function(spiceMessage) {
36
+ var channel = this.spiceConnection.channels[wdi.SpiceVars.SPICE_CHANNEL_MAIN];
37
+
38
+ switch(spiceMessage.messageType) {
39
+ case wdi.SpiceVars.SPICE_MSG_MAIN_INIT:
40
+ channel.connectionId = spiceMessage.args.session_id;
41
+ channel.fire('connectionId', channel.connectionId);
42
+ if(spiceMessage.args.agent_connected == 1) {
43
+ channel.fire('initAgent', spiceMessage.args.agent_tokens);
44
+ }
45
+ if (spiceMessage.args.current_mouse_mode == 1) {
46
+ channel.fire('mouseMode', spiceMessage.args.current_mouse_mode);
47
+ }
48
+ // the mouse mode must be change both if we have agent or not
49
+ this.changeMouseMode();
50
+ break;
51
+ case wdi.SpiceVars.SPICE_MSG_MAIN_AGENT_DATA:
52
+ var packet = spiceMessage.args;
53
+ this.agent.onAgentData(packet);
54
+ break;
55
+ case wdi.SpiceVars.SPICE_MSG_MAIN_AGENT_CONNECTED:
56
+ channel.fire('initAgent', spiceMessage.args.agent_tokens);
57
+ this.changeMouseMode();
58
+ break;
59
+ case wdi.SpiceVars.SPICE_MSG_MAIN_MULTI_MEDIA_TIME:
60
+ this.app.multimediaTime = spiceMessage.args.multimedia_time;
61
+ break;
62
+ case wdi.SpiceVars.SPICE_MSG_MAIN_CHANNELS_LIST:
63
+ channel.fire('channelListAvailable', spiceMessage.args.channels);
64
+ break;
65
+ }
66
+ },
67
+
68
+ changeMouseMode: function() {
69
+ var packet = new wdi.SpiceMessage({
70
+ messageType: wdi.SpiceVars.SPICE_MSGC_MAIN_MOUSE_MODE_REQUEST,
71
+ channel: wdi.SpiceVars.SPICE_CHANNEL_MAIN,
72
+ args: new wdi.SpiceMouseModeRequest({
73
+ request_mode: wdi.SpiceMouseModeTypes.SPICE_MOUSE_MODE_CLIENT
74
+ })
75
+ });
76
+ this.spiceConnection.send(packet);
77
+ }
78
+ });