mirror of
https://github.com/Wei-Shaw/sub2api.git
synced 2026-10-30 16:23:31 +00:00
feat(proxies): 代理有效期与失败回退
- schema/迁移: 代理有效期、提醒天数、失败回退配置 + 账号 fallback 来源字段 - service/repo/DTO/handler: CRUD 透传新字段 + 校验 - fallback 目标解析纯函数(链式解析 + 环检测 + 兜底) - SweepExpiredProxies 到期改投账号 + outbox 失效 - ProxyExpiryService 后台到期扫描任务 + wire 注册 - 账号侧手动回切原代理 + fallback 来源徽章/按钮 - 前端: 创建/编辑表单、列表到期徽章、类型/API/i18n - ops 告警: proxy_expired_count / proxy_expiring_soon_count 指标 - 导入导出携带有效期/回退字段(备用按 name 映射) - 补全测试 stub + 集成测试 + review 问题修复
This commit is contained in:
@@ -659,6 +659,16 @@ export interface BatchOperationResult {
|
||||
warnings?: Array<{ account_id: number; warning: string }>
|
||||
}
|
||||
|
||||
/**
|
||||
* Revert account proxy to original before fallback
|
||||
* @param id - Account ID
|
||||
* @returns Success confirmation
|
||||
*/
|
||||
export async function revertProxyFallback(id: number): Promise<{ message: string }> {
|
||||
const { data } = await apiClient.post<{ message: string }>(`/admin/accounts/${id}/revert-proxy-fallback`)
|
||||
return data
|
||||
}
|
||||
|
||||
/**
|
||||
* Batch clear account errors
|
||||
* @param accountIds - Array of account IDs
|
||||
@@ -735,7 +745,8 @@ export const accountsAPI = {
|
||||
getAntigravityDefaultModelMapping,
|
||||
batchClearError,
|
||||
batchRefresh,
|
||||
setPrivacy
|
||||
setPrivacy,
|
||||
revertProxyFallback
|
||||
}
|
||||
|
||||
export default accountsAPI
|
||||
|
||||
@@ -27,7 +27,7 @@ export async function list(
|
||||
pageSize: number = 20,
|
||||
filters?: {
|
||||
protocol?: string
|
||||
status?: 'active' | 'inactive'
|
||||
status?: 'active' | 'inactive' | 'expired'
|
||||
search?: string
|
||||
sort_by?: string
|
||||
sort_order?: 'asc' | 'desc'
|
||||
@@ -227,7 +227,7 @@ export async function exportData(options?: {
|
||||
ids?: number[]
|
||||
filters?: {
|
||||
protocol?: string
|
||||
status?: 'active' | 'inactive'
|
||||
status?: 'active' | 'inactive' | 'expired'
|
||||
search?: string
|
||||
sort_by?: string
|
||||
sort_order?: 'asc' | 'desc'
|
||||
|
||||
Reference in New Issue
Block a user