mirror of
https://github.com/Termix-SSH/Termix.git
synced 2026-10-28 14:15: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. */
|
||||
|
||||
@@ -38,6 +38,7 @@ export * from "@/components/tooltip";
|
||||
export * from "@/components/section-card";
|
||||
export * from "@/components/metric-card";
|
||||
export * from "@/components/charts";
|
||||
export { LineChart, type LineChartSeries } from "@/components/charts/LineChart";
|
||||
export {
|
||||
CardGridCanvas,
|
||||
ColumnCountStepper,
|
||||
@@ -82,6 +83,12 @@ export {
|
||||
} from "@/lib/adaptive-polling";
|
||||
export * from "@/components/sheet";
|
||||
export { useConfirmation } from "@/hooks/use-confirmation";
|
||||
export { useAdaptivePolling } from "@/hooks/use-adaptive-polling";
|
||||
// Per-area display density and chart options the user picked in Appearance.
|
||||
export { useAreaPreferences } from "@/contexts/UiPreferencesContext";
|
||||
// Homepage widget pieces, for plugins that register a widget.
|
||||
export { WidgetTitle } from "@/features/homepage/widgets/WidgetTitle";
|
||||
export { runVisibleInterval } from "@/features/homepage/use-visible-interval";
|
||||
export { useIsMobile } from "@/hooks/use-mobile";
|
||||
export { PassphraseDialog } from "@/ssh/dialogs/PassphraseDialog";
|
||||
export { OPKSSHDialog } from "@/ssh/dialogs/OPKSSHDialog";
|
||||
|
||||
Reference in new issue
Block a user