mirror of
https://github.com/Termix-SSH/Termix.git
synced 2026-10-28 14:15:24 +00:00
feat: add a permission-gated UI action registry and action slots for plugins
Moves the terminal toolbar's hardwired AI button into a slot the ssh-terminal plugin offers and the ai plugin fills, gated on ai.services.use.
This commit is contained in:
1 parent
225f618337
commit
2d6c1cdecb
29 files changed
+1971
-40
No files matched your search
@@ -12,10 +12,12 @@
|
||||
|
||||
export const id = "ssh-terminal";
|
||||
export const tabId = "terminal";
|
||||
export const toolbarSlotId = "terminal.toolbar";
|
||||
|
||||
export async function register({
|
||||
registerRailItem,
|
||||
registerTabComponent,
|
||||
declareActionSlot,
|
||||
icons,
|
||||
}) {
|
||||
registerTabComponent(tabId, () =>
|
||||
@@ -30,12 +32,18 @@ export async function register({
|
||||
labelKey: "nav.terminal",
|
||||
kind: "tab",
|
||||
});
|
||||
|
||||
// Offers other plugins a place in the terminal toolbar. The terminal does
|
||||
// not know or care who fills it.
|
||||
declareActionSlot({ id: toolbarSlotId, accepts: ["button"] });
|
||||
}
|
||||
|
||||
export async function unregister({
|
||||
unregisterRailItem,
|
||||
unregisterTabComponent,
|
||||
undeclareActionSlot,
|
||||
}) {
|
||||
unregisterRailItem(tabId);
|
||||
unregisterTabComponent(tabId);
|
||||
undeclareActionSlot(toolbarSlotId);
|
||||
}
|
||||
Reference in new issue
Block a user