fix(media): 视频任务 - 统一轮询超时并支持失败任务人工恢复
This commit is contained in:
@@ -2,6 +2,7 @@ import axios from "axios";
|
||||
|
||||
import type { ModelChannel } from "@/stores/use-config-store";
|
||||
import type { CreditLedgerEntry } from "@/services/api/wallet";
|
||||
import type { GenerationTask, TaskStatus } from "@/services/api/task-center";
|
||||
|
||||
const api = axios.create({ baseURL: import.meta.env.VITE_CANVAS_BACKEND_URL || "/api", withCredentials: true });
|
||||
|
||||
@@ -46,6 +47,7 @@ export type ApiCallLog = {
|
||||
channelId: string;
|
||||
channelName: string;
|
||||
taskId?: string;
|
||||
taskStatus?: TaskStatus;
|
||||
source: string;
|
||||
capability: "text" | "image" | "video" | "audio" | "";
|
||||
operation?: string;
|
||||
@@ -83,6 +85,13 @@ export type ApiCallLog = {
|
||||
createdAt: string;
|
||||
};
|
||||
|
||||
export type AdminProviderTaskQueryResult = {
|
||||
task: GenerationTask;
|
||||
providerStatus: string;
|
||||
recovered: boolean;
|
||||
billingSettled: boolean;
|
||||
};
|
||||
|
||||
export type AdminAuditEvent = {
|
||||
id: string;
|
||||
actorUserId: string;
|
||||
@@ -430,6 +439,10 @@ export function getAdminApiLog(id: string) {
|
||||
return request<{ log: ApiCallLog }>(api.get(`/admin/api-logs/${encodeURIComponent(id)}`));
|
||||
}
|
||||
|
||||
export function queryAdminApiLogTask(id: string) {
|
||||
return request<AdminProviderTaskQueryResult>(api.post(`/admin/api-logs/${encodeURIComponent(id)}/query-task`));
|
||||
}
|
||||
|
||||
export async function exportAdminApiLogs(params: AdminListParams & { ids?: string[] } = {}) {
|
||||
const response = await api.get<Blob>("/admin/api-logs-export.csv", { params: { ...params, ids: params.ids?.join(",") }, responseType: "blob" });
|
||||
return response.data;
|
||||
|
||||
Reference in New Issue
Block a user