diff --git a/apps/ui/js/wizard.js b/apps/ui/js/wizard.js
index 2f49b29..118024f 100644
--- a/apps/ui/js/wizard.js
+++ b/apps/ui/js/wizard.js
@@ -344,6 +344,22 @@ function updateUpstreamAuthUi() {
updateAuthProfileCreateUi();
}
+function buildUpstreamTriggerContent(name, url) {
+ var fragment = document.createDocumentFragment();
+ fragment.appendChild(createDivWithClass('upstream-trigger-name', name));
+ fragment.appendChild(createDivWithClass('upstream-trigger-url', url));
+ return fragment;
+}
+
+function setUpstreamComboboxPlaceholder(container) {
+ if (!container) return;
+ container.innerHTML = '';
+ var placeholder = document.createElement('span');
+ placeholder.className = 'upstream-combobox-placeholder';
+ placeholder.textContent = tKey('wizard.step2.upstream_placeholder');
+ container.appendChild(placeholder);
+}
+
function renderDropdownList(filter) {
var list = document.getElementById('upstream-dropdown-list');
if (!list) return;
@@ -353,7 +369,11 @@ function renderDropdownList(filter) {
});
if (filtered.length === 0) {
- list.innerHTML = '
' + tfKey('agents.drawer.ops_no_match', { query: escapeHtml(filter) }) + '
';
+ list.innerHTML = '';
+ var empty = document.createElement('div');
+ empty.className = 'upstream-dropdown-empty';
+ empty.textContent = tfKey('agents.drawer.ops_no_match', { query: filter || '' });
+ list.appendChild(empty);
return;
}
@@ -428,9 +448,8 @@ function pickUpstream(id) {
trigNode.querySelector('.upstream-trigger-url').textContent = u.url;
val.appendChild(trigNode);
} else {
- val.innerHTML =
- '' + escapeHtml(u.name) + '
' +
- '' + escapeHtml(u.url) + '
';
+ val.innerHTML = '';
+ val.appendChild(buildUpstreamTriggerContent(u.name, u.url));
}
}
@@ -477,7 +496,7 @@ function startNewUpstream() {
// Clear combobox trigger & hide preview
var val = document.getElementById('upstream-combobox-value');
- if (val) val.innerHTML = '' + tKey('wizard.step2.upstream_placeholder') + '';
+ if (val) setUpstreamComboboxPlaceholder(val);
var preview = document.getElementById('upstream-preview');
if (preview) preview.style.display = 'none';
selectedUpstreamId = null;
@@ -1889,9 +1908,8 @@ function prefillUpstream(baseUrl, headers, authProfileRef) {
var valueEl = document.getElementById('upstream-combobox-value');
if (valueEl) {
- valueEl.innerHTML =
- 'imported-upstream
' +
- '' + escapeHtml(baseUrl) + '
';
+ valueEl.innerHTML = '';
+ valueEl.appendChild(buildUpstreamTriggerContent('imported-upstream', baseUrl));
}
}