mirror of
https://github.com/Termix-SSH/Termix.git
synced 2026-10-31 07:35:24 +00:00
v26.10.3 (#1692)
* feat: shell controller, TabStage, layout and theme plugins with repair view * feat: move the classic layout into its own bundled plugin * feat: move color themes into a bundled themes plugin * fix: plugin tests and type checks work with a linked sdk * fix: home tab, layout switch and missing layout fallbacks for looks * chore: add classic layout and themes to the readme * chore: drop example plugin links from the plugin guide * feat: plugin filters by type, paged browse, hide plugins needing newer termix * feat: move desktop, status, import, audit and branding features into plugins * feat: host lock api so a plugin can load hosts from a config file (#1581) * chore: add hosts config to the plugin table * feat: login policy hook for plugins and optional https redirect (#1584) * chore: add login security to the plugin table * feat: api key socket tickets so a master can open remote sessions (#1654) * feat: sync moves to a plugin, desktop gets multiple accounts (#1580, #1654) * chore: add sync to the plugin table * feat: move the sync screens and wizard out of core into the plugin (#1580) * fix: add a neutral linked desktop hook for plugins (#1580) * fix: show the linked account's name and admin flag in the app (#1580) * feat: ssh transport providers, core ssh relay and plugin folders api * feat: support FIDO2 security keys through ssh agent * feat: add companion panels beside host tabs * feat: mTLS client certificates for desktop server links * feat: native web view for plugins in the desktop app * fix: detect the desktop link window by Electron's default user agent Fixes #1675 * fix: changelog for desktop link fix * fix: keep text primary keys in the plugin data export * fix: ship sharp binaries for Windows arm64 builds * feat: client cert on the sync link types (sdk 1.0.18) * chore: update translations * feat: themed title bar for the desktop app (#1690) * chore: changelog for the themed title bar * fix: draw the title bar in the sidebar color * feat: per host layout for the terminal panel bar * chore: sdk 1.0.19 for the panel bar layout * chore: bundle all 43 plugins for 26.10.3 * chore: update translations --------- Co-authored-by: SirHephaistos <60616553+SirHephaistos@users.noreply.github.com> Co-authored-by: Giovanny Aranda <garanda21@gmail.com>
This commit is contained in:
577 files changed
+76479
-101831
No files matched your search
@@ -0,0 +1,99 @@
|
||||
import type { UnavailableLook } from "@/api/look-api";
|
||||
import type { PluginRecord } from "@/plugin-host/plugin-store";
|
||||
import type { RegisteredLayout } from "./layout-registry";
|
||||
|
||||
/** Why the repair view shows instead of the chosen layout. */
|
||||
export type RepairReason =
|
||||
/** ?safe-layout=1 in the address. */
|
||||
| "safe-url"
|
||||
/** TERMIX_SAFE_LAYOUT on the server. */
|
||||
| "safe-env"
|
||||
/** No installed plugin provides the layout. */
|
||||
| "missing"
|
||||
/** Its plugin is switched off. */
|
||||
| "disabled"
|
||||
/** Its plugin waits on a missing dependency or was refused. */
|
||||
| "blocked"
|
||||
/** Its plugin does not fit this Termix or plugin API. */
|
||||
| "incompatible"
|
||||
/** Its code threw while starting. */
|
||||
| "failed"
|
||||
/** It crashed while drawing, twice. */
|
||||
| "crashed";
|
||||
|
||||
export type LayoutStatus =
|
||||
| { kind: "ok"; layout: RegisteredLayout }
|
||||
| { kind: "loading" }
|
||||
| {
|
||||
kind: "repair";
|
||||
reason: RepairReason;
|
||||
layoutId: string;
|
||||
pluginId?: string;
|
||||
version?: string | null;
|
||||
error?: string | null;
|
||||
};
|
||||
|
||||
/** A crash this many times in a row hands over to the repair view. */
|
||||
export const MAX_LAYOUT_CRASHES = 2;
|
||||
|
||||
export interface LayoutStatusInput {
|
||||
layoutId: string;
|
||||
safeFromUrl: boolean;
|
||||
safeFromEnv: boolean;
|
||||
/** The look and the plugin list have both been read. */
|
||||
ready: boolean;
|
||||
registered: RegisteredLayout | undefined;
|
||||
/** The installed plugin whose manifest declares the layout, if any. */
|
||||
owner: PluginRecord | undefined;
|
||||
/** A plugin the server skipped that declares the layout, if any. */
|
||||
unavailable: UnavailableLook | undefined;
|
||||
crashes: number;
|
||||
lastCrash: string | null;
|
||||
}
|
||||
|
||||
/** Whether the chosen layout can be drawn, and why not when it cannot. */
|
||||
export function layoutStatus(input: LayoutStatusInput): LayoutStatus {
|
||||
const repair = (
|
||||
reason: RepairReason,
|
||||
extra: { error?: string | null } = {},
|
||||
): LayoutStatus => ({
|
||||
kind: "repair",
|
||||
reason,
|
||||
layoutId: input.layoutId,
|
||||
pluginId: input.owner?.summary.id ?? input.unavailable?.id,
|
||||
version: input.owner?.summary.version ?? input.unavailable?.version ?? null,
|
||||
error: extra.error ?? null,
|
||||
});
|
||||
|
||||
if (input.safeFromUrl) return repair("safe-url");
|
||||
if (input.safeFromEnv) return repair("safe-env");
|
||||
if (input.crashes >= MAX_LAYOUT_CRASHES) {
|
||||
return repair("crashed", { error: input.lastCrash });
|
||||
}
|
||||
if (input.registered) return { kind: "ok", layout: input.registered };
|
||||
if (!input.ready) return { kind: "loading" };
|
||||
|
||||
if (input.unavailable && !input.owner) {
|
||||
return repair("incompatible", { error: input.unavailable.error });
|
||||
}
|
||||
const owner = input.owner;
|
||||
if (!owner) return repair("missing");
|
||||
const summary = owner.summary;
|
||||
if (!summary.enabled) return repair("disabled");
|
||||
if (owner.frontend === "blocked" || summary.state === "blocked") {
|
||||
return repair("blocked", { error: owner.error ?? summary.lastError });
|
||||
}
|
||||
if (owner.frontend === "failed" || summary.state === "failed") {
|
||||
return repair("failed", { error: owner.error ?? summary.lastError });
|
||||
}
|
||||
if (owner.frontend === "loading") return { kind: "loading" };
|
||||
// Just chosen: the runtime is about to load its code.
|
||||
if (
|
||||
summary.frontend &&
|
||||
(owner.frontend === "inactive" || owner.frontend === "none")
|
||||
) {
|
||||
return { kind: "loading" };
|
||||
}
|
||||
// Running, but it never registered the layout it declares.
|
||||
return repair("missing");
|
||||
}
|
||||
Reference in new issue
Block a user