mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2024-12-26 23:25:53 -05:00
Fixed connection options, not sent unless needed.
This commit is contained in:
parent
afce306026
commit
4fb6a77d94
@ -1271,7 +1271,9 @@ function createMeshCore(agent) {
|
||||
// Look for a TSID
|
||||
var tsid = null;
|
||||
if ((this.httprequest.xoptions != null) && (typeof this.httprequest.xoptions.tsid == 'number')) { tsid = this.httprequest.xoptions.tsid; }
|
||||
if (require('MeshAgent')._tsid != null) { tsid = require('MeshAgent')._tsid; }
|
||||
//if (require('MeshAgent')._tsid != null) { tsid = require('MeshAgent')._tsid; }
|
||||
//sendConsoleText('tsid: ' + tsid);
|
||||
//require('MeshAgent')._tsid = tsid;
|
||||
|
||||
// Remote desktop using native pipes
|
||||
this.httprequest.desktop = { state: 0, kvm: mesh.getRemoteDesktopStream(tsid), tunnel: this };
|
||||
|
@ -1710,7 +1710,7 @@
|
||||
} else if ((message.type == 'userSessions') && (currentNode != null) && (currentNode._id == message.nodeid) && (desktop == null)) {
|
||||
// Got list of user sessions
|
||||
var userSessions = [];
|
||||
if (message.data != null) { for (var i in message.data) { if ((message.data[i].State == 'Active') || (debugmode == 3)) { userSessions.push(message.data[i]); } } }
|
||||
if (message.data != null) { for (var i in message.data) { if ((message.data[i].State == 'Active') || (message.data[i].StationName == 'Console') || (debugmode == 3)) { userSessions.push(message.data[i]); } } }
|
||||
if (userSessions.length == 0) { connectDesktop(null, 1); } // No active sessions, do a normal connection.
|
||||
else if (userSessions.length == 1) { connectDesktop(null, 1, userSessions[0].SessionId); } // One active session, connect to it
|
||||
else {
|
||||
@ -5165,6 +5165,8 @@
|
||||
function autoConnectDesktop(e) { if (autoConnectDesktopTimer == null) { autoConnectDesktopTimer = setInterval(function() { connectDesktop(null, 1) }, 1000); } else { clearInterval(autoConnectDesktopTimer); autoConnectDesktopTimer = null; } }
|
||||
|
||||
function connectDesktop(e, contype, tsid) {
|
||||
if (xxdialogMode) return;
|
||||
if ((e != null) && (e.shiftKey == false) && (contype == 3)) { contype = 1; } // If the shift key is not pressed, don't try to ask for session list.
|
||||
QV('p11DeskSessionSelector', false);
|
||||
p11clearConsoleMsg();
|
||||
if (desktop == null) {
|
||||
@ -5259,7 +5261,7 @@
|
||||
desktop.debugmode = debugmode;
|
||||
desktop.m.debugmode = debugmode;
|
||||
desktop.attemptWebRTC = attemptWebRTC;
|
||||
desktop.options = { tsid: tsid };
|
||||
if (tsid != null) { desktop.options = { tsid: tsid }; }
|
||||
desktop.onStateChanged = onDesktopStateChange;
|
||||
desktop.onConsoleMessageChange = function () {
|
||||
p11clearConsoleMsg();
|
||||
|
Loading…
Reference in New Issue
Block a user