Merge branch 'KASM-1298_manually_merge_offline_changes' into multiuser_and_new_ui

This commit is contained in:
Dmitry Maksyoma 2021-02-28 22:55:47 +13:00
commit 05ea1b99ee

View File

@ -172,7 +172,6 @@ const UI = {
UI.initSetting('port', port);
UI.initSetting('encrypt', (window.location.protocol === "https:"));
UI.initSetting('view_clip', false);
UI.initSetting('resize', 'remote');
UI.initSetting('shared', true);
UI.initSetting('view_only', false);
UI.initSetting('show_dot', false);
@ -181,15 +180,26 @@ const UI = {
UI.initSetting('reconnect', false);
UI.initSetting('reconnect_delay', 5000);
UI.initSetting('idle_disconnect', 20);
UI.initSetting('video_quality', 3);
UI.initSetting('clipboard_up', true);
UI.initSetting('clipboard_down', true);
UI.initSetting('clipboard_seamless', true);
UI.initSetting('prefer_local_cursor', true);
UI.initSetting('enable_webp', true);
UI.initSetting('toggle_control_panel', false);
UI.initSetting('enable_perf_stats', false);
if (WebUtil.isInsideKasmVDI()) {
UI.initSetting('video_quality', 1);
UI.initSetting('clipboard_up', false);
UI.initSetting('clipboard_down', false);
UI.initSetting('clipboard_seamless', false);
UI.initSetting('enable_webp', false);
UI.initSetting('resize', 'off');
} else {
UI.initSetting('video_quality', 3);
UI.initSetting('clipboard_up', true);
UI.initSetting('clipboard_down', true);
UI.initSetting('clipboard_seamless', true);
UI.initSetting('enable_webp', true);
UI.initSetting('resize', 'remote');
}
UI.setupSettingLabels();
},
// Adds a link to the label elements on the corresponding input elements
@ -416,6 +426,10 @@ const UI = {
document.documentElement.classList.remove("noVNC_reconnecting");
const transition_elem = document.getElementById("noVNC_transition_text");
if (WebUtil.isInsideKasmVDI())
{
parent.postMessage({ action: 'connection_state', value: state}, '*' );
}
switch (state) {
case 'init':
break;
@ -1254,7 +1268,7 @@ const UI = {
UI.rfb.addEventListener("securityfailure", UI.securityFailed);
UI.rfb.addEventListener("capabilities", UI.updatePowerButton);
UI.rfb.addEventListener("clipboard", UI.clipboardReceive);
UI.rfb.addEventListener("bottleneck_stats", UI.bottleneckStatsRecieve);
UI.rfb.addEventListener("bottleneck_stats", UI.bottleneckStatsRecieve);
document.addEventListener('mouseenter', UI.enterVNC);
document.addEventListener('mouseleave', UI.leaveVNC);
@ -1295,7 +1309,9 @@ const UI = {
window.attachEvent('onload', WindowLoad);
window.attachEvent('message', UI.receiveMessage);
}
UI.rfb.addEventListener("clipboard", UI.clipboardRx);
if (UI.rfb.clipboardDown){
UI.rfb.addEventListener("clipboard", UI.clipboardRx);
}
UI.rfb.addEventListener("disconnect", UI.disconnectedRx);
document.getElementById('noVNC_control_bar_anchor').setAttribute('style', 'display: none');
document.getElementById('noVNC_connect_dlg').innerHTML = '';
@ -1459,7 +1475,9 @@ const UI = {
if (event.data && event.data.action) {
switch (event.data.action) {
case 'clipboardsnd':
UI.rfb.clipboardPasteFrom(event.data.value);
if (UI.rfb.clipboardUp) {
UI.rfb.clipboardPasteFrom(event.data.value);
}
break;
case 'setvideoquality':
UI.rfb.videoQuality = event.data.value;