feat: add environment filtering across all APIs and UI
Backend: Added optional `environment` query parameter to catalog, search, stats, timeseries, punchcard, top-errors, logs, and agents endpoints. ClickHouse queries filter by environment when specified (literal SQL for AggregatingMergeTree, ? binds for raw tables). StatsStore interface methods all accept environment parameter. UI: Added EnvironmentSelector component (compact native select). LayoutShell extracts distinct environments from agent data and passes selected environment to catalog and agent queries via URL search param (?env=). TopBar shows current environment label. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -8,10 +8,11 @@ export function useExecutionStats(
|
||||
timeTo: string | undefined,
|
||||
routeId?: string,
|
||||
application?: string,
|
||||
environment?: string,
|
||||
) {
|
||||
const live = useLiveQuery(10_000);
|
||||
return useQuery({
|
||||
queryKey: ['executions', 'stats', timeFrom, timeTo, routeId, application],
|
||||
queryKey: ['executions', 'stats', timeFrom, timeTo, routeId, application, environment],
|
||||
queryFn: async () => {
|
||||
const { data, error } = await api.GET('/search/stats', {
|
||||
params: {
|
||||
@@ -20,6 +21,7 @@ export function useExecutionStats(
|
||||
to: timeTo || undefined,
|
||||
routeId: routeId || undefined,
|
||||
application: application || undefined,
|
||||
environment: environment || undefined,
|
||||
},
|
||||
},
|
||||
});
|
||||
@@ -70,10 +72,11 @@ export function useStatsTimeseries(
|
||||
timeTo: string | undefined,
|
||||
routeId?: string,
|
||||
application?: string,
|
||||
environment?: string,
|
||||
) {
|
||||
const live = useLiveQuery(30_000);
|
||||
return useQuery({
|
||||
queryKey: ['executions', 'timeseries', timeFrom, timeTo, routeId, application],
|
||||
queryKey: ['executions', 'timeseries', timeFrom, timeTo, routeId, application, environment],
|
||||
queryFn: async () => {
|
||||
const { data, error } = await api.GET('/search/stats/timeseries', {
|
||||
params: {
|
||||
@@ -83,6 +86,7 @@ export function useStatsTimeseries(
|
||||
buckets: 24,
|
||||
routeId: routeId || undefined,
|
||||
application: application || undefined,
|
||||
environment: environment || undefined,
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user