fix customui with modern ui #7517

Signed-off-by: si458 <simonsmith5521@gmail.com>

si458 committed Dec 26, 2025 at 15:17 UTC 8e766aee8a4e1b12caf1b30e9094bf86be3090f2
1 file changed +12 -12
views/default3.handlebars
+12 -12
@@ -2339,26 +2339,26 @@
2339 // Custom UI
2340 if (customui != null) {
2341 if (customui.devicesbarbuttons) {
2342 - var x = '';
2342 + var x = '&nbsp;';
2343 for (var i in customui.devicesbarbuttons) {
2344 var disabled = ((customui.devicesbarbuttons[i].selection == 'one') || (customui.devicesbarbuttons[i].selection == 'many')) ? 'disabled' : '';
2345 - x += '<input id="cui:' + i + '" type="button" value="' + customui.devicesbarbuttons[i].name + '" ' + disabled + ' onclick=customUIAction(event,"devicesbarbuttons") />';
2345 + x += '<input id="cui:' + i + '" type="button" class="btn btn-secondary" value="' + customui.devicesbarbuttons[i].name + '" ' + disabled + ' onclick=customUIAction(event,"devicesbarbuttons") />&nbsp;';
2346 }
2347 QH('devsCustomUIBar', x);
2348 }
2349 if (customui.desktopbuttons) {
2350 - var x = '';
2351 - for (var i in customui.desktopbuttons) { x += '<input id="cui:' + i + '" type="button" value="' + customui.desktopbuttons[i].name + '" style="float:left" onclick=customUIAction(event,"desktopbuttons") />'; }
2350 + var x = '&nbsp;';
2351 + for (var i in customui.desktopbuttons) { x += '<input id="cui:' + i + '" type="button" class="btn btn-secondary" value="' + customui.desktopbuttons[i].name + '" style="float:left" onclick=customUIAction(event,"desktopbuttons") />&nbsp;'; }
2352 QH('desktopCustomUiButtons', x);
2353 }
2354 if (customui.terminalbuttons) {
2355 - var x = '';
2356 - for (var i in customui.terminalbuttons) { x += '<input id="cui:' + i + '" type="button" value="' + customui.terminalbuttons[i].name + '" style="float:left" onclick=customUIAction(event,"terminalbuttons") />'; }
2355 + var x = '&nbsp;';
2356 + for (var i in customui.terminalbuttons) { x += '<input id="cui:' + i + '" type="button" class="btn btn-secondary" value="' + customui.terminalbuttons[i].name + '" style="float:left" onclick=customUIAction(event,"terminalbuttons") />&nbsp;'; }
2357 QH('terminalCustomUiButtons', x);
2358 }
2359 if (customui.filesbuttons) {
2360 - var x = '';
2361 - for (var i in customui.filesbuttons) { x += '<input id="cui:' + i + '" type="button" value="' + customui.filesbuttons[i].name + '" style="float:left" onclick=customUIAction(event,"filesbuttons") />'; }
2360 + var x = '&nbsp;';
2361 + for (var i in customui.filesbuttons) { x += '<input id="cui:' + i + '" type="button" class="btn btn-secondary" value="' + customui.filesbuttons[i].name + '" style="float:left" onclick=customUIAction(event,"filesbuttons") />&nbsp;'; }
2362 QH('filesCustomUiButtons', x);
2363 }
2364 }
@@ -2444,18 +2444,18 @@
2444 if (elem.name == null) {
2445 x += '<textarea id=cui:' + i + ' style=width:356px;resize:none;height:100px autocomplete=off></textarea>';
2446 } else {
2447 - x += addHtmlFormFloating(elem.name, '<textarea id=cui:' + i + ' style=width:230px;resize:none;height:100px autocomplete=off></textarea>');
2447 + x += addHtmlFormFloating(elem.name, '<textarea class=form-control id=cui:' + i + ' style=resize:none;height:100px autocomplete=off></textarea>');
2448 }
2449 }
2450 if (elem.type == 'droplist') {
2451 var y = '';
2452 for (var j in elem.options) { y += '<option value="' + j + '">' + EscapeHtml(elem.options[j]) + '</option>'; }
2453 - x += addHtmlFormFloating(elem.name, '<select id="cui:' + i + '" class=form-select autocomplete=off />' + y + '</select>');
2453 + x += addHtmlFormFloating(elem.name, '<select class=form-select id="cui:' + i + '" class=form-select autocomplete=off />' + y + '</select>');
2454 }
2455 }
2456 }
2457 setModalContent('xxAddAgent', dialog.title, x);
2458 - showModal('xxAddAgentModal', 'idx_dlgOkButton', { action: 'uicustomevent', section: 'dialogs', element: name, src: tag, values: {}, logmsg: dialog.logmsg })
2458 + showModal('xxAddAgentModal', 'idx_dlgOkButton', () => showCustomUiDialogEx(1, { action: 'uicustomevent', section: 'dialogs', element: name, src: tag, values: {}, logmsg: dialog.logmsg }) );
2459 }
2460
2461 // Handle a generic custom UI dialog event
@@ -8725,7 +8725,7 @@
8725 if ((customui != null) && (customui.devicebuttons != null)) {
8726 for (var i in customui.devicebuttons) {
8727 if ((customui.devicebuttons[i].showif == null) || ((mesh != null) && (customui.devicebuttons[i].showif == mesh._id)) || (customui.devicebuttons[i].showif == currentNode._id)) {
8728 - x += '<input id="cui:' + i + '" type="button" class="btn btn-primary btn-sm me-2" value="' + customui.devicebuttons[i].name + '" onclick=customUIAction(event,"devicebuttons") />';
8728 + x += '<input id="cui:' + i + '" type="button" class="btn btn-primary btn-sm me-2" value="' + customui.devicebuttons[i].name + '" onclick=customUIAction(event,"devicebuttons") />&nbsp;';
8729 }
8730 }
8731 }