diff --git a/src/ui/Apps/Host Manager/HostManagerHostViewer.tsx b/src/ui/Apps/Host Manager/HostManagerHostViewer.tsx index 33574649..16d6012a 100644 --- a/src/ui/Apps/Host Manager/HostManagerHostViewer.tsx +++ b/src/ui/Apps/Host Manager/HostManagerHostViewer.tsx @@ -86,6 +86,37 @@ export function HostManagerHostViewer({onEditHost}: SSHManagerHostViewerProps) { } }; + const handleExport = (host: SSHHost) => { + const exportData = { + name: host.name, + ip: host.ip, + port: host.port, + username: host.username, + authType: host.authType, + folder: host.folder, + tags: host.tags, + pin: host.pin, + enableTerminal: host.enableTerminal, + enableTunnel: host.enableTunnel, + enableFileManager: host.enableFileManager, + defaultPath: host.defaultPath, + tunnelConnections: host.tunnelConnections, + }; + + const blob = new Blob([JSON.stringify(exportData, null, 2)], { type: 'application/json' }); + const url = URL.createObjectURL(blob); + const a = document.createElement('a'); + a.href = url; + a.download = `${host.name || host.username + '@' + host.ip}-credentials.json`; + document.body.appendChild(a); + a.click(); + document.body.removeChild(a); + URL.revokeObjectURL(url); + + toast.success(`Exported credentials for ${host.name || host.username}@${host.ip}`); +}; + + const handleEdit = (host: SSHHost) => { if (onEditHost) { onEditHost(host); @@ -427,6 +458,18 @@ export function HostManagerHostViewer({onEditHost}: SSHManagerHostViewerProps) { > + +