mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2025-11-20 09:56:03 -05:00
Add modal support to plugin add dialog (#7432)
Enhanced the addPluginDlg function to use showModal when available, improving compatibility with different UI templates. Falls back to setDialogMode for environments without showModal.
This commit is contained in:
@@ -115,8 +115,15 @@ module.exports.pluginHandler = function (parent) {
|
||||
meshserver.send({ action: 'addplugin', url: Q('pluginurlinput').value});
|
||||
};
|
||||
obj.addPluginDlg = function() {
|
||||
setDialogMode(2, "Plugin Download URL", 3, obj.addPluginEx, '<p><b>WARNING:</b> Downloading plugins may compromise server security. Only download from trusted sources.</p><input type=text id=pluginurlinput style=width:100% placeholder="https://" />');
|
||||
focusTextBox('pluginurlinput');
|
||||
if (typeof showModal === 'function') {
|
||||
setDialogMode(2, "Plugin Download URL", 3, obj.addPluginEx, '<p><b>WARNING:</b> Downloading plugins may compromise server security. Only download from trusted sources.</p><input type=text id=pluginurlinput style=width:100% placeholder="https://" />');
|
||||
showModal('xxAddAgentModal', 'idx_dlgOkButton', obj.addPluginEx);
|
||||
focusTextBox('pluginurlinput');
|
||||
} else {
|
||||
// Fallback to setDialogMode for default.handlebars
|
||||
setDialogMode(2, "Plugin Download URL", 3, obj.addPluginEx, '<p><b>WARNING:</b> Downloading plugins may compromise server security. Only download from trusted sources.</p><input type=text id=pluginurlinput style=width:100% placeholder="https://" />');
|
||||
focusTextBox('pluginurlinput');
|
||||
}
|
||||
};
|
||||
obj.refreshPluginHandler = function() {
|
||||
let st = document.createElement('script');
|
||||
|
||||
Reference in New Issue
Block a user