mirror of
https://github.com/Termix-SSH/Termix.git
synced 2026-11-04 09:35:24 +00:00
feat: add host sections, tab embeds and the operations client to the plugin ui
This commit is contained in:
1 parent
cc725c7889
commit
631f6ac9f7
12 files changed
+184
-3
No files matched your search
@@ -10,6 +10,8 @@ Plugin API 1.14.0.
|
||||
- `ctx.operations` registers handlers, runs other plugins' declared actions, emits events and provides approval rules, with the new `operations:provide`, `operations:invoke` and `operations:approve` capabilities
|
||||
- `@termix-ssh/plugin-sdk/operations` has the types, input checks, redaction and JSON Schema for declared actions
|
||||
- `contributes.hostSections` declares cards for the host page
|
||||
- `app.registerHostSection` adds a card to the host page
|
||||
- `/ui` exports `HostTabEmbed`, which draws any tab type inside another view, the host section registry, and `operationsApi` for core's `/operations` routes
|
||||
|
||||
## 1.0.22
|
||||
|
||||
|
||||
@@ -670,6 +670,22 @@ export type HostStatusIndicatorContribution = HostBadgeContribution;
|
||||
/** A control in the host editor's toolbar. */
|
||||
export type HostEditorToolbarItemContribution = HostBadgeContribution;
|
||||
|
||||
export interface HostSectionProps {
|
||||
host: PluginHostRecord;
|
||||
isVisible: boolean;
|
||||
shell: ShellApi;
|
||||
}
|
||||
|
||||
export interface HostSectionContribution {
|
||||
/** Declare it in manifest contributes.hostSections too. */
|
||||
id: string;
|
||||
titleKey: string;
|
||||
/** Lower sorts first. */
|
||||
order?: number;
|
||||
when?: (host: PluginHostRecord) => boolean;
|
||||
component: ComponentType<HostSectionProps>;
|
||||
}
|
||||
|
||||
export interface HostContextMenuItemContribution {
|
||||
id: string;
|
||||
titleKey: string;
|
||||
@@ -1172,6 +1188,11 @@ export interface TermixApp extends TermixAppInfo {
|
||||
registerHostContextMenuItem: (
|
||||
item: HostContextMenuItemContribution,
|
||||
) => Disposer;
|
||||
/**
|
||||
* A card on the host page. Core 26.11.1 and newer; call it as
|
||||
* app.registerHostSection?.(...) if your plugin allows older cores.
|
||||
*/
|
||||
registerHostSection: (section: HostSectionContribution) => Disposer;
|
||||
registerPaletteEntry: (entry: PaletteEntryContribution) => Disposer;
|
||||
registerPaletteGroup: (group: PaletteGroupContribution) => Disposer;
|
||||
registerKeybindingAction: (action: KeybindingActionContribution) => Disposer;
|
||||
|
||||
@@ -159,8 +159,10 @@ HostProtocolAuthInput (type): HostProtocolAuthInput
|
||||
HostProtocolDef (type): HostProtocolDef
|
||||
HostProtocols (type): HostProtocols
|
||||
HostRowFields (type): HostRowFields
|
||||
HostSectionDef (type): HostSectionDef
|
||||
HostSidebarFilterState (type): HostSidebarFilterState
|
||||
HostSidebarPreferences (type): HostSidebarPreferences
|
||||
HostTabEmbed (value): ({ host, type, label, data, isVisible, shell, }: { host: Host; type: string; label?: string; data?: Record<string, unknown>; isVisible?: boolean; shell: TabShellCallbacks; }) => Element
|
||||
HostTrayTrigger (type): HostTrayTrigger
|
||||
HttpsSettings (type): HttpsSettings
|
||||
IconPicker (value): ({ value, color, onChange, }: { value: string; color?: string; onChange: (icon: string) => void; }) => Element
|
||||
@@ -457,6 +459,7 @@ hostBadgesFor (value): (all: HostBadgeDef[], host: Host) => HostBadgeDef[]
|
||||
hostEditorToolbarItemsFor (value): (all: HostBadgeDef[], host: Host) => HostBadgeDef[]
|
||||
hostMenuItemsFor (value): (all: HostContextMenuItemDef[], host: Host) => HostContextMenuItemDef[]
|
||||
hostProtocolFlags (value): (host: { enableSsh?: boolean; pluginSettings?: Record<string, Record<string, unknown>>; }, list?: HostProtocolDef[]) => HostProtocols
|
||||
hostSectionsFor (value): (all: HostSectionDef[], host: Host) => HostSectionDef[]
|
||||
hostStatusIndicatorsFor (value): (all: HostBadgeDef[], host: Host) => HostBadgeDef[]
|
||||
hydrateLocalSharedHostAuth (value): <T>(host: T) => Promise<T>
|
||||
invalidateHostsAndStatusCaches (value): () => void
|
||||
@@ -475,6 +478,7 @@ linkExternalToPasswordAccount (value): (externalUserId: string, targetUsername:
|
||||
linkedServerUrl (value): () => Promise<string>
|
||||
listHostActions (value): () => HostActionDef[]
|
||||
listHostProtocols (value): () => HostProtocolDef[]
|
||||
listHostSections (value): () => HostSectionDef[]
|
||||
loadPaletteGroup (value): (group: PaletteGroupDef) => Promise<PaletteItemDef[]>
|
||||
logoutUser (value): () => Promise<{ success: boolean; message: string; }>
|
||||
makeHostSshSubTabs (value): (t: (key: string, options?: { defaultValue?: string; }) => string, protocols?: Record<string, boolean>, defaultsMode?: boolean) => HostTab[]
|
||||
@@ -488,6 +492,7 @@ moveSplitDrag (value): (x: number, y: number) => void
|
||||
normalizeLanguageCode (value): (language?: string) => string
|
||||
notifySyncChanged (value): () => void
|
||||
openInSplit (value): (target: SplitOpenTarget, open: () => void) => void
|
||||
operationsApi (value): AxiosInstance
|
||||
paletteEntriesFor (value): (all: PaletteEntryDef[], scope: "global" | "host", host?: Host) => PaletteEntryDef[]
|
||||
parseCustomKeybindings (value): (raw?: string) => CustomKeybinding[]
|
||||
parseServerTime (value): (ts: string) => Date
|
||||
@@ -598,6 +603,7 @@ useHostContextMenuItems (value): () => HostContextMenuItemDef[]
|
||||
useHostEditorSections (value): () => HostEditorSectionDef[]
|
||||
useHostEditorToolbarItems (value): () => HostBadgeDef[]
|
||||
useHostProtocols (value): () => HostProtocolDef[]
|
||||
useHostSections (value): () => HostSectionDef[]
|
||||
useHostStatus (value): (hostId: number, statusCheckEnabled?: boolean) => StatusValue
|
||||
useHostStatusIndicators (value): () => HostBadgeDef[]
|
||||
useInstalledPlugins (value): () => PluginSummary[]
|
||||
|
||||
Reference in new issue
Block a user