import { Select, Input, Toggle } from '@cameleer/design-system'; import type { MonitoringFormState } from '../hooks/useDeploymentPageState'; import styles from '../AppDeploymentPage.module.css'; interface Props { value: MonitoringFormState; onChange: (next: MonitoringFormState) => void; disabled?: boolean; } const LOG_LEVELS = ['TRACE', 'DEBUG', 'INFO', 'WARN', 'ERROR'].map((l) => ({ value: l, label: l })); export function MonitoringTab({ value, onChange, disabled }: Props) { const update = (key: K, v: MonitoringFormState[K]) => onChange({ ...value, [key]: v }); return (
Engine Level update('payloadCaptureMode', e.target.value)} options={[ { value: 'NONE', label: 'NONE' }, { value: 'INPUT', label: 'INPUT' }, { value: 'OUTPUT', label: 'OUTPUT' }, { value: 'BOTH', label: 'BOTH' }, ]} /> App Log Level update('agentLogLevel', e.target.value)} options={LOG_LEVELS} /> Metrics
!disabled && update('metricsEnabled', !value.metricsEnabled)} disabled={disabled} /> {value.metricsEnabled ? 'Enabled' : 'Disabled'}
Sampling Rate update('samplingRate', e.target.value)} className={styles.inputLg} placeholder="1.0" /> Compress Success
!disabled && update('compressSuccess', !value.compressSuccess)} disabled={disabled} /> {value.compressSuccess ? 'Enabled' : 'Disabled'}
); }