Add onDesktopDisconnect hook, refactor plugin hooks on front end to be variable
This commit is contained in:
parent
942eafb70d
commit
786934b72c
|
@ -66,13 +66,15 @@ module.exports.pluginHandler = function (parent) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
str += `obj.onDeviceRefeshEnd = function(nodeid, panel, refresh, event) {
|
str += `
|
||||||
|
obj.callHook = function(hookName, ...args) {
|
||||||
for (const p of Object.keys(obj)) {
|
for (const p of Object.keys(obj)) {
|
||||||
if (typeof obj[p].onDeviceRefreshEnd == 'function') {
|
if (typeof obj[p][hookName] == 'function') {
|
||||||
obj[p].onDeviceRefreshEnd(nodeid, panel, refresh, event);
|
obj[p][hookName](args);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
obj.registerPluginTab = function(pluginRegInfo) {
|
obj.registerPluginTab = function(pluginRegInfo) {
|
||||||
var d = pluginRegInfo();
|
var d = pluginRegInfo();
|
||||||
if (!Q(d.tabId)) {
|
if (!Q(d.tabId)) {
|
||||||
|
|
|
@ -4540,7 +4540,7 @@
|
||||||
p13clearConsoleMsg();
|
p13clearConsoleMsg();
|
||||||
|
|
||||||
// Device refresh plugin handler
|
// Device refresh plugin handler
|
||||||
if (pluginHandler != null) { pluginHandler.onDeviceRefeshEnd(nodeid, panel, refresh, event); }
|
if (pluginHandler != null) { pluginHandler.callHook('onDeviceRefreshEnd', nodeid, panel, refresh, event); }
|
||||||
}
|
}
|
||||||
setupDesktop(); // Always refresh the desktop, even if we are on the same device, we need to do some canvas switching.
|
setupDesktop(); // Always refresh the desktop, even if we are on the same device, we need to do some canvas switching.
|
||||||
if (!panel) panel = 10;
|
if (!panel) panel = 10;
|
||||||
|
@ -5201,6 +5201,7 @@
|
||||||
desktop.Stop();
|
desktop.Stop();
|
||||||
webRtcDesktopReset();
|
webRtcDesktopReset();
|
||||||
desktopNode = desktop = null;
|
desktopNode = desktop = null;
|
||||||
|
if (pluginHandler != null) { pluginHandler.callHook('onDesktopDisconnect'); }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue