Add experiment logs to the monitoring page #48

Merged
0950726 merged 122 commits from feat/experiment-logs into dev 2026-01-28 10:16:00 +00:00
Showing only changes of commit f95b1148d9 - Show all commits

View File

@@ -24,16 +24,23 @@ const MonitoringPage: React.FC = () => {
const [phaseIndex, setPhaseIndex] = React.useState(0); const [phaseIndex, setPhaseIndex] = React.useState(0);
const isFinished = phaseIndex >= phaseIds.length; //determines if experiment is over //see if we reached end node
const [isFinished, setIsFinished] = React.useState(false);
const handleStreamUpdate = React.useCallback((data: any) => { const handleStreamUpdate = React.useCallback((data: any) => {
// Check for phase updates // Check for phase updates
if (data.type === 'phase_update' && data.phase_id) { if (data.type === 'phase_update' && data.phase_id) {
if (data.phase_id === "end") {
setIsFinished(true);
} else {
setIsFinished(false);
const allIds = getPhaseIds(); const allIds = getPhaseIds();
const newIndex = allIds.indexOf(data.phase_id); const newIndex = allIds.indexOf(data.phase_id);
if (newIndex !== -1) { if (newIndex !== -1) {
setPhaseIndex(newIndex); setPhaseIndex(newIndex);
setGoalIndex(0); //when phase change we reset the index setGoalIndex(0);
}
} }
} }
else if (data.type === 'goal_update') { else if (data.type === 'goal_update') {