feat: 新增多插件 UI 支持及运行日志集中回传功能
本次提交包含多项功能更新: 1. 为多个插件(xq0002/0003/0004/0008/0010/0011/0020/0031_xq0032/0033/0035/0037/0045_xq0046/0047/0048)新增 UI 界面及配置支持 2. 新增运行日志集中回传功能,客户端自动上传运行日志到中心机集中存储 3. 新增插件分类字段支持,用于场景库分组管理 4. 优化 xq0034/0037/0048 等插件的功能及描述 5. 修复控制面响应兼容问题,支持新旧版本数据格式 6. 新增 xq0033 插件的状态存储模块,用于历史记录管理 7. 优化 CRM 登录窗口模式,支持全屏置顶
This commit is contained in:
@@ -224,4 +224,43 @@ export async function adminNotificationToggle(id, active) {
|
||||
}
|
||||
export async function adminNotificationDelete(id) {
|
||||
return req(`/api/admin/notifications/${id}`, { method: 'DELETE', headers: adminHeaders() })
|
||||
}
|
||||
// ===== 集中日志(运行日志 / 客户端壳日志) =====
|
||||
export async function adminRunLogs(page = 1, pageSize = 20, filters = {}) {
|
||||
const qs = new URLSearchParams()
|
||||
qs.set('page', page); qs.set('page_size', pageSize)
|
||||
if (filters.account) qs.set('account', filters.account)
|
||||
if (filters.device) qs.set('device', filters.device)
|
||||
if (filters.plugin) qs.set('plugin', filters.plugin)
|
||||
if (filters.status) qs.set('status', filters.status)
|
||||
if (filters.q) qs.set('q', filters.q)
|
||||
if (filters.days) qs.set('days', filters.days)
|
||||
return req('/api/admin/run-logs?' + qs.toString(), { headers: adminHeaders() })
|
||||
}
|
||||
export async function adminRunLogDetail(runId) {
|
||||
return req('/api/admin/run-logs/' + encodeURIComponent(runId), { headers: adminHeaders() })
|
||||
}
|
||||
export async function adminDeviceLogs(page = 1, pageSize = 20, filters = {}) {
|
||||
const qs = new URLSearchParams()
|
||||
qs.set('page', page); qs.set('page_size', pageSize)
|
||||
if (filters.account) qs.set('account', filters.account)
|
||||
if (filters.q) qs.set('q', filters.q)
|
||||
return req('/api/admin/device-logs?' + qs.toString(), { headers: adminHeaders() })
|
||||
}
|
||||
export async function adminDeviceLogDetail(deviceId) {
|
||||
return req('/api/admin/device-logs/' + encodeURIComponent(deviceId), { headers: adminHeaders() })
|
||||
}
|
||||
// 壳日志全文下载:需携带管理票据,用 fetch 取 blob 再触发浏览器下载
|
||||
export async function adminDeviceLogDownload(deviceId, filename) {
|
||||
const res = await fetch('/api/admin/device-logs/' + encodeURIComponent(deviceId) + '/download', { headers: adminHeaders() })
|
||||
if (!res.ok) throw new Error(`下载失败 HTTP ${res.status}`)
|
||||
const blob = await res.blob()
|
||||
const url = URL.createObjectURL(blob)
|
||||
const a = document.createElement('a')
|
||||
a.href = url; a.download = filename || `shell-${deviceId}.log`
|
||||
document.body.appendChild(a); a.click(); a.remove()
|
||||
setTimeout(() => URL.revokeObjectURL(url), 5000)
|
||||
}
|
||||
export async function adminLogsCleanup() {
|
||||
return req('/api/admin/logs/cleanup', { method: 'POST', headers: adminHeaders() })
|
||||
}
|
||||
Reference in New Issue
Block a user