mirror of
https://github.com/Termix-SSH/Termix.git
synced 2026-10-29 22:55:24 +00:00
feat: harden plugin api for separate repos, signed updates and generic external login
This commit is contained in:
1 parent
fb9c168b6b
commit
80944301dd
310 files changed
+6577
-4927
No files matched your search
@@ -333,7 +333,9 @@ export function HomepageCanvas({
|
||||
scheduleSave(next);
|
||||
return next;
|
||||
});
|
||||
} catch {}
|
||||
} catch {
|
||||
// A bad layout write is dropped; the canvas keeps what it shows.
|
||||
}
|
||||
},
|
||||
[scheduleSave],
|
||||
);
|
||||
@@ -376,7 +378,9 @@ export function HomepageCanvas({
|
||||
scheduleSave(next);
|
||||
return next;
|
||||
});
|
||||
} catch {}
|
||||
} catch {
|
||||
// A bad layout write is dropped; the canvas keeps what it shows.
|
||||
}
|
||||
},
|
||||
[scheduleSave],
|
||||
);
|
||||
@@ -403,7 +407,9 @@ export function HomepageCanvas({
|
||||
setWidgets((prev) =>
|
||||
prev.map((w) => (w.id === id ? { ...w, title, config } : w)),
|
||||
);
|
||||
} catch {}
|
||||
} catch {
|
||||
// A bad layout write is dropped; the canvas keeps what it shows.
|
||||
}
|
||||
},
|
||||
[],
|
||||
);
|
||||
|
||||
@@ -93,10 +93,6 @@ export function activate(app: TermixApp): void {
|
||||
component: HomepagePreviewCard,
|
||||
});
|
||||
|
||||
app.declareActionSlot({
|
||||
id: "dashboard.secondaryView",
|
||||
accepts: ["component"],
|
||||
});
|
||||
app.registerSlotContribution("dashboard.secondaryView", {
|
||||
actionId: "homepage",
|
||||
titleKey: "nav.homepage",
|
||||
|
||||
@@ -4,7 +4,7 @@ import {
|
||||
useHostActions,
|
||||
useHostStatus,
|
||||
useHosts,
|
||||
type PluginHostRecord,
|
||||
useTabs,
|
||||
} from "@termix/plugin-sdk/frontend";
|
||||
|
||||
import { registerWidget } from "./WidgetRegistry";
|
||||
@@ -18,14 +18,6 @@ import { GRID_SIZE } from "../types.js";
|
||||
import { quickConnectTargets } from "../quick-connect-targets.js";
|
||||
import { WidgetTitle } from "@termix/plugin-sdk/ui";
|
||||
|
||||
function openTab(host: PluginHostRecord, type: QuickConnectType) {
|
||||
window.dispatchEvent(
|
||||
new CustomEvent("termix:open-tab", {
|
||||
detail: { hostId: String(host.id), type },
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
function StatusDot({ hostId }: { hostId: number }) {
|
||||
const status = useHostStatus(hostId);
|
||||
const cls =
|
||||
@@ -43,6 +35,7 @@ function QuickConnectWidget({
|
||||
}: WidgetComponentProps<QuickConnectConfig>) {
|
||||
const { t } = useTranslation();
|
||||
const { hosts: allHosts, loaded } = useHosts();
|
||||
const tabs = useTabs();
|
||||
const targets = quickConnectTargets(useHostActions());
|
||||
|
||||
const hosts =
|
||||
@@ -104,7 +97,7 @@ function QuickConnectWidget({
|
||||
onMouseDown={(e) => e.stopPropagation()}
|
||||
onClick={(e) => {
|
||||
e.stopPropagation();
|
||||
openTab(host, target.type);
|
||||
tabs.connectHost(host, target.type);
|
||||
}}
|
||||
className="p-1.5 text-muted-foreground hover:text-accent-brand hover:bg-accent-brand/10 transition-colors border border-transparent hover:border-accent-brand/20"
|
||||
>
|
||||
|
||||
Reference in new issue
Block a user