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' }, ]} /> Max Payload Size
update('payloadSize', e.target.value)} className={styles.inputMd} placeholder="e.g. 4" /> update('applicationLogLevel', e.target.value)} options={LOG_LEVELS} /> Agent Log Level update('metricsInterval', e.target.value)} className={styles.inputXs} placeholder="60" /> s
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'}
Replay
!disabled && update('replayEnabled', !value.replayEnabled)} disabled={disabled} /> {value.replayEnabled ? 'Enabled' : 'Disabled'}
Route Control
!disabled && update('routeControlEnabled', !value.routeControlEnabled)} disabled={disabled} /> {value.routeControlEnabled ? 'Enabled' : 'Disabled'}
); }