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.
TheDevRyan committed
Nov 17, 2025 at 10:34 UTC
208ddddf534f4e3a2a9491561225662b853ac857
1 file changed
+9
-2
pluginHandler.js
+9
-2
@@ -115,8 +115,15 @@ module.exports.pluginHandler = function (parent) {
115
meshserver.send({ action: 'addplugin', url: Q('pluginurlinput').value});
116
};
117
obj.addPluginDlg = function() {
118
- 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://" />');
119
- focusTextBox('pluginurlinput');
118
+ if (typeof showModal === 'function') {
119
+ 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://" />');
120
+ showModal('xxAddAgentModal', 'idx_dlgOkButton', obj.addPluginEx);
121
+ focusTextBox('pluginurlinput');
122
+ } else {
123
+ // Fallback to setDialogMode for default.handlebars
124
+ 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://" />');
125
+ focusTextBox('pluginurlinput');
126
+ }
127
};
128
obj.refreshPluginHandler = function() {
129
let st = document.createElement('script');