mirror of
https://github.com/Termix-SSH/Termix.git
synced 2026-10-28 06:05:24 +00:00
feat: finish the host-metrics plugin, move host status into core (B16)
This commit is contained in:
1 parent
14eb558b85
commit
0a3f05d99d
308 files changed
+53073
-8985
No files matched your search
@@ -28,6 +28,7 @@ import { invokeAction } from "@/shell/action-registry";
|
||||
import { useSshAuthProviders } from "@/hooks/useSshAuthProviders";
|
||||
import { useActionSlot } from "@/hooks/use-action-slot";
|
||||
import { usePluginComponent } from "./component-registry";
|
||||
import { useOptionalHostStatusEntry } from "@/lib/ServerStatusContext";
|
||||
|
||||
/**
|
||||
* Core permission groups, mirroring RESERVED_PERMISSION_PREFIXES in the SDK
|
||||
@@ -284,6 +285,15 @@ export const pluginHostBridge: PluginHostBridge = {
|
||||
],
|
||||
|
||||
usePluginComponent: (id) => usePluginComponent(id),
|
||||
|
||||
useHostStatus: (hostId) => {
|
||||
const entry = useOptionalHostStatusEntry(hostId);
|
||||
if (!entry) return null;
|
||||
return {
|
||||
status: entry.status === "degraded" ? "unknown" : entry.status,
|
||||
...(entry.reason ? { reason: entry.reason } : {}),
|
||||
};
|
||||
},
|
||||
};
|
||||
|
||||
/** Installs the bridge. Idempotent. */
|
||||
|
||||
Reference in new issue
Block a user