From 208ddddf534f4e3a2a9491561225662b853ac857 Mon Sep 17 00:00:00 2001 From: TheDevRyan <175502913+The-Dev-Ryan@users.noreply.github.com> Date: Mon, 17 Nov 2025 10:34:15 +0000 Subject: [PATCH] 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. --- pluginHandler.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/pluginHandler.js b/pluginHandler.js index 4b8f5b81..011e0e94 100644 --- a/pluginHandler.js +++ b/pluginHandler.js @@ -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, '

WARNING: Downloading plugins may compromise server security. Only download from trusted sources.

'); - focusTextBox('pluginurlinput'); + if (typeof showModal === 'function') { + setDialogMode(2, "Plugin Download URL", 3, obj.addPluginEx, '

WARNING: Downloading plugins may compromise server security. Only download from trusted sources.

'); + showModal('xxAddAgentModal', 'idx_dlgOkButton', obj.addPluginEx); + focusTextBox('pluginurlinput'); + } else { + // Fallback to setDialogMode for default.handlebars + setDialogMode(2, "Plugin Download URL", 3, obj.addPluginEx, '

WARNING: Downloading plugins may compromise server security. Only download from trusted sources.

'); + focusTextBox('pluginurlinput'); + } }; obj.refreshPluginHandler = function() { let st = document.createElement('script');