mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2024-11-26 07:57:56 +03:00
Fixed notification translation.
This commit is contained in:
parent
cb8fc7d150
commit
21e6b0320b
1826
db-good.js
Normal file
1826
db-good.js
Normal file
File diff suppressed because it is too large
Load Diff
28
db.js
28
db.js
@ -40,8 +40,10 @@ module.exports.CreateDB = function (parent, func) {
|
|||||||
obj.pluginsActive = ((parent.config) && (parent.config.settings) && (parent.config.settings.plugins != null) && (parent.config.settings.plugins != false) && ((typeof parent.config.settings.plugins != 'object') || (parent.config.settings.plugins.enabled != false)));
|
obj.pluginsActive = ((parent.config) && (parent.config.settings) && (parent.config.settings.plugins != null) && (parent.config.settings.plugins != false) && ((typeof parent.config.settings.plugins != 'object') || (parent.config.settings.plugins.enabled != false)));
|
||||||
|
|
||||||
// MongoDB bulk write state
|
// MongoDB bulk write state
|
||||||
|
/*
|
||||||
obj.filePendingGet = null;
|
obj.filePendingGet = null;
|
||||||
obj.filePendingGets = null;
|
obj.filePendingGets = null;
|
||||||
|
*/
|
||||||
obj.filePendingSet = false;
|
obj.filePendingSet = false;
|
||||||
obj.filePendingSets = null;
|
obj.filePendingSets = null;
|
||||||
obj.filePendingCb = null;
|
obj.filePendingCb = null;
|
||||||
@ -1058,7 +1060,30 @@ module.exports.CreateDB = function (parent, func) {
|
|||||||
if (func != null) { if (obj.filePendingCb == null) { obj.filePendingCb = [ func ]; } else { obj.filePendingCb.push(func); } }
|
if (func != null) { if (obj.filePendingCb == null) { obj.filePendingCb = [ func ]; } else { obj.filePendingCb.push(func); } }
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
obj.Get = function (id, func) {
|
||||||
|
if (arguments.length > 2) {
|
||||||
|
var parms = [func];
|
||||||
|
for (var parmx = 2; parmx < arguments.length; ++parmx) { parms.push(arguments[parmx]); }
|
||||||
|
var func2 = function _func2(arg1, arg2) {
|
||||||
|
var userCallback = _func2.userArgs.shift();
|
||||||
|
_func2.userArgs.unshift(arg2);
|
||||||
|
_func2.userArgs.unshift(arg1);
|
||||||
|
userCallback.apply(obj, _func2.userArgs);
|
||||||
|
};
|
||||||
|
func2.userArgs = parms;
|
||||||
|
obj.file.find({ _id: id }).toArray(function (err, docs) {
|
||||||
|
if ((docs != null) && (docs.length > 0) && (docs[0].links != null)) { docs[0] = common.unEscapeLinksFieldName(docs[0]); }
|
||||||
|
func2(err, performTypedRecordDecrypt(docs));
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
obj.file.find({ _id: id }).toArray(function (err, docs) {
|
||||||
|
if ((docs != null) && (docs.length > 0) && (docs[0].links != null)) { docs[0] = common.unEscapeLinksFieldName(docs[0]); }
|
||||||
|
func(err, performTypedRecordDecrypt(docs));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
/*
|
||||||
obj.Get = function (id, func) { // Fast Get operation using a bulk find() to reduce round trips to the database.
|
obj.Get = function (id, func) { // Fast Get operation using a bulk find() to reduce round trips to the database.
|
||||||
// Encode arguments into return function if any are present.
|
// Encode arguments into return function if any are present.
|
||||||
var func2 = func;
|
var func2 = func;
|
||||||
@ -1085,6 +1110,7 @@ module.exports.CreateDB = function (parent, func) {
|
|||||||
if (obj.filePendingGet[id] == null) { obj.filePendingGet[id] = [func2]; } else { obj.filePendingGet[id].push(func2); }
|
if (obj.filePendingGet[id] == null) { obj.filePendingGet[id] = [func2]; } else { obj.filePendingGet[id].push(func2); }
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
*/
|
||||||
|
|
||||||
obj.GetAll = function (func) { obj.file.find({}).toArray(function (err, docs) { func(err, performTypedRecordDecrypt(docs)); }); };
|
obj.GetAll = function (func) { obj.file.find({}).toArray(function (err, docs) { func(err, performTypedRecordDecrypt(docs)); }); };
|
||||||
obj.GetHash = function (id, func) { obj.file.find({ _id: id }).project({ _id: 0, hash: 1 }).toArray(function (err, docs) { func(err, performTypedRecordDecrypt(docs)); }); };
|
obj.GetHash = function (id, func) { obj.file.find({ _id: id }).project({ _id: 0, hash: 1 }).toArray(function (err, docs) { func(err, performTypedRecordDecrypt(docs)); }); };
|
||||||
@ -1467,6 +1493,7 @@ module.exports.CreateDB = function (parent, func) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
// MongoDB pending bulk read operation, perform fast bulk document reads.
|
// MongoDB pending bulk read operation, perform fast bulk document reads.
|
||||||
function fileBulkReadCompleted(err, docs) {
|
function fileBulkReadCompleted(err, docs) {
|
||||||
// Send out callbacks with results
|
// Send out callbacks with results
|
||||||
@ -1490,6 +1517,7 @@ module.exports.CreateDB = function (parent, func) {
|
|||||||
obj.file.find({ _id: { $in: findlist } }).toArray(fileBulkReadCompleted);
|
obj.file.find({ _id: { $in: findlist } }).toArray(fileBulkReadCompleted);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
// MongoDB pending bulk write operation, perform fast bulk document replacement.
|
// MongoDB pending bulk write operation, perform fast bulk document replacement.
|
||||||
function fileBulkWriteCompleted() {
|
function fileBulkWriteCompleted() {
|
||||||
|
2
public/scripts/amt-wsman-0.2.0-min.js
vendored
2
public/scripts/amt-wsman-0.2.0-min.js
vendored
File diff suppressed because one or more lines are too long
@ -4856,7 +4856,7 @@
|
|||||||
"SMS error: {0}"
|
"SMS error: {0}"
|
||||||
];
|
];
|
||||||
if (typeof n.titleid == 'number') { try { n.title = translatedTitles[n.titleid]; } catch (ex) { } }
|
if (typeof n.titleid == 'number') { try { n.title = translatedTitles[n.titleid]; } catch (ex) { } }
|
||||||
if (typeof n.msgid == 'number') { try { n.text = translatedMessages[n.msgid]; if (Array.isArray(n.args)) { format(n.text, ...n.args); } } catch (ex) { } }
|
if (typeof n.msgid == 'number') { try { n.text = translatedMessages[n.msgid]; if (Array.isArray(n.args)) { n.text = format(n.text, ...n.args); } } catch (ex) { } }
|
||||||
|
|
||||||
// Show notification within the web page.
|
// Show notification within the web page.
|
||||||
if (n.time == null) { n.time = Date.now(); }
|
if (n.time == null) { n.time = Date.now(); }
|
||||||
|
@ -13325,7 +13325,7 @@
|
|||||||
"SMS error: {0}"
|
"SMS error: {0}"
|
||||||
];
|
];
|
||||||
if (typeof n.titleid == 'number') { try { n.title = translatedTitles[n.titleid]; } catch (ex) {} }
|
if (typeof n.titleid == 'number') { try { n.title = translatedTitles[n.titleid]; } catch (ex) {} }
|
||||||
if (typeof n.msgid == 'number') { try { n.text = translatedMessages[n.msgid]; if (Array.isArray(n.args)) { format(n.text, ...n.args); } } catch (ex) {} }
|
if (typeof n.msgid == 'number') { try { n.text = translatedMessages[n.msgid]; if (Array.isArray(n.args)) { n.text = format(n.text, ...n.args); } } catch (ex) {} }
|
||||||
|
|
||||||
// Show notification within the web page.
|
// Show notification within the web page.
|
||||||
if (n.time == null) { n.time = Date.now(); }
|
if (n.time == null) { n.time = Date.now(); }
|
||||||
|
Loading…
Reference in New Issue
Block a user