feat: finish the host-metrics plugin, move host status into core (B16)

This commit is contained in:
LukeGus committed 2026-09-24 11:21:23 -05:00
1 parent 14eb558b85
commit 0a3f05d99d
308 files changed
+53073 -8985

No files matched your search

+10
View File
@@ -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. */