mirror of
https://github.com/QuantumNous/new-api.git
synced 2026-09-11 14:41:21 +00:00
feat: add system task runner (#5680)
This commit is contained in:
@@ -22,6 +22,7 @@ import type {
|
||||
FetchUpstreamRatiosRequest,
|
||||
LogCleanupTask,
|
||||
SystemOptionsResponse,
|
||||
SystemTaskListResponse,
|
||||
SystemTaskResponse,
|
||||
UpdateOptionRequest,
|
||||
UpdateOptionResponse,
|
||||
@@ -75,6 +76,13 @@ export async function getSystemTask(taskId: string) {
|
||||
return res.data
|
||||
}
|
||||
|
||||
export async function listSystemTasks(limit = 20) {
|
||||
const res = await api.get<SystemTaskListResponse>('/api/system-task/list', {
|
||||
params: { limit },
|
||||
})
|
||||
return res.data
|
||||
}
|
||||
|
||||
export async function resetModelRatios() {
|
||||
const res = await api.post<UpdateOptionResponse>(
|
||||
'/api/option/rest_model_ratio'
|
||||
|
||||
@@ -100,6 +100,12 @@ export type SystemTaskResponse<TTask = SystemTask | null> = {
|
||||
data?: TTask
|
||||
}
|
||||
|
||||
export type SystemTaskListResponse = {
|
||||
success: boolean
|
||||
message: string
|
||||
data?: SystemTask[]
|
||||
}
|
||||
|
||||
export type SiteSettings = {
|
||||
'theme.frontend': string
|
||||
Notice: string
|
||||
|
||||
Reference in New Issue
Block a user