feat(看板): 客户端任务管理从设备维度改为店铺维度全局在跑看板
原「在线设备」卡按日志上报窗口统计,把 89 台算成在线,与实际在跑的客户端数差一个 量级,且设备维度并不能回答"哪台机器上有任务卡住"。改为: - 汇总卡:总店铺 / 在跑店铺 / 进行中任务 / 今日完成 / 疑似卡住 - 新增「在跑店铺看板」:当前所有进行中任务按店铺归组(在跑数、卡住数、业务分布、 最近上报),点店铺行下筛该店铺任务;不落店铺的任务归「不挂店铺」桶 - 卡片与面板同源(同一个 aggregateShops),杜绝口径分裂 - 店铺只认两个真来源:上架结果文件 + 逐店落行的结果文件名; biz_task_progress_snapshot.current_scope_key 是实例锁不是店铺,已从口径中剔除 - 设备号退为详情附注,花名册 /devices 与在线判定整条链删除 - 上报口径只留一个 10 分钟窗口(进行中且超 10 分钟无上报 = 疑似卡住) 后端 3487 例全绿;新增反射护栏断言设备维度查询与快照当店铺的来源已彻底移除。
This commit is contained in:
@@ -1,27 +1,27 @@
|
||||
import { http } from './http'
|
||||
import { unwrap } from './envelope'
|
||||
|
||||
/** 客户端任务管理(后台看板):按账号 × 设备 × 业务统一查看客户端任务,全部只读。 */
|
||||
/** 客户端任务管理(后台看板):按店铺 × 账号 × 业务统一查看客户端在跑任务,全部只读。 */
|
||||
|
||||
/** 查询参数(由页面侧 buildTaskQuery / buildVariantQuery 产出,空白项不下传)。 */
|
||||
type QueryParams = Record<string, string | number>
|
||||
|
||||
export interface TaskCenterOverview {
|
||||
deviceTotal: number
|
||||
deviceOnline: number
|
||||
shopTotal: number
|
||||
shopRunning: number
|
||||
runningTasks: number
|
||||
todayFinishedTasks: number
|
||||
stuckTasks: number
|
||||
}
|
||||
|
||||
export interface TaskCenterDevice {
|
||||
deviceId: string
|
||||
deviceName: string | null
|
||||
lastActiveAt: string | null
|
||||
online: boolean
|
||||
/** 店铺面板行:一个店铺在当前所有进行中任务里的汇总;「不挂店铺」是兜住无店铺模块的合成桶。 */
|
||||
export interface TaskCenterShop {
|
||||
shop: string
|
||||
noShop: boolean
|
||||
runningTasks: number
|
||||
recentTaskAt: string | null
|
||||
webDevice: boolean
|
||||
stuckTasks: number
|
||||
moduleSummary: string
|
||||
lastReportAt: string | null
|
||||
}
|
||||
|
||||
export interface TaskCenterTaskRow {
|
||||
@@ -39,6 +39,7 @@ export interface TaskCenterTaskRow {
|
||||
shopCount: number
|
||||
createdAt: string | null
|
||||
finishedAt: string | null
|
||||
lastReportAt: string | null
|
||||
progressTotal: number
|
||||
progressSuccess: number
|
||||
progressFailed: number
|
||||
@@ -91,10 +92,16 @@ export async function fetchTaskCenterOverview(): Promise<TaskCenterOverview> {
|
||||
return unwrap<TaskCenterOverview>(data)
|
||||
}
|
||||
|
||||
/** 设备花名册(任务设备近 30 天 ∪ 日志设备近 7 天):GET /api/admin/task-center/devices */
|
||||
export async function fetchTaskCenterDevices(): Promise<TaskCenterDevice[]> {
|
||||
const { data } = await http.get('/api/admin/task-center/devices')
|
||||
return unwrap<TaskCenterDevice[]>(data)
|
||||
/** 店铺面板:当前全部进行中任务按店铺归组(与汇总卡的「在跑店铺」同源):GET /api/admin/task-center/shops */
|
||||
export async function fetchTaskCenterShops(): Promise<TaskCenterShop[]> {
|
||||
const { data } = await http.get('/api/admin/task-center/shops')
|
||||
return unwrap<TaskCenterShop[]>(data)
|
||||
}
|
||||
|
||||
/** 店铺筛选候选(店铺库内的店铺名,精确匹配):GET /api/admin/task-center/shop-options */
|
||||
export async function fetchTaskCenterShopOptions(): Promise<string[]> {
|
||||
const { data } = await http.get('/api/admin/task-center/shop-options')
|
||||
return unwrap<string[]>(data)
|
||||
}
|
||||
|
||||
/** 任务分页列表:GET /api/admin/task-center/tasks */
|
||||
|
||||
Reference in New Issue
Block a user