feat(web): 增加计费结算异常管理界面

管理端支持按状态查看结算与释放记录,展示精确到九位的小数金额、错误分类和重试次数,并使用一次性 Idempotency-Key 发起审计化重试。
This commit is contained in:
2026-07-21 00:25:57 +08:00
parent 5b2b94b1bd
commit 62d25fcb11
4 changed files with 214 additions and 9 deletions
+24
View File
@@ -3,6 +3,8 @@ import type {
AuthUser,
BaseModelCatalogItem,
BaseModelUpsertRequest,
BillingSettlementListResponse,
BillingSettlementRetryResponse,
CatalogProvider,
CatalogProviderUpsertRequest,
ClientCustomizationSettings,
@@ -1000,6 +1002,28 @@ export async function restoreModelRuntimeStatus(token: string, platformModelId:
});
}
export async function listBillingSettlements(
token: string,
input: { status?: string; action?: string; page?: number; pageSize?: number; signal?: AbortSignal } = {},
): Promise<BillingSettlementListResponse> {
const search = new URLSearchParams({
page: String(input.page ?? 1),
pageSize: String(input.pageSize ?? 50),
});
if (input.status) search.set('status', input.status);
if (input.action) search.set('action', input.action);
return request<BillingSettlementListResponse>(`/api/admin/runtime/billing-settlements?${search.toString()}`, { token, signal: input.signal });
}
export async function retryBillingSettlement(token: string, settlementId: string): Promise<BillingSettlementRetryResponse> {
const idempotencyKey = crypto.randomUUID();
return request<BillingSettlementRetryResponse>(`/api/admin/runtime/billing-settlements/${settlementId}/retry`, {
method: 'POST',
token,
headers: { 'Idempotency-Key': idempotencyKey },
});
}
export async function getNetworkProxyConfig(token: string): Promise<GatewayNetworkProxyConfig> {
return request<GatewayNetworkProxyConfig>('/api/admin/config/network-proxy', { token });
}