- 新建 webapi/onlineUser.ts (3 函数, 镜像 web/api/permission/onlineUser.ts) - 新建 webapi/flowMonitor.ts (8 函数, 镜像 web/api/workFlow/flowMonitor.ts) - schedule/list: c.get → loadSchedule.getTaskList - schedule/info: c.get → loadSchedule.getInfo - schedule/create: c.postJson → loadSchedule.create - schedule/log: c.get → loadSchedule.getTaskLogList 注: schedule/trigger 保留 c.postJson (white/trigger 是 dacli 专属端点, web task.ts 无) webapi 模块累计 16 个 Co-Authored-By: Claude <[email protected]>
32 lines
1020 B
TypeScript
32 lines
1020 B
TypeScript
/**
|
|
* webapi/flowMonitor.ts — 镜像 web 端 flowMonitor.ts (v0.11+ Phase 2)
|
|
*
|
|
* 镜像 web/apps/jnpf-web-apps-main/src/api/workFlow/flowMonitor.ts 8 函数:
|
|
* getFlowMonitorList / delMonitorList / getLogList / cancel / assign /
|
|
* resurgence / getPauseType
|
|
*/
|
|
import { JnpfClient } from '../core/client.ts'
|
|
import { loadWebModule } from './_loader.ts'
|
|
|
|
const FLOW_MONITOR_SRC = '/home/ubuntu/ccWorkDir/web/apps/jnpf-web-apps-main/src/api/workFlow/flowMonitor.ts'
|
|
|
|
let cached: any = null
|
|
|
|
export async function initWebapi(client: JnpfClient): Promise<void> {
|
|
if (cached) return
|
|
const { initDefHttpShim } = await import('./_defhttp_shim.ts')
|
|
initDefHttpShim(client)
|
|
cached = await loadWebModule(FLOW_MONITOR_SRC)
|
|
}
|
|
|
|
export function isWebapiLoaded(): boolean {
|
|
return cached !== null
|
|
}
|
|
|
|
export const loadFlowMonitor: any = new Proxy({} as any, {
|
|
get(_target, prop) {
|
|
if (!cached) throw new Error('flowMonitor 模块未初始化, 请先 await initWebapi(client)')
|
|
return cached[prop]
|
|
},
|
|
})
|