fix: auto-compute environment slug + respect environment filter globally
Part A: Environment creation slug is now auto-derived from display name and shown read-only (matching app creation pattern). Removes manual slug input. Part B: All data queries now pass the selected environment to backend: - Exchanges search, Dashboard L1/L2/L3 stats, Routes metrics, Route detail, correlation chains, and processor metrics all filter by selected environment. - Backend RouteMetricsController now accepts environment parameter for both route and processor metrics endpoints. Closes #XYZ Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -16,6 +16,7 @@ import { useGlobalFilters } from '@cameleer/design-system';
|
||||
import { useRouteMetrics } from '../../api/queries/catalog';
|
||||
import { useExecutionStats, useStatsTimeseries } from '../../api/queries/executions';
|
||||
import { useTimeseriesByApp, useTopErrors, useAllAppSettings, usePunchcard } from '../../api/queries/dashboard';
|
||||
import { useEnvironmentStore } from '../../api/environment-store';
|
||||
import type { AppSettings } from '../../api/queries/dashboard';
|
||||
import { Treemap } from './Treemap';
|
||||
import type { TreemapItem } from './Treemap';
|
||||
@@ -290,17 +291,18 @@ function buildKpiItems(
|
||||
|
||||
export default function DashboardL1() {
|
||||
const navigate = useNavigate();
|
||||
const selectedEnv = useEnvironmentStore((s) => s.environment);
|
||||
const { timeRange } = useGlobalFilters();
|
||||
const timeFrom = timeRange.start.toISOString();
|
||||
const timeTo = timeRange.end.toISOString();
|
||||
const windowSeconds = (timeRange.end.getTime() - timeRange.start.getTime()) / 1000;
|
||||
|
||||
const { data: metrics } = useRouteMetrics(timeFrom, timeTo);
|
||||
const { data: stats } = useExecutionStats(timeFrom, timeTo);
|
||||
const { data: timeseries } = useStatsTimeseries(timeFrom, timeTo);
|
||||
const { data: timeseriesByApp } = useTimeseriesByApp(timeFrom, timeTo);
|
||||
const { data: topErrors } = useTopErrors(timeFrom, timeTo);
|
||||
const { data: punchcardData } = usePunchcard();
|
||||
const { data: metrics } = useRouteMetrics(timeFrom, timeTo, undefined, selectedEnv);
|
||||
const { data: stats } = useExecutionStats(timeFrom, timeTo, undefined, undefined, selectedEnv);
|
||||
const { data: timeseries } = useStatsTimeseries(timeFrom, timeTo, undefined, undefined, selectedEnv);
|
||||
const { data: timeseriesByApp } = useTimeseriesByApp(timeFrom, timeTo, selectedEnv);
|
||||
const { data: topErrors } = useTopErrors(timeFrom, timeTo, undefined, undefined, selectedEnv);
|
||||
const { data: punchcardData } = usePunchcard(undefined, selectedEnv);
|
||||
const { data: allAppSettings } = useAllAppSettings();
|
||||
|
||||
// Build settings lookup map
|
||||
|
||||
Reference in New Issue
Block a user