feat: Major update with validators, skills, dashboard, and docs reorganization
- Add validation framework (config, model, results, study validators) - Add Claude Code skills (create-study, run-optimization, generate-report, troubleshoot, analyze-model) - Add Atomizer Dashboard (React frontend + FastAPI backend) - Reorganize docs into structured directories (00-09) - Add neural surrogate modules and training infrastructure - Add multi-objective optimization support 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
58
atomizer-dashboard/frontend/src/api/client.ts
Normal file
58
atomizer-dashboard/frontend/src/api/client.ts
Normal file
@@ -0,0 +1,58 @@
|
||||
import { Study, StudyListResponse, HistoryResponse, PruningResponse, StudyStatus } from '../types';
|
||||
|
||||
const API_BASE = '/api';
|
||||
|
||||
class ApiClient {
|
||||
async getStudies(): Promise<StudyListResponse> {
|
||||
const response = await fetch(`${API_BASE}/optimization/studies`);
|
||||
if (!response.ok) throw new Error('Failed to fetch studies');
|
||||
return response.json();
|
||||
}
|
||||
|
||||
async getStudyStatus(studyId: string): Promise<StudyStatus> {
|
||||
const response = await fetch(`${API_BASE}/optimization/studies/${studyId}/status`);
|
||||
if (!response.ok) throw new Error('Failed to fetch study status');
|
||||
return response.json();
|
||||
}
|
||||
|
||||
async getStudyHistory(studyId: string): Promise<HistoryResponse> {
|
||||
const response = await fetch(`${API_BASE}/optimization/studies/${studyId}/history`);
|
||||
if (!response.ok) throw new Error('Failed to fetch study history');
|
||||
return response.json();
|
||||
}
|
||||
|
||||
async getStudyPruning(studyId: string): Promise<PruningResponse> {
|
||||
const response = await fetch(`${API_BASE}/optimization/studies/${studyId}/pruning`);
|
||||
if (!response.ok) throw new Error('Failed to fetch pruning data');
|
||||
return response.json();
|
||||
}
|
||||
|
||||
async createStudy(config: any): Promise<{ study_id: string }> {
|
||||
const response = await fetch(`${API_BASE}/optimization/studies`, {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify(config),
|
||||
});
|
||||
if (!response.ok) throw new Error('Failed to create study');
|
||||
return response.json();
|
||||
}
|
||||
|
||||
async getStudyReport(studyId: string): Promise<{ content: string }> {
|
||||
const response = await fetch(`${API_BASE}/optimization/studies/${studyId}/report`);
|
||||
if (!response.ok) throw new Error('Failed to fetch report');
|
||||
return response.json();
|
||||
}
|
||||
|
||||
// Future endpoints for control
|
||||
async startOptimization(studyId: string): Promise<void> {
|
||||
const response = await fetch(`${API_BASE}/optimization/studies/${studyId}/start`, { method: 'POST' });
|
||||
if (!response.ok) throw new Error('Failed to start optimization');
|
||||
}
|
||||
|
||||
async stopOptimization(studyId: string): Promise<void> {
|
||||
const response = await fetch(`${API_BASE}/optimization/studies/${studyId}/stop`, { method: 'POST' });
|
||||
if (!response.ok) throw new Error('Failed to stop optimization');
|
||||
}
|
||||
}
|
||||
|
||||
export const apiClient = new ApiClient();
|
||||
Reference in New Issue
Block a user