1
0
Fork 0
mirror of https://github.com/Ylianst/MeshCentral.git synced 2025-03-09 15:40:18 +00:00

Merge branch 'Ylianst:master' into feature/sync-device-name-to-agentname

This commit is contained in:
Daniel Hammerschmidt 2025-02-26 17:36:28 +01:00 committed by GitHub
commit 386a553d5c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 34 additions and 997 deletions

View file

@ -4355,7 +4355,7 @@ function processConsoleCommand(cmd, args, rights, sessionid) {
}
case 'agentmsg': {
if (args['_'].length == 0) {
response = "Proper usage:\r\n agentmsg add \"[message]\" [iconIndex]\r\n agentmsg remove [index]\r\n agentmsg list"; // Display usage
response = "Proper usage:\r\n agentmsg add \"[message]\" [iconIndex]\r\n agentmsg remove [id]\r\n agentmsg list"; // Display usage
} else {
if ((args['_'][0] == 'add') && (args['_'].length > 1)) {
var msgID, iconIndex = 0;

View file

@ -585,6 +585,7 @@ function CreateMeshCentralServer(config, args) {
const child_process = require('child_process');
try { if (process.traceDeprecation === true) { startArgs.unshift('--trace-deprecation'); } } catch (ex) { }
try { if (process.traceProcessWarnings === true) { startArgs.unshift('--trace-warnings'); } } catch (ex) { }
if (startArgs[0] != "--disable-proto=delete") startArgs.unshift("--disable-proto=delete")
childProcess = child_process.execFile(process.argv[0], startArgs, { maxBuffer: Infinity, cwd: obj.parentpath }, function (error, stdout, stderr) {
if (childProcess.xrestart == 1) {
setTimeout(function () { obj.launchChildServer(startArgs); }, 500); // This is an expected restart.
@ -1656,7 +1657,7 @@ function CreateMeshCentralServer(config, args) {
}
// Setup agent error log
if ((obj.config) && (obj.config.settings) && (obj.config.settings.agentlogdump != null)) {
if ((obj.config) && (obj.config.settings) && (obj.config.settings.agentlogdump)) {
obj.fs.open(obj.path.join(obj.datapath, 'agenterrorlogs.txt'), 'a', function (err, fd) { obj.agentErrorLog = fd; })
}

View file

@ -928,7 +928,7 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use
// Get a short file and send it back on the web socket
if (common.validateString(command.file, 1, 4096) == false) return;
const scpath = meshPathToRealPath(command.path, user); // This will also check access rights
if (scpath == null) break;
if ((scpath == null) || (command.file !== parent.path.basename(command.file))) break;
const filePath = parent.path.join(scpath, command.file);
fs.stat(filePath, function (err, stat) {
if ((err != null) || (stat == null) || (stat.size >= 204800)) return;
@ -943,7 +943,7 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use
if (common.validateString(command.file, 1, 4096) == false) return;
if (typeof command.data != 'string') return;
const scpath = meshPathToRealPath(command.path, user); // This will also check access rights
if (scpath == null) break;
if ((scpath == null) || (command.file !== parent.path.basename(command.file))) break;
const filePath = parent.path.join(scpath, command.file);
var data = null;
try { data = Buffer.from(command.data, 'base64'); } catch (ex) { return; }

View file

@ -1,6 +1,6 @@
{
"name": "meshcentral",
"version": "1.1.38",
"version": "1.1.39",
"keywords": [
"Remote Device Management",
"Remote Device Monitoring",

File diff suppressed because one or more lines are too long

View file

@ -155,7 +155,6 @@ var CreateAgentRemoteDesktop = function (canvasid, scrolldiv) {
if (Msg[1] == 1) { obj.ProcessCopyRectMsg(Msg[2]); }
else if (Msg[1] == 2) { obj.Canvas.drawImage(Msg[2], obj.rotX(Msg[3], Msg[4]), obj.rotY(Msg[3], Msg[4])); delete Msg[2]; }
obj.PendingOperations.splice(i, 1);
delete Msg;
obj.TilesDrawn++;
if ((obj.TilesDrawn == obj.tilesReceived) && (obj.KillDraw < obj.TilesDrawn)) { obj.KillDraw = obj.TilesDrawn = obj.tilesReceived = 0; }
return true;

View file

@ -64,6 +64,7 @@ var minifyMeshCentralSourceFiles = [
"../views/agentinvite.handlebars",
"../views/invite.handlebars",
"../views/default.handlebars",
"../views/default3.handlebars",
"../views/default-mobile.handlebars",
"../views/download.handlebars",
"../views/download2.handlebars",
@ -452,7 +453,8 @@ function startEx(argv) {
removeScriptTypeAttributes: true,
removeTagWhitespace: true,
preserveLineBreaks: false,
useShortDoctype: true
useShortDoctype: true,
log: function(a) { if (typeof a !== 'string') { console.log(a); } } // Log errors from UglifyJS to console output
});
} catch (ex) {
console.log(ex);

View file

@ -30993,9 +30993,9 @@
"bs": "Omogućite ugađanje fontova",
"ca": "Habiliteu la suavització de fonts",
"cs": "Povolit vyhlazování písem",
"da": "Aktiver Font Smooting",
"da": "Aktiver Font Smoothing",
"de": "Schriftartglättung aktivieren",
"en": "Enable Font Smooting",
"en": "Enable Font Smoothing",
"es": "Habilitar suavizado de fuentes",
"fi": "Ota fontin tasoitus käyttöön",
"fr": "Activer le lissage des polices de caractères",
@ -31009,10 +31009,10 @@
"pt": "Ativar suavização de fonte",
"pt-br": "Ativar suavização de fonte",
"ru": "Включить сглаживание шрифтов",
"sv": "Aktivera Font Smooting",
"sv": "Aktivera Font Smoothing",
"tr": "Yazı Tipi Düzeltmeyi Etkinleştir",
"zh-chs": "启用字体 Smooting",
"zh-cht": "啟用字體 Smooting",
"zh-chs": "启用字体 Smoothing",
"zh-cht": "啟用字體 Smoothing",
"xloc": [
"default.handlebars->container->dialog->dialogBody->dialog7->d7rdpkvm->5->d7rdpflags->13",
"default3.handlebars->container->xxAddAgentModal->xxAddAgentModalConf->1->xxAddAgentBody->dialog7->d7rdpkvm->5->d7rdpflags->13"
@ -86671,7 +86671,7 @@
"en": "Upload",
"es": "Subir Archivo",
"fi": "Lähetä",
"fr": "Télécharger",
"fr": "Téléverser",
"hi": "डालना",
"hu": "Feltöltés",
"it": "Caricare",

View file

@ -1325,7 +1325,7 @@
var logoutControls = JSON.parse(decodeURIComponent('{{{logoutControls}}}'));
var authCookieRenewTimer = null;
var webRelayPort = parseInt('{{{webRelayPort}}}');
var hidePowerTimeline = {{{hidePowerTimeline}}};
var hidePowerTimeline = '{{{hidePowerTimeline}}}';
var webRelayDns = '{{{webRelayDns}}}';
var meshserver = null;
var xdr = null;
@ -4267,7 +4267,7 @@
// Draw device power bars. The bars are 766px wide.
function drawDeviceTimeline() {
if (currentNode.mtype == 3 || hidePowerTimeline) { QH('p10html2', '<br />'); return; }
if (currentNode.mtype == 3 || hidePowerTimeline === 'true') { QH('p10html2', '<br />'); return; }
var timeline = null, now = Date.now();
if (currentNode._id == powerTimelineNode) { timeline = powerTimeline; }

View file

@ -1479,7 +1479,7 @@
<label style="display:block"><input type="checkbox" id="d7rdp4" />Disable Theming</label>
<label style="display:block"><input type="checkbox" id="d7rdp6" />Disable Cursor Shadow</label>
<label style="display:block"><input type="checkbox" id="d7rdp7" />Disable Cursor Settings</label>
<label style="display:block"><input type="checkbox" id="d7rdp8" />Enable Font Smooting</label>
<label style="display:block"><input type="checkbox" id="d7rdp8" />Enable Font Smoothing</label>
<label style="display:block"><input type="checkbox" id="d7rdp9" />Enable Desktop Composision</label>
<label style="display:block"><input type="checkbox" id="d7rdpclip" />Automatic Clipboard</label>
<label style="display:block"><input type="checkbox" id="d7rdpsmb" />Swap Mouse Buttons</label>
@ -1553,8 +1553,8 @@
var sessionTime = parseInt('{{{sessiontime}}}');
var webRelayPort = parseInt('{{{webRelayPort}}}');
var webRelayDns = '{{{webRelayDns}}}';
var hidePowerTimeline = {{{hidePowerTimeline}}};
var showNotesPanel = {{{showNotesPanel}}};
var hidePowerTimeline = '{{{hidePowerTimeline}}}';
var showNotesPanel = '{{{showNotesPanel}}}';
var sessionRefreshTimer = null;
var domain = '{{{domain}}}';
var domainUrl = '{{{domainurl}}}';
@ -3027,7 +3027,7 @@
}
}else{
Q('notesPanelArea').innerHTML = (message.notes && marked && DOMPurify) ? DOMPurify.sanitize(marked.parse(decodeURIComponent(message.notes), { breaks: true }), { USE_PROFILES: { html: true } }) : '';
if (showNotesPanel && message.notes) { QV('notesPanel',true); }else{ QV('notesPanel', false); }
if ((showNotesPanel === 'true') && message.notes) { QV('notesPanel',true); }else{ QV('notesPanel', false); }
}
break;
}
@ -8243,7 +8243,7 @@
if (noteid == null) { noteid = encodeURIComponentEx('p'+userinfo._id); }
var x = '<textarea id=d2devNotes ro=' + readonly + ' noteid=' + noteid + ' readonly style=background-color:#fcf3cf;width:100%;height:200px;resize:none;overflow-y:scroll></textarea>';
if (noteid.startsWith('node%2F%2F')) { x += ' <span style=font-size:10px>' + "Device group notes can be viewed and changed by other device group administrators." + '</span>'; }
if (showNotesPanel) { x += ' <span style=font-size:10px><a target=_blank href=\'https://www.markdownguide.org/cheat-sheet/\'>' + "Markdown syntax supported" + '</a></span>'; }
if (showNotesPanel === 'true') { x += ' <span style=font-size:10px><a target=_blank href=\'https://www.markdownguide.org/cheat-sheet/\'>' + "Markdown syntax supported" + '</a></span>'; }
setDialogMode(2, "Notes", 3, showNotesEx, x, noteid);
meshserver.send({ action: 'getNotes', id: decodeURIComponent(noteid) });
}
@ -8251,7 +8251,7 @@
function showNotesEx(buttons, tag) {
Q('notesPanelArea').innerHTML = (marked && DOMPurify) ? DOMPurify.sanitize(marked.parse(Q('d2devNotes').value, { breaks: true }), { USE_PROFILES: { html: true } }) : Q('d2devNotes').value;
meshserver.send({ action: 'setNotes', id: decodeURIComponent(tag), notes: encodeURIComponentEx(Q('d2devNotes').value) });
if (showNotesPanel && Q('d2devNotes').value != '') { QV('notesPanel',true); }else{ QV('notesPanel', false); }
if ((showNotesPanel === 'true') && Q('d2devNotes').value != '') { QV('notesPanel',true); }else{ QV('notesPanel', false); }
}
function openIpKvmRemoteControl(nodeid) {
@ -8672,7 +8672,7 @@
// Draw device power bars. The bars are 766px wide.
function drawDeviceTimeline() {
if ((currentNode == null) || (xxcurrentView < 10) || (xxcurrentView > 19) || (currentNode.mtype == 3) || (hidePowerTimeline)) return;
if ((currentNode == null) || (xxcurrentView < 10) || (xxcurrentView > 19) || (currentNode.mtype == 3) || (hidePowerTimeline === 'true')) return;
var timeline = null, now = Date.now();
if (currentNode._id == powerTimelineNode) { timeline = powerTimeline; }

View file

@ -1540,7 +1540,7 @@
<div class="areaHead d-flex align-items-center flex-wrap p-1">
<div class="d-flex align-items-center">
<input value="Refresh" type="button" class="btn btn-primary btn-sm me-2" onclick="refreshServerTimelineStats()" />
<div class="form-check"><input class="form-check-input me-1" type=checkbox id=p40log onclick="updateServerTimelineHours()" / /><label class="form-check-label" for="p40log">Log-X</label></div>
<div class="form-check"><input class="form-check-input me-1" type=checkbox id=p40log onclick="updateServerTimelineHours()" /><label class="form-check-label" for="p40log">Log-X</label></div>
</div>
<div class="toright2 d-flex align-items-center ms-auto">
<select id=p40server style="display:none" onchange=updateServerTimelineStats()></select>
@ -1878,7 +1878,7 @@
<label style="display:block"><input type="checkbox" id="d7rdp4" />Disable Theming</label>
<label style="display:block"><input type="checkbox" id="d7rdp6" />Disable Cursor Shadow</label>
<label style="display:block"><input type="checkbox" id="d7rdp7" />Disable Cursor Settings</label>
<label style="display:block"><input type="checkbox" id="d7rdp8" />Enable Font Smooting</label>
<label style="display:block"><input type="checkbox" id="d7rdp8" />Enable Font Smoothing</label>
<label style="display:block"><input type="checkbox" id="d7rdp9" />Enable Desktop Composision</label>
<label style="display:block"><input type="checkbox" id="d7rdpclip" />Automatic Clipboard</label>
<label style="display:block"><input type="checkbox" id="d7rdpsmb" />Swap Mouse Buttons</label>
@ -1980,8 +1980,8 @@
var sessionTime = parseInt('{{{sessiontime}}}');
var webRelayPort = parseInt('{{{webRelayPort}}}');
var webRelayDns = '{{{webRelayDns}}}';
var hidePowerTimeline = {{{ hidePowerTimeline }}};
var showNotesPanel = {{{ showNotesPanel }}};
var hidePowerTimeline = '{{{hidePowerTimeline}}}';
var showNotesPanel = '{{{showNotesPanel}}}';
var sessionRefreshTimer = null;
var domain = '{{{domain}}}';
var domainUrl = '{{{domainurl}}}';
@ -2010,7 +2010,7 @@
var footerBar = (getstore('footerBar', '1') == '1');
var sessionActivity = Date.now();
var updateSessionTimer = null;
var pluginHandlerBuilder = {{{ pluginHandler }}};
var pluginHandlerBuilder = {{{pluginHandler}}};
var pluginHandler = null;
if (pluginHandlerBuilder != null) { pluginHandler = new pluginHandlerBuilder(); }
var installedPluginList = null;
@ -3482,7 +3482,7 @@
}
} else {
Q('notesPanelArea').innerHTML = (message.notes && marked && DOMPurify) ? DOMPurify.sanitize(marked.parse(decodeURIComponent(message.notes), { breaks: true }), { USE_PROFILES: { html: true } }) : '';
if (showNotesPanel && message.notes) { QV('notesPanel', true); } else { QV('notesPanel', false); }
if ((showNotesPanel === 'true') && message.notes) { QV('notesPanel', true); } else { QV('notesPanel', false); }
}
break;
}
@ -8919,7 +8919,7 @@
if (noteid == null) { noteid = encodeURIComponentEx('p' + userinfo._id); }
var x = '<textarea id=d2devNotes ro=' + readonly + ' noteid=' + noteid + ' readonly class="form-control" style=width:100%;height:200px;resize:none;overflow-y:scroll></textarea>';
if (noteid.startsWith('node%2F%2F')) { x += '<span style=font-size:10px>' + "Device group notes can be viewed and changed by other device group administrators." + '<span>'; }
if (showNotesPanel) { x += ' <span style=font-size:10px><a target=_blank href=\'https://www.markdownguide.org/cheat-sheet/\'>' + "Markdown syntax supported" + '</a></span>'; }
if (showNotesPanel === 'true') { x += ' <span style=font-size:10px><a target=_blank href=\'https://www.markdownguide.org/cheat-sheet/\'>' + "Markdown syntax supported" + '</a></span>'; }
setModalContent('xxAddAgent', "Notes", x);
showModal('xxAddAgentModal', 'idx_dlgOkButton', function () {
showNotesEx(2, noteid);
@ -8931,7 +8931,7 @@
function showNotesEx(buttons, tag) {
Q('notesPanelArea').innerHTML = (marked && DOMPurify) ? DOMPurify.sanitize(marked.parse(Q('d2devNotes').value, { breaks: true }), { USE_PROFILES: { html: true } }) : Q('d2devNotes').value;
meshserver.send({ action: 'setNotes', id: decodeURIComponent(tag), notes: encodeURIComponentEx(Q('d2devNotes').value) });
if (showNotesPanel && Q('d2devNotes').value != '') { QV('notesPanel', true); } else { QV('notesPanel', false); }
if ((showNotesPanel === 'true') && Q('d2devNotes').value != '') { QV('notesPanel', true); } else { QV('notesPanel', false); }
}
function openIpKvmRemoteControl(nodeid) {
@ -9376,7 +9376,7 @@
// Draw device power bars. The bars are 766px wide.
function drawDeviceTimeline() {
if ((currentNode == null) || (xxcurrentView < 10) || (xxcurrentView > 19) || (currentNode.mtype == 3) || (hidePowerTimeline)) return;
if ((currentNode == null) || (xxcurrentView < 10) || (xxcurrentView > 19) || (currentNode.mtype == 3) || (hidePowerTimeline === 'true')) return;
var timeline = null, now = Date.now();
if (currentNode._id == powerTimelineNode) { timeline = powerTimeline; }