mirror of
https://github.com/Termix-SSH/Termix.git
synced 2026-10-29 06:35:24 +00:00
fix: finish 2.9.0 plugin moves and get every check green
This commit is contained in:
1 parent
8c1e02af89
commit
6489b62ece
335 files changed
+29878
-17749
No files matched your search
@@ -4,7 +4,10 @@ import type {
|
||||
PluginManifest,
|
||||
TermixApp,
|
||||
} from "@termix/plugin-sdk/frontend";
|
||||
import type { PluginContributions } from "@/api/plugins-api";
|
||||
import {
|
||||
PLUGIN_SETTINGS_CHANGED_EVENT,
|
||||
type PluginContributions,
|
||||
} from "@/api/plugins-api";
|
||||
import { registerRailItem } from "@/sidebar/rail-items";
|
||||
import { registerTabType, type TabRenderProps } from "@/shell/tab-registry";
|
||||
import { registerPanel, type PanelRenderProps } from "@/shell/panel-registry";
|
||||
@@ -415,6 +418,22 @@ export function createPluginApp(
|
||||
onRemoteServerChange: (listener) => track(onRemoteServerChange(listener)),
|
||||
},
|
||||
|
||||
onSettingsChanged: (listener) => {
|
||||
const handler = (event: Event) => {
|
||||
const detail = (event as CustomEvent).detail as {
|
||||
pluginId?: string;
|
||||
scope: "admin" | "user" | "host";
|
||||
hostId?: number;
|
||||
};
|
||||
if (detail?.pluginId !== pluginId) return;
|
||||
listener({ scope: detail.scope, hostId: detail.hostId });
|
||||
};
|
||||
window.addEventListener(PLUGIN_SETTINGS_CHANGED_EVENT, handler);
|
||||
return track(() =>
|
||||
window.removeEventListener(PLUGIN_SETTINGS_CHANGED_EVENT, handler),
|
||||
);
|
||||
},
|
||||
|
||||
onDispose(dispose) {
|
||||
if (disposed) {
|
||||
dispose();
|
||||
|
||||
Reference in new issue
Block a user