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

More plugin hooks / development of base

This commit is contained in:
Ryan Blenis 2019-10-08 04:18:40 -04:00
parent 36931698ad
commit d143990f31
6 changed files with 200 additions and 17 deletions

View file

@ -122,6 +122,7 @@
<td tabindex=0 id=MainDevInfo class="topbar_td style3x" onclick=go(17,event) onkeypress="if (event.key == 'Enter') go(17)">Details</td>
<td tabindex=0 id=MainDevAmt class="topbar_td style3x" onclick=go(14,event) onkeypress="if (event.key == 'Enter') go(14)">Intel&reg; AMT</td>
<td tabindex=0 id=MainDevConsole class="topbar_td style3x" onclick=go(15,event) onkeypress="if (event.key == 'Enter') go(15)">Console</td>
<td tabindex=0 id=MainDevPlugins class="topbar_td style3x" onclick=go(19,event) onkeypress="if (event.key == 'Enter') go(19)">Plugins</td>
<td class="topbar_td_end style3">&nbsp;</td>
</tr>
</table>
@ -841,6 +842,12 @@
</div>
<div id=p41events style=""></div>
</div>
<div id=p19 style="display:none">
<h1>Plugins - <span id=p19deviceName></span></h1>
<div class="p19headers">
</div>
<div id=p19pages style=""></div>
</div>
<br id="column_l_bottomgap" />
</div>
<div id="footer">
@ -1008,6 +1015,7 @@
var nightMode = (getstore('_nightMode', '0') == '1');
var sessionActivity = Date.now();
var updateSessionTimer = null;
var pluginHandler = {{{pluginHandler}}};
// Console Message Display Timers
var p11DeskConsoleMsgTimer = null;
@ -2298,6 +2306,17 @@
QH('p0span', message.msg);
break;
}
case 'plugin': {
if (typeof message.plugin == 'string') {
try {
var ph = pluginHandler();
ph[message.plugin][message.method](server, message);
} catch (e) {
console.log('Error loading plugin handler ('+ e + ')');
}
}
break;
}
default:
//console.log('Unknown message.action', message.action);
break;
@ -9090,7 +9109,7 @@
QV('MeshSubMenuSpan', x >= 20 && x < 30);
QV('UserSubMenuSpan', x >= 30 && x < 40);
QV('ServerSubMenuSpan', x == 6 || x == 115 || x == 40 || x == 41);
var panels = { 10: 'MainDev', 11: 'MainDevDesktop', 12: 'MainDevTerminal', 13: 'MainDevFiles', 14: 'MainDevAmt', 15: 'MainDevConsole', 16: 'MainDevEvents', 17: 'MainDevInfo', 20: 'MeshGeneral', 30: 'UserGeneral', 31: 'UserEvents', 6: 'ServerGeneral', 40: 'ServerStats', 41: 'ServerTrace', 115: 'ServerConsole' };
var panels = { 10: 'MainDev', 11: 'MainDevDesktop', 12: 'MainDevTerminal', 13: 'MainDevFiles', 14: 'MainDevAmt', 15: 'MainDevConsole', 16: 'MainDevEvents', 17: 'MainDevInfo', 20: 'MeshGeneral', 30: 'UserGeneral', 31: 'UserEvents', 6: 'ServerGeneral', 40: 'ServerStats', 41: 'ServerTrace', 19: 'Plugins', 115: 'ServerConsole' };
for (var i in panels) {
QC(panels[i]).remove('style3x');
QC(panels[i]).remove('style3sel');