mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2025-03-09 15:40:18 +00:00
Add onDesktopDisconnect hook, refactor plugin hooks on front end to be variable
This commit is contained in:
parent
942eafb70d
commit
786934b72c
2 changed files with 8 additions and 5 deletions
|
@ -66,13 +66,15 @@ module.exports.pluginHandler = function (parent) {
|
|||
}
|
||||
}
|
||||
|
||||
str += `obj.onDeviceRefeshEnd = function(nodeid, panel, refresh, event) {
|
||||
for (const p of Object.keys(obj)) {
|
||||
if (typeof obj[p].onDeviceRefreshEnd == 'function') {
|
||||
obj[p].onDeviceRefreshEnd(nodeid, panel, refresh, event);
|
||||
str += `
|
||||
obj.callHook = function(hookName, ...args) {
|
||||
for (const p of Object.keys(obj)) {
|
||||
if (typeof obj[p][hookName] == 'function') {
|
||||
obj[p][hookName](args);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
obj.registerPluginTab = function(pluginRegInfo) {
|
||||
var d = pluginRegInfo();
|
||||
if (!Q(d.tabId)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue