From aa04597e1641f179f02e46c1fbce2064d7659f19 Mon Sep 17 00:00:00 2001 From: Shivam Kumar <155747305+maishivamhoo123@users.noreply.github.com> Date: Mon, 8 Sep 2025 10:30:46 +0530 Subject: [PATCH] feat: add export option for ssh hosts (#173) (#187) * Update issue templates * feat: add export JSON option for SSH hosts (#173) --------- Co-authored-by: Karmaa <88517757+LukeGus@users.noreply.github.com> Co-authored-by: LukeGus --- .github/ISSUE_TEMPLATE/bug_report.md | 31 +++++++++++++ .github/ISSUE_TEMPLATE/feature_request.md | 20 +++++++++ .../Host Manager/HostManagerHostViewer.tsx | 43 +++++++++++++++++++ 3 files changed, 94 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/bug_report.md create mode 100644 .github/ISSUE_TEMPLATE/feature_request.md diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 00000000..aa45c083 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,31 @@ +--- +name: Bug report +about: Create a report to help Termix improve +title: "[BUG]" +labels: bug +assignees: '' + +--- + +**Describe the bug** +A clear and concise description of what the bug is. + +**To Reproduce** +Steps to reproduce the behavior: +1. Go to '...' +2. Click on '....' +3. Scroll down to '....' +4. See error + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Screenshots/Logs** +If applicable, add screenshots or console/Docker logs to help explain your problem. + +**Environment (please complete the following information):** + - Browser [e.g. chrome, safari] + - Version [e.g. 1.6.0] + +**Additional context** +Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 00000000..6051e2ef --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,20 @@ +--- +name: Feature request +about: Suggest an idea for Termix +title: "[FEATURE]" +labels: enhancement +assignees: '' + +--- + +**Is your feature request related to a problem? Please describe.** +A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + +**Describe the solution you'd like** +A clear and concise description of what you want to happen. + +**Describe alternatives you've considered** +A clear and concise description of any alternative solutions or features you've considered. + +**Additional context** +Add any other context or screenshots about the feature request here. diff --git a/src/ui/Desktop/Apps/Host Manager/HostManagerHostViewer.tsx b/src/ui/Desktop/Apps/Host Manager/HostManagerHostViewer.tsx index 3f355415..69a8c8c9 100644 --- a/src/ui/Desktop/Apps/Host Manager/HostManagerHostViewer.tsx +++ b/src/ui/Desktop/Apps/Host Manager/HostManagerHostViewer.tsx @@ -110,6 +110,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); @@ -787,6 +818,18 @@ export function HostManagerHostViewer({onEditHost}: SSHManagerHostViewerProps) { > + +