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:
25
ui/src/components/EnvironmentSelector.tsx
Normal file
25
ui/src/components/EnvironmentSelector.tsx
Normal file
@@ -0,0 +1,25 @@
|
||||
import styles from './EnvironmentSelector.module.css';
|
||||
|
||||
interface EnvironmentSelectorProps {
|
||||
environments: string[];
|
||||
value: string | undefined;
|
||||
onChange: (env: string | undefined) => void;
|
||||
}
|
||||
|
||||
export function EnvironmentSelector({ environments, value, onChange }: EnvironmentSelectorProps) {
|
||||
if (environments.length === 0) return null;
|
||||
|
||||
return (
|
||||
<select
|
||||
className={styles.select}
|
||||
value={value ?? ''}
|
||||
onChange={(e) => onChange(e.target.value || undefined)}
|
||||
aria-label="Environment filter"
|
||||
>
|
||||
<option value="">All Envs</option>
|
||||
{environments.map((env) => (
|
||||
<option key={env} value={env}>{env}</option>
|
||||
))}
|
||||
</select>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user