mirror of
https://github.com/Termix-SSH/Termix.git
synced 2026-10-28 22:25:24 +00:00
feat: ship docker as a first-party in-process plugin
Moves docker backend and frontend into plugins/docker/, alongside ssh-terminal. Adds a host editor tab seam, a dashboard card registry, and a build step to compile plugin backends into dist.
This commit is contained in:
1 parent
c94a453f1e
commit
a2479c19b0
34 files changed
+729
-143
No files matched your search
@@ -0,0 +1,68 @@
|
||||
/**
|
||||
* Frontend half of the docker plugin.
|
||||
*
|
||||
* Registers the container-management tab through the existing extension
|
||||
* seams (registerRailItem / registerTabComponent) the same way
|
||||
* ssh-terminal's frontend does, and the host-editor Docker tab through the
|
||||
* new registerHostEditorTab seam built for this plugin.
|
||||
*
|
||||
* HostDockerTab itself stays in src/ui/sidebar/HostEditorFeatureTabs.tsx
|
||||
* rather than moving into this plugin: it takes the same {form, setField}
|
||||
* pair every other host editor tab does, and those types (HostEditorForm,
|
||||
* the setField signature) are core types HostEditor.tsx owns, the same
|
||||
* reason ssh-terminal leaves session-manager.ts in core rather than copying
|
||||
* it here.
|
||||
*
|
||||
* register() is called when the plugin is enabled, unregister() when it is
|
||||
* disabled. As of this change neither is actually invoked anywhere yet --
|
||||
* see plugins/ssh-terminal/frontend/index.mjs and
|
||||
* src/ui/tests/sidebar/plugin-extension-seam.test.tsx, which says outright
|
||||
* "there is no plugin loader yet" for the frontend half. This file follows
|
||||
* the same shape so it is ready the moment that loader exists.
|
||||
*/
|
||||
|
||||
export const id = "docker";
|
||||
export const tabId = "docker";
|
||||
export const hostEditorTabId = "docker";
|
||||
|
||||
export async function register({
|
||||
registerRailItem,
|
||||
registerTabComponent,
|
||||
registerHostEditorTab,
|
||||
icons,
|
||||
}) {
|
||||
registerTabComponent(tabId, () =>
|
||||
import("./DockerManager.tsx").then((m) => ({
|
||||
default: m.DockerManager,
|
||||
})),
|
||||
);
|
||||
|
||||
registerRailItem({
|
||||
id: tabId,
|
||||
icon: icons.Box,
|
||||
labelKey: "nav.docker",
|
||||
kind: "tab",
|
||||
});
|
||||
|
||||
if (registerHostEditorTab) {
|
||||
const { HostDockerTab } = await import(
|
||||
"../../../src/ui/sidebar/HostEditorFeatureTabs.tsx"
|
||||
);
|
||||
registerHostEditorTab({
|
||||
id: hostEditorTabId,
|
||||
labelKey: "hosts.tabDocker",
|
||||
icon: icons.Box,
|
||||
component: HostDockerTab,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
export async function unregister({
|
||||
unregisterRailItem,
|
||||
unregisterTabComponent,
|
||||
unregisterHostEditorTab,
|
||||
}) {
|
||||
unregisterRailItem(tabId);
|
||||
unregisterTabComponent(tabId);
|
||||
unregisterHostEditorTab?.(hostEditorTabId);
|
||||
}
|
||||
Reference in new issue
Block a user