feat(runtime): add SSH command bridge
test / workspace (push) Successful in 12m10s

This commit is contained in:
Tom You
2026-07-09 00:20:43 -05:00
parent 6e08e0e7bc
commit fb5a02821e
6 changed files with 225 additions and 0 deletions
+22
View File
@@ -185,6 +185,27 @@ function wireTerminalActions() {
if (button) button.addEventListener('click', runLocalTerminalCommand);
}
async function runSshCommand() {
const host = document.getElementById('ssh-host').value;
const user = document.getElementById('ssh-user').value || null;
const command = document.getElementById('ssh-command').value;
const output = document.getElementById('ssh-output');
output.textContent = 'Connecting…';
try {
const tauri = window.__TAURI__?.core;
if (!tauri) throw new Error('Tauri bridge unavailable in browser preview');
const result = await tauri.invoke('run_ssh_command', { host, user, port: 22, command });
output.textContent = [`ssh ${host} ${command}`, `exit ${result.exit_code}`, result.stdout, result.stderr].filter(Boolean).join('\n');
} catch (error) {
output.textContent = String(error);
}
}
function wireSshActions() {
const button = document.getElementById('run-ssh');
if (button) button.addEventListener('click', runSshCommand);
}
async function boot() {
const [dashboard, features] = await Promise.all([
invokeOrFallback('wallet_dashboard', fallbackDashboard),
@@ -195,6 +216,7 @@ async function boot() {
wireVaultActions();
wireSettingsActions();
wireTerminalActions();
wireSshActions();
}
boot();