mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2024-09-11 08:55:32 +03:00
Fixed guest sharing desktop quality.
This commit is contained in:
parent
36b73e13f0
commit
fb6acd901b
@ -114,7 +114,7 @@
|
||||
"meshErrorLogPath": { "type": "string" },
|
||||
"npmPath": { "type": "string" },
|
||||
"npmProxy": { "type": "string", "format": "uri" },
|
||||
"allowHighQualityDesktop": { "type": "boolean", "default": true },
|
||||
"allowHighQualityDesktop": { "type": "boolean", "default": true, "description": "When false, users will only be able to set remote desktop image quality to 60%, this can reduce server bandwidth usage." },
|
||||
"webPush": {
|
||||
"type": "object",
|
||||
"description": "When set with a valid email address, enables the MeshCentral web push notification feature. Allows administrators to send browser notifications to users even if they are not looking at the MeshCentral web site.",
|
||||
|
@ -307,6 +307,13 @@
|
||||
QH('p13power', printFlexDateTime(new Date(parseInt(expire))));
|
||||
}
|
||||
var features = parseInt('{{{features}}}');
|
||||
var features2 = parseInt('{{{features2}}}');
|
||||
|
||||
// Load desktop settings
|
||||
var t = null;
|
||||
try { t = localStorage.getItem('desktopsettings'); } catch (ex) { }
|
||||
if (t != null) { try { desktopsettings = JSON.parse(t); } catch (ex) { } }
|
||||
if (((features2 & 1) == 0) && (desktopsettings.quality > 60)) { desktopsettings.quality = 60; }
|
||||
|
||||
// Terminal
|
||||
var terminal = null;
|
||||
@ -771,7 +778,7 @@
|
||||
}
|
||||
|
||||
function applyDesktopSettings() {
|
||||
var r = '', ops = [60, 50, 40, 30, 20, 10, 5, 1];
|
||||
var r = '', ops = (features2 & 1) ? [90, 80, 70, 60, 50, 40, 30, 20, 10, 5, 1] : [60, 50, 40, 30, 20, 10, 5, 1]
|
||||
for (var i in ops) { r += '<option value=' + ops[i] + '>' + ops[i] + '%</option>'; }
|
||||
QH('d7bitmapquality', r);
|
||||
d7desktopmode.value = desktopsettings.encoding;
|
||||
|
@ -3507,11 +3507,15 @@ module.exports.CreateWebServer = function (parent, db, args, certificates) {
|
||||
// Consent flags are 1 = Notify, 8 = Prompt, 64 = Privacy Bar.
|
||||
const authCookie = obj.parent.encodeCookie({ userid: c.uid, domainid: domain.id, nid: c.nid, ip: req.clientIp, p: c.p, gn: c.gn, cf: c.cf, r: 8, expire: c.expire, pid: c.pid, vo: c.vo }, obj.parent.loginCookieEncryptionKey);
|
||||
|
||||
// Server features
|
||||
var features2 = 0;
|
||||
if (obj.args.allowhighqualitydesktop !== false) { features2 += 1; } // Enable AllowHighQualityDesktop (Default true)
|
||||
|
||||
// Lets respond by sending out the desktop viewer.
|
||||
var httpsPort = ((obj.args.aliasport == null) ? obj.args.port : obj.args.aliasport); // Use HTTPS alias port is specified
|
||||
parent.debug('web', 'handleSharingRequest: Sending guest sharing page for \"' + c.uid + '\", guest \"' + c.gn + '\".');
|
||||
res.set({ 'Cache-Control': 'no-store' });
|
||||
render(req, res, getRenderPage('sharing', req, domain), getRenderArgs({ authCookie: authCookie, authRelayCookie: '', domainurl: encodeURIComponent(domain.url).replace(/'/g, '%27'), nodeid: c.nid, serverDnsName: obj.getWebServerName(domain), serverRedirPort: args.redirport, serverPublicPort: httpsPort, expire: c.expire, viewOnly: (c.vo == 1) ? 1 : 0, nodeName: encodeURIComponent(node.name).replace(/'/g, '%27'), features: c.p }, req, domain));
|
||||
render(req, res, getRenderPage('sharing', req, domain), getRenderArgs({ authCookie: authCookie, authRelayCookie: '', domainurl: encodeURIComponent(domain.url).replace(/'/g, '%27'), nodeid: c.nid, serverDnsName: obj.getWebServerName(domain), serverRedirPort: args.redirport, serverPublicPort: httpsPort, expire: c.expire, viewOnly: (c.vo == 1) ? 1 : 0, nodeName: encodeURIComponent(node.name).replace(/'/g, '%27'), features: c.p, features2: features2 }, req, domain));
|
||||
});
|
||||
});
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user