feat: 更新后端平台模块、前端组件及构建产物,新增工作计划文档
- 更新 backend 平台 API endpoints 及 platform_store - 更新前端 ComputeNodesView、DataProcessCreateView、FineTuneCreateView 等组件 - 更新前端 API 模块(compute、fineTune) - 重构 frontend/dist 构建产物(新 hash) - 新增 docs/2026-07-24-work-plan.md 工作计划文档 Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -77,6 +77,16 @@ export interface ResourceReplica {
|
||||
create_time: string
|
||||
}
|
||||
|
||||
export interface ResourceSyncJob {
|
||||
id: string
|
||||
target_node_id: string
|
||||
resources?: unknown
|
||||
status: string
|
||||
progress: number
|
||||
create_time?: string
|
||||
completed_at?: string
|
||||
}
|
||||
|
||||
export const getComputeNodes = () => get<ComputeNode[]>('/compute/nodes')
|
||||
|
||||
export const createComputeNode = (data: ComputeNodePayload) =>
|
||||
@@ -104,7 +114,9 @@ export const checkNodeReplicaDrift = (id: string) =>
|
||||
get<{ node_id: string; items: ResourceReplica[]; drifted: number }>(`/compute/nodes/${id}/replicas/drift`)
|
||||
|
||||
export const repairNodeReplicas = (id: string, replicaIds?: string[]) =>
|
||||
post<{ sync: unknown; replicas: ResourceReplica[]; failed: Array<{ replica_id: string; error: string }> }>(
|
||||
post<{ sync: ResourceSyncJob; replicas: ResourceReplica[]; failed: Array<{ replica_id: string; error: string }>; async?: boolean }>(
|
||||
`/compute/nodes/${id}/replicas/repair`,
|
||||
replicaIds?.length ? { replica_ids: replicaIds } : {},
|
||||
)
|
||||
|
||||
export const getComputeSyncJob = (id: string) => get<ResourceSyncJob>(`/compute/sync-jobs/${id}`)
|
||||
|
||||
@@ -1,6 +1,37 @@
|
||||
import { get, post, put, del } from '../request'
|
||||
import type { FineTuneStartPayload, FineTuneTask, TrainingProgress, LogContent } from '@/types'
|
||||
|
||||
export interface TrainingDiagnostic {
|
||||
level: string
|
||||
title: string
|
||||
suggestion: string
|
||||
}
|
||||
|
||||
export interface FineTunePreflightResult {
|
||||
valid: boolean
|
||||
errors: string[]
|
||||
warnings: string[]
|
||||
diagnostics?: TrainingDiagnostic[]
|
||||
node?: {
|
||||
id?: string
|
||||
code?: string
|
||||
name?: string
|
||||
api_base_url?: string
|
||||
scheduler_status?: string
|
||||
gpu_count?: number
|
||||
}
|
||||
job_payload?: Record<string, unknown>
|
||||
preview?: {
|
||||
command?: string[]
|
||||
command_text?: string
|
||||
work_dir?: string
|
||||
path_checks?: Array<Record<string, unknown>>
|
||||
accelerator?: Record<string, unknown>
|
||||
runtime_files?: Array<Record<string, unknown>>
|
||||
}
|
||||
sync_results?: Array<Record<string, unknown>>
|
||||
}
|
||||
|
||||
/** 训练任务列表 */
|
||||
export const getFineTuneList = () => get<FineTuneTask[]>('/fine-tune')
|
||||
|
||||
@@ -18,6 +49,18 @@ export const createFineTune = (data: Partial<FineTuneTask>) =>
|
||||
/** 启动训练(第二步) */
|
||||
export const startFineTune = (data: FineTuneStartPayload) => post('/fine-tune/start', data)
|
||||
|
||||
/** 创建前训练预检,不落库 */
|
||||
export const preflightFineTune = (data: Omit<FineTuneStartPayload, 'task_id'>) =>
|
||||
post<FineTunePreflightResult>('/fine-tune/preflight', data)
|
||||
|
||||
/** 创建前真实命令预览,不落库 */
|
||||
export const previewFineTuneCommand = (data: Omit<FineTuneStartPayload, 'task_id'>) =>
|
||||
post<FineTunePreflightResult>('/fine-tune/command-preview', data)
|
||||
|
||||
/** 训练失败诊断 */
|
||||
export const getFineTuneDiagnostics = (id: string | number) =>
|
||||
get<{ task_id: string | number; status?: string; failure_reason?: string; diagnostics: TrainingDiagnostic[] }>(`/fine-tune/${id}/diagnostics`)
|
||||
|
||||
/** 更新训练任务 */
|
||||
export const updateFineTune = (id: string | number, data: Partial<FineTuneTask>) =>
|
||||
put(`/fine-tune/${id}`, data)
|
||||
|
||||
Reference in New Issue
Block a user