bfg-common 1.5.459 → 1.5.461
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.
@@ -136,20 +136,20 @@ onBeforeUnmount(() => {
|
|
136
136
|
window.removeEventListener('blur', inputManagerBlur)
|
137
137
|
})
|
138
138
|
|
139
|
-
// TODO Этот код решает проблему когда у вм нету пароли, но окно подтверждения все равно открывается
|
140
|
-
const { $store }: any = useNuxtApp()
|
141
|
-
$store.dispatch('vm/A_GET_VM_SETTINGS', props.vmId) // Работает и для Пракуратора и для Сферы
|
142
|
-
const vmSettings = computed<UI_I_VmSettings | null>(
|
143
|
-
|
144
|
-
)
|
145
|
-
watch(
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
)
|
139
|
+
// // TODO Этот код решает проблему когда у вм нету пароли, но окно подтверждения все равно открывается
|
140
|
+
// const { $store }: any = useNuxtApp()
|
141
|
+
// $store.dispatch('vm/A_GET_VM_SETTINGS', props.vmId) // Работает и для Пракуратора и для Сферы
|
142
|
+
// const vmSettings = computed<UI_I_VmSettings | null>(
|
143
|
+
// () => $store.getters['vm/getVmSettings']
|
144
|
+
// )
|
145
|
+
// watch(
|
146
|
+
// vmSettings,
|
147
|
+
// (newValue) => {
|
148
|
+
// // @ts-ignore
|
149
|
+
// window.vmHasPassword = !!newValue?.options.remote_console.password
|
150
|
+
// },
|
151
|
+
// { deep: true, immediate: true }
|
152
|
+
// )
|
153
153
|
</script>
|
154
154
|
<style scoped lang="scss">
|
155
155
|
.spice-console {
|
package/package.json
CHANGED
@@ -346,6 +346,51 @@ wdi.SpiceChannel = $.spcExtend(wdi.EventObject.prototype, {
|
|
346
346
|
errorQ.setData(data)
|
347
347
|
var errorCode = wdi.SpiceObject.bytesToInt32NoAllocate(errorQ)
|
348
348
|
wdi.GlobalPool.discard('ViewQueue', errorQ)
|
349
|
+
|
350
|
+
// TODO remove
|
351
|
+
let chanelName =
|
352
|
+
this.channel === wdi.SpiceVars.SPICE_CHANNEL_DISPLAY ? 'display' : 'main'
|
353
|
+
switch (this.channel) {
|
354
|
+
case wdi.SpiceVars.SPICE_CHANNEL_MAIN:
|
355
|
+
chanelName = 'main'
|
356
|
+
break
|
357
|
+
case wdi.SpiceVars.SPICE_CHANNEL_DISPLAY:
|
358
|
+
chanelName = 'display'
|
359
|
+
break
|
360
|
+
case wdi.SpiceVars.SPICE_CHANNEL_INPUTS:
|
361
|
+
chanelName = 'inputs'
|
362
|
+
break
|
363
|
+
case wdi.SpiceVars.SPICE_CHANNEL_CURSOR:
|
364
|
+
chanelName = 'cursor'
|
365
|
+
break
|
366
|
+
case wdi.SpiceVars.SPICE_CHANNEL_PLAYBACK:
|
367
|
+
chanelName = 'playback'
|
368
|
+
break
|
369
|
+
case wdi.SpiceVars.SPICE_CHANNEL_RECORD:
|
370
|
+
chanelName = 'record'
|
371
|
+
break
|
372
|
+
case wdi.SpiceVars.SPICE_CHANNEL_TUNNEL:
|
373
|
+
chanelName = 'tunnel'
|
374
|
+
break
|
375
|
+
case wdi.SpiceVars.SPICE_CHANNEL_SMARTCARD:
|
376
|
+
chanelName = 'smartcard'
|
377
|
+
break
|
378
|
+
case wdi.SpiceVars.SPICE_CHANNEL_USBREDIR:
|
379
|
+
chanelName = 'usbredir'
|
380
|
+
break
|
381
|
+
}
|
382
|
+
if (errorCode === 7) {
|
383
|
+
console.log(
|
384
|
+
`%c error code: 7; channel: ${chanelName} (${this.channel})`,
|
385
|
+
'color: red'
|
386
|
+
)
|
387
|
+
} else if (errorCode > 0) {
|
388
|
+
console.log(
|
389
|
+
'getErrorCodeBytes',
|
390
|
+
`error code: ${errorCode}`,
|
391
|
+
`channel: ${chanelName} (${this.channel})`
|
392
|
+
)
|
393
|
+
}
|
349
394
|
if (errorCode === 0) {
|
350
395
|
if (this.channel === wdi.SpiceVars.SPICE_CHANNEL_DISPLAY) {
|
351
396
|
var redDisplayInit = new wdi.SpiceDataHeader({
|
@@ -374,24 +419,14 @@ wdi.SpiceChannel = $.spcExtend(wdi.EventObject.prototype, {
|
|
374
419
|
}
|
375
420
|
// Custom code
|
376
421
|
} else if (errorCode === 7) {
|
377
|
-
|
378
|
-
// const vmId = location.pathname.match(/id=(.+)/)[1]
|
379
|
-
// let password = window.sessionStorage.getItem(`password-${vmId}`)
|
380
|
-
// if (window.passwordInit) password = ''
|
381
|
-
//
|
382
|
-
// window.password = password || window.prompt('Enter the password')
|
383
|
-
// window.password &&
|
384
|
-
// window.sessionStorage.setItem(`password-${vmId}`, window.password)
|
385
|
-
// window.passwordInit = true
|
386
|
-
// TODO Временное решение
|
387
|
-
if (window.vmHasPassword) {
|
422
|
+
if (this.channel === wdi.SpiceVars.SPICE_CHANNEL_MAIN) {
|
388
423
|
const vmId = location.pathname.match(/id=(.+)/)[1]
|
389
424
|
let password = window.sessionStorage.getItem(`password-${vmId}`)
|
390
425
|
if (window.passwordInit) password = ''
|
391
426
|
|
392
427
|
window.password = password || window.prompt('Enter the password')
|
393
428
|
window.password &&
|
394
|
-
|
429
|
+
window.sessionStorage.setItem(`password-${vmId}`, window.password)
|
395
430
|
window.passwordInit = true
|
396
431
|
}
|
397
432
|
// Custom code end
|