Fix CLI command preview scope

This commit is contained in:
thakares committed 2026-09-02 16:34:05 +05:30
1 parent edc710cbd2
commit f1eff160c3
2 files changed
+9 -2

No files matched your search

@@ -2353,7 +2353,7 @@
}
}
function updateCliCommandPreview() {
window.updateCliCommandPreview = function() {
const preview = document.getElementById('cli-constructed-cmd');
const execBtn = document.getElementById('cli-exec-btn');
if (!preview || !execBtn) return;
@@ -2407,7 +2407,7 @@
preview.textContent = parts.join(' ');
execBtn.disabled = !canExecute;
}
};
window.executeCliConsoleCommand = async function() {
const execBtn = document.getElementById('cli-exec-btn');
@@ -124,6 +124,13 @@ async fn test_ui_spa_index_and_stylesheet_endpoints() {
assert!(html.contains("openClientExportModal"));
assert!(html.contains("openAddPeerModal"));
// CLI console global preview and handler exposure
assert!(html.contains("window.updateCliCommandPreview"));
assert!(html.contains("window.onCliCommandChange"));
assert!(html.contains("window.onCliSubcommandChange"));
assert!(html.contains("window.onCliSubSubcommandChange"));
assert!(html.contains("window.executeCliConsoleCommand"));
// Peer enrollment must submit the selected Network UUID as network_id,
// never the display name or CIDR.
assert!(html.contains(r#"value="${n.id}""#));