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

Added file context menu for device files.

This commit is contained in:
Ylian Saint-Hilaire 2020-02-14 11:20:06 -08:00
parent cc64467df7
commit c6bd8c3a19
9 changed files with 2208 additions and 1695 deletions

View file

@ -803,7 +803,7 @@ module.exports.CertificateOperations = function (parent) {
accelerator.accid = acceleratorCreateCount;
accelerator.on('message', function (message) {
acceleratorMessage++;
this.x.func(this.x.tag, message);
if (this.x.func) { this.x.func(this.x.tag, message); }
delete this.x;
if (pendingAccelerator.length > 0) { this.send(this.x = pendingAccelerator.shift()); } else { freeAccelerators.push(this); }
});
@ -850,5 +850,24 @@ module.exports.CertificateOperations = function (parent) {
}
};
// Perform any general operation
obj.acceleratorPerformOperation = function (operation, data, tag, func) {
if (acceleratorTotalCount <= 1) {
// No accelerators available
program.processMessage({ action: operation, data: data, tag: tag, func: func });
} else {
var acc = obj.getAccelerator();
if (acc == null) {
// Add to pending accelerator workload
acceleratorPerformSignaturePushFuncCall++;
pendingAccelerator.push({ action: operation, data: data, tag: tag, func: func });
} else {
// Send to accelerator now
acceleratorPerformSignatureRunFuncCall++;
acc.send(acc.x = { action: operation, data: data, tag: tag, func: func });
}
}
};
return obj;
};