mirror of
https://github.com/Termix-SSH/Termix.git
synced 2026-10-30 15:15:24 +00:00
feat: load plugin frontends at runtime and remove plugin ids from the shell
This commit is contained in:
1 parent
49f0286a14
commit
e88d5a52e3
721 files changed
+54265
-44416
No files matched your search
@@ -0,0 +1,51 @@
|
||||
import { Workflow } from "lucide-react";
|
||||
import type {
|
||||
PanelProps,
|
||||
TabProps,
|
||||
TermixApp,
|
||||
} from "@termix/plugin-sdk/frontend";
|
||||
import { AutomationsPanel } from "./AutomationsPanel";
|
||||
import { listAutomations } from "./automations-api";
|
||||
|
||||
const VIEW_ID = "automations";
|
||||
|
||||
function Panel({ active, setEditing }: PanelProps) {
|
||||
return (
|
||||
<div className="flex-1 min-h-0 overflow-y-auto">
|
||||
<AutomationsPanel active={active} onEditingChange={setEditing} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
function AutomationsTab({ isVisible }: TabProps) {
|
||||
return <AutomationsPanel active={isVisible} />;
|
||||
}
|
||||
|
||||
export function activate(app: TermixApp): void {
|
||||
app.registerRailItem({
|
||||
id: VIEW_ID,
|
||||
icon: Workflow,
|
||||
titleKey: "nav.automations",
|
||||
promotable: true,
|
||||
after: "macros",
|
||||
order: 30,
|
||||
});
|
||||
app.registerPanel(VIEW_ID, Panel);
|
||||
app.registerTab(VIEW_ID, AutomationsTab, {
|
||||
icon: Workflow,
|
||||
titleKey: "nav.automations",
|
||||
singleton: true,
|
||||
hostless: true,
|
||||
panelFrame: true,
|
||||
});
|
||||
|
||||
// The assistant's @-mentions list automations through this.
|
||||
app.registerAction("automations.list", () => listAutomations());
|
||||
|
||||
app.registerSlotContribution("onboarding.features", {
|
||||
actionId: "automations.feature",
|
||||
titleKey: "onboarding.feature_automations",
|
||||
descriptionKey: "onboarding.feature_automations_desc",
|
||||
icon: Workflow,
|
||||
});
|
||||
}
|
||||
Reference in new issue
Block a user