mirror of
https://github.com/Termix-SSH/Termix.git
synced 2026-10-29 06:35:24 +00:00
feat: tailscale add host and copy ip, fix outbound fetch hang and plugin ESM warning
This commit is contained in:
1 parent
c21bca8cf0
commit
fbe736bc20
70 files changed
+1117
-1139
No files matched your search
@@ -1,6 +1,7 @@
|
||||
import { TERMINAL_THEMES } from "@/lib/terminal-themes";
|
||||
import type { Host } from "@/types/ui-types";
|
||||
import type { SSHHostData } from "@/types";
|
||||
import type { HostDraft } from "@termix/plugin-sdk/frontend";
|
||||
import type { HostDefaults } from "@/api/settings-api";
|
||||
import type { TerminalDefaults } from "@/lib/connection-defaults";
|
||||
import {
|
||||
@@ -89,6 +90,24 @@ export function mapSnippetResponse(
|
||||
}));
|
||||
}
|
||||
|
||||
/** Overlays a plugin's draft on a new host's form. */
|
||||
export function applyHostDraft(
|
||||
form: HostEditorForm,
|
||||
draft: HostDraft | undefined,
|
||||
): HostEditorForm {
|
||||
if (!draft) return form;
|
||||
return {
|
||||
...form,
|
||||
...(draft.name !== undefined ? { name: draft.name } : {}),
|
||||
...(draft.ip !== undefined ? { ip: draft.ip } : {}),
|
||||
...(draft.port !== undefined ? { sshPort: draft.port } : {}),
|
||||
...(draft.username !== undefined ? { username: draft.username } : {}),
|
||||
...(draft.authType !== undefined
|
||||
? { authType: draft.authType as HostAuthType }
|
||||
: {}),
|
||||
};
|
||||
}
|
||||
|
||||
export function createHostEditorForm(
|
||||
host: Host | null,
|
||||
defaults?: HostDefaults,
|
||||
|
||||
Reference in new issue
Block a user