mirror of
https://github.com/Termix-SSH/Termix.git
synced 2026-08-29 18:31:33 +00:00
18 lines
472 B
TypeScript
18 lines
472 B
TypeScript
export type HostStatus = "online" | "reachable" | "offline";
|
|
|
|
export function statusAfterReachabilityCheck(
|
|
reachable: boolean,
|
|
current?: HostStatus,
|
|
): HostStatus {
|
|
if (!reachable) return "offline";
|
|
return current === "online" ? "online" : "reachable";
|
|
}
|
|
|
|
export function statusAfterAuthentication(
|
|
authenticated: boolean,
|
|
current?: HostStatus,
|
|
): HostStatus {
|
|
if (authenticated) return "online";
|
|
return current === "offline" ? "offline" : "reachable";
|
|
}
|