refactor(v0.11+): schedule 4 子命令 + 新建 onlineUser/flowMonitor webapi

- 新建 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]>
This commit is contained in:
sswandClaude committed 2026-06-25 15:36:11 +08:00
1 parent e79520cd9e
commit bd11e1b388
6 files changed
+107 -54

No files matched your search

+31
View File
@@ -0,0 +1,31 @@
/**
* 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]
},
})
+30
View File
@@ -0,0 +1,30 @@
/**
* webapi/onlineUser.ts — 镜像 web 端 onlineUser.ts (v0.11+ Phase 2)
*
* 镜像 web/apps/jnpf-web-apps-main/src/api/permission/onlineUser.ts 3 函数:
* getOnlineUser / batchDelOnlineUser / deleteOnlineUser
*/
import { JnpfClient } from '../core/client.ts'
import { loadWebModule } from './_loader.ts'
const ONLINE_SRC = '/home/ubuntu/ccWorkDir/web/apps/jnpf-web-apps-main/src/api/permission/onlineUser.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(ONLINE_SRC)
}
export function isWebapiLoaded(): boolean {
return cached !== null
}
export const loadOnlineUser: any = new Proxy({} as any, {
get(_target, prop) {
if (!cached) throw new Error('onlineUser 模块未初始化, 请先 await initWebapi(client)')
return cached[prop]
},
})