mirror of
https://github.com/Termix-SSH/Termix.git
synced 2026-10-30 23:25:24 +00:00
feat: host lock api so a plugin can load hosts from a config file (#1581)
This commit is contained in:
1 parent
1cdbfc674c
commit
2c785fe35b
34 files changed
+1388
-52
No files matched your search
@@ -5,6 +5,7 @@ import {
|
||||
} from "../../hosts/ssh-options.js";
|
||||
import { listHostProtocols } from "../../hosts/protocol-auth/registry.js";
|
||||
import { sanitizeProtocolAuthForRecipient } from "../../hosts/protocol-auth/summary.js";
|
||||
import { hostLock } from "../../hosts/locks.js";
|
||||
|
||||
export function isNonEmptyString(value: unknown): value is string {
|
||||
return typeof value === "string" && value.trim().length > 0;
|
||||
@@ -337,6 +338,7 @@ const CONNECT_LEVEL_FIELDS = new Set([
|
||||
"sshPort",
|
||||
"protocolAuth",
|
||||
"jumpHosts",
|
||||
"lock",
|
||||
"createdAt",
|
||||
"updatedAt",
|
||||
]);
|
||||
@@ -439,8 +441,10 @@ export function transformHostResponse(
|
||||
host: Record<string, unknown>,
|
||||
): Record<string, unknown> {
|
||||
const shared = parseSharedSource(host.sharedSource);
|
||||
const lock = typeof host.id === "number" ? hostLock(host.id) : null;
|
||||
return {
|
||||
...host,
|
||||
...(lock ? { lock } : {}),
|
||||
sharedSource: undefined,
|
||||
localOnly: !!host.localOnly,
|
||||
sharedCopy: !!shared,
|
||||
|
||||
Reference in new issue
Block a user