This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user