feat(alerting): Plan 03 — UI + backfills (SSRF guard, metrics caching, docker stack) #144

Merged
hsiegeln merged 39 commits from feat/alerting-03-ui into main 2026-04-20 16:27:49 +02:00
Showing only changes of commit 1a8b9eb41b - Show all commits

View File

@@ -0,0 +1,24 @@
import { useEnvironmentStore } from '../environment-store';
import { api } from '../client';
/** Returns the currently selected env slug, throwing if none is selected.
* Alerts routes require an env context — callers should gate on `selectedEnv`
* via `enabled:` before invoking these hooks.
*/
export function useSelectedEnvOrThrow(): string {
const env = useEnvironmentStore((s) => s.environment);
if (!env) {
throw new Error('Alerting requires a selected environment.');
}
return env;
}
export function useSelectedEnv(): string | undefined {
return useEnvironmentStore((s) => s.environment);
}
/** Re-exported openapi-fetch client for alerting query hooks.
* The underlying export in `../client` is named `api`; we re-export as
* `apiClient` so alerting hooks can import it under the plan's canonical name.
*/
export { api as apiClient };