feat: 左侧导航改版与 Python 镜像管理
- 应用外壳换成 stash-ui Layout:左侧导航(任务调度 / Python 镜像)+ 页面标题区,窄屏折叠为顶部导航 - 新增 python_mirrors 表与 CRUD/设默认接口,内置清华、阿里云、中科大、PyPI 官方 - Python 脚本任务运行时注入默认镜像的 PIP_INDEX_URL / UV_INDEX_URL,任务自身环境变量优先 - 新增镜像管理页与表单,支持新增、编辑、启用/停用、设默认、删除 - 重新生成 OpenAPI 与 TS 类型;补齐后端镜像测试、前端单测与 e2e,修复窄屏页面被宽表格撑开
This commit is contained in:
@@ -26,6 +26,11 @@ export type DirectoryListingResponse =
|
||||
components['schemas']['DirectoryListingResponse']
|
||||
export type TaskStats = components['schemas']['TaskStatsResponse']
|
||||
export type ScheduledTask = components['schemas']['ScheduledTaskResponse']
|
||||
export type PythonMirror = components['schemas']['PythonMirrorResponse']
|
||||
export type CreatePythonMirrorRequest =
|
||||
components['schemas']['CreatePythonMirrorRequest']
|
||||
export type UpdatePythonMirrorRequest =
|
||||
components['schemas']['UpdatePythonMirrorRequest']
|
||||
|
||||
export interface TaskFilters {
|
||||
q?: string
|
||||
@@ -303,3 +308,42 @@ export function fetchStats(signal?: AbortSignal): Promise<TaskStats> {
|
||||
export function fetchSchedule(signal?: AbortSignal): Promise<ScheduledTask[]> {
|
||||
return requestJson<ScheduledTask[]>('/api/v1/schedule', { signal })
|
||||
}
|
||||
|
||||
/** Python 包镜像(默认镜像会在脚本任务运行时注入 pip / uv 环境变量)。 */
|
||||
export function listPythonMirrors(
|
||||
signal?: AbortSignal,
|
||||
): Promise<PythonMirror[]> {
|
||||
return requestJson<PythonMirror[]>('/api/v1/python/mirrors', { signal })
|
||||
}
|
||||
|
||||
export function createPythonMirror(
|
||||
request: CreatePythonMirrorRequest,
|
||||
): Promise<PythonMirror> {
|
||||
return requestJson<PythonMirror>('/api/v1/python/mirrors', {
|
||||
method: 'POST',
|
||||
body: JSON.stringify(request),
|
||||
})
|
||||
}
|
||||
|
||||
export function updatePythonMirror(
|
||||
id: string,
|
||||
request: UpdatePythonMirrorRequest,
|
||||
): Promise<PythonMirror> {
|
||||
return requestJson<PythonMirror>(`/api/v1/python/mirrors/${id}`, {
|
||||
method: 'PUT',
|
||||
body: JSON.stringify(request),
|
||||
})
|
||||
}
|
||||
|
||||
export function deletePythonMirror(id: string): Promise<void> {
|
||||
return requestJson<void>(`/api/v1/python/mirrors/${id}`, {
|
||||
method: 'DELETE',
|
||||
})
|
||||
}
|
||||
|
||||
export function setDefaultPythonMirror(id: string): Promise<PythonMirror> {
|
||||
return requestJson<PythonMirror>(
|
||||
`/api/v1/python/mirrors/${id}/default`,
|
||||
{ method: 'POST' },
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user