fix(ops): 优化错误日志查询和详情展示
- 新增 GetErrorLogByID 接口用于获取单个错误日志详情 - 优化 GetErrorLogs 过滤逻辑,简化参数处理 - 简化前端错误详情模态框代码,提升可维护性 - 更新相关 API 接口和 i18n 翻译
This commit is contained in:
@@ -1037,6 +1037,17 @@ export async function updateUpstreamErrorResolved(errorId: number, resolved: boo
|
||||
await apiClient.put(`/admin/ops/upstream-errors/${errorId}/resolve`, { resolved })
|
||||
}
|
||||
|
||||
export async function listRequestErrorUpstreamErrors(
|
||||
id: number,
|
||||
params: OpsErrorListQueryParams = {},
|
||||
options: { include_detail?: boolean } = {}
|
||||
): Promise<PaginatedResponse<OpsErrorDetail>> {
|
||||
const query: Record<string, any> = { ...params }
|
||||
if (options.include_detail) query.include_detail = '1'
|
||||
const { data } = await apiClient.get<PaginatedResponse<OpsErrorDetail>>(`/admin/ops/request-errors/${id}/upstream-errors`, { params: query })
|
||||
return data
|
||||
}
|
||||
|
||||
export async function listRequestDetails(params: OpsRequestDetailsParams): Promise<OpsRequestDetailsResponse> {
|
||||
const { data } = await apiClient.get<OpsRequestDetailsResponse>('/admin/ops/requests', { params })
|
||||
return data
|
||||
@@ -1173,6 +1184,7 @@ export const opsAPI = {
|
||||
retryUpstreamError,
|
||||
updateRequestErrorResolved,
|
||||
updateUpstreamErrorResolved,
|
||||
listRequestErrorUpstreamErrors,
|
||||
|
||||
listRequestDetails,
|
||||
listAlertRules,
|
||||
|
||||
Reference in New Issue
Block a user