bfg-common 1.5.506 → 1.5.508
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.
- package/assets/localization/local_be.json +12 -2
- package/assets/localization/local_en.json +12 -2
- package/assets/localization/local_hy.json +12 -2
- package/assets/localization/local_kk.json +12 -2
- package/assets/localization/local_ru.json +12 -2
- package/assets/localization/local_zh.json +12 -2
- package/components/common/pages/backups/Backups.vue +54 -61
- package/components/common/pages/backups/BackupsOld.vue +80 -0
- package/components/common/pages/backups/backupsNew/BackupsNew.vue +356 -0
- package/components/common/pages/backups/backupsNew/contextMenuView/ContextMenuView.vue +101 -0
- package/components/common/pages/backups/backupsNew/contextMenuView/lib/config/contextMenuItems.ts +29 -0
- package/components/common/pages/backups/backupsNew/lib/models/interfaces.ts +12 -0
- package/components/common/pages/backups/backupsNew/lib/utils/contextMenu.ts +29 -0
- package/components/common/pages/backups/backupsNew/lib/utils/details.ts +30 -0
- package/components/common/pages/backups/modals/deleteBackup/DeleteBackup.vue +17 -4
- package/components/common/pages/backups/tools/Tools.vue +75 -75
- package/components/common/pages/backups/tools/lib/config/tabs.ts +37 -36
- package/components/common/spiceConsole/Drawer.vue +29 -2
- package/components/common/spiceConsole/lib/models/types.ts +1 -0
- package/package.json +1 -1
- package/plugins/console.ts +21 -22
- package/plugins/mouse.ts +21 -0
- package/public/spice-console/process/inputprocess.js +227 -203
- package/public/spice-console/process/mainprocess.js +82 -78
- package/public/spice-console-minify/run.min.js +1 -1
|
@@ -1,203 +1,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
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
this.
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
this.
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
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,78 +1,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
|
-
|
|
29
|
-
|
|
30
|
-
this.
|
|
31
|
-
this.
|
|
32
|
-
this.
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
channel.
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
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
|
+
});
|