79b5d40327
三部分均已部署到双节点(当前线上 JAR 009efc3e),本次补齐仓库状态,避免"已上线未提交" 在后续最小构建比对里被误判。 - 设备日志管理:modules/devicelog + DeviceLogOssProperties(主机B 独立 MinIO,仅内网) + V127 device_log_file/device_log_config + admin-vue 日志管理页;客户端/麦象按 offset 增量上报(X-Internal-Token),查询仅超管 - 后台通用配置:modules/appconfig + V128 app_config 键值表;工作台「开店流程」密码改服务端 校验(POST /api/kd-flow/verify),改密码只需 UPDATE 该行、客户端无需重新发版 - 密钥检测模型解耦:新增 aiimage.user-secret.check-model(env AIIMAGE_USER_SECRET_CHECK_MODEL), 默认 doubao-seed-2-0-lite-260215 —— 同系列 mini 在中继分组下无可用渠道(503 model_not_found), 实测 lite 可路由;UserSecretModule 去掉 LlmTarget 改 resolveLlmHost,探测日志带 model= - 前端:密钥面板「检测配置密钥」按钮不再折行;client-changelog 补 4.0.19/4.0.20/4.0.21 条目 注:application.yml 与 PropertiesConfig 同时承载上述多个部分,故未按功能拆分提交
136 lines
4.3 KiB
TypeScript
136 lines
4.3 KiB
TypeScript
import { http } from './http'
|
|
import { unwrap } from './envelope'
|
|
|
|
/** 日志文件行(桌面客户端 / 麦象采集机上报)。 */
|
|
export interface DeviceLogFileRow {
|
|
id: number
|
|
source: string
|
|
deviceId: string
|
|
deviceName: string | null
|
|
username: string | null
|
|
uid: number | null
|
|
fileName: string
|
|
logDate: string
|
|
uploadedBytes: number
|
|
partCount: number
|
|
lastUploadAt: string | null
|
|
createdAt: string | null
|
|
}
|
|
|
|
export interface DeviceLogPage {
|
|
items: DeviceLogFileRow[]
|
|
total: number
|
|
page: number
|
|
pageSize: number
|
|
/** 云端日志保留天数(页面提示用)。 */
|
|
retentionDays: number
|
|
}
|
|
|
|
export interface DeviceLogContent {
|
|
fileId: number
|
|
fileName: string
|
|
content: string
|
|
totalBytes: number
|
|
shownBytes: number
|
|
truncated: boolean
|
|
}
|
|
|
|
export interface DeviceLogDevice {
|
|
source: string
|
|
deviceId: string
|
|
deviceName: string | null
|
|
lastUploadAt: string | null
|
|
}
|
|
|
|
export interface DeviceLogOverride {
|
|
id: number
|
|
source: string
|
|
deviceId: string
|
|
deviceName: string | null
|
|
mode: string
|
|
updatedAt: string | null
|
|
}
|
|
|
|
export interface DeviceLogConfigData {
|
|
globalMode: string
|
|
overrides: DeviceLogOverride[]
|
|
}
|
|
|
|
export interface DeviceLogQuery {
|
|
source?: string
|
|
keyword?: string
|
|
startDate?: string
|
|
endDate?: string
|
|
page: number
|
|
pageSize: number
|
|
}
|
|
|
|
/** 分页查询日志文件列表:GET /api/admin/device-logs/files */
|
|
export async function fetchDeviceLogFiles(params: DeviceLogQuery): Promise<DeviceLogPage> {
|
|
const query: Record<string, string | number> = { page: params.page, pageSize: params.pageSize }
|
|
if (params.source) query.source = params.source
|
|
if (params.keyword) query.keyword = params.keyword
|
|
if (params.startDate) query.startDate = params.startDate
|
|
if (params.endDate) query.endDate = params.endDate
|
|
const { data } = await http.get('/api/admin/device-logs/files', { params: query })
|
|
return unwrap<DeviceLogPage>(data)
|
|
}
|
|
|
|
/** 查看日志尾部内容:GET /api/admin/device-logs/content */
|
|
export async function fetchDeviceLogContent(fileId: number, maxBytes?: number): Promise<DeviceLogContent> {
|
|
const query: Record<string, number> = { fileId }
|
|
if (maxBytes) query.maxBytes = maxBytes
|
|
const { data } = await http.get('/api/admin/device-logs/content', { params: query })
|
|
return unwrap<DeviceLogContent>(data)
|
|
}
|
|
|
|
/** 完整日志下载地址(同域 cookie 鉴权,直接给 a[href] 或 window.open 用)。 */
|
|
export function deviceLogDownloadUrl(fileId: number): string {
|
|
return `/api/admin/device-logs/download?fileId=${fileId}`
|
|
}
|
|
|
|
/** 删除日志文件(片段与元数据,不可恢复):DELETE /api/admin/device-logs/{id} */
|
|
export async function deleteDeviceLogFile(id: number): Promise<void> {
|
|
const { data } = await http.delete(`/api/admin/device-logs/${id}`)
|
|
unwrap<unknown>(data)
|
|
}
|
|
|
|
/** 采集配置(全局默认 + 终端覆盖):GET /api/admin/device-logs/config */
|
|
export async function fetchDeviceLogConfig(keyword?: string): Promise<DeviceLogConfigData> {
|
|
const { data } = await http.get('/api/admin/device-logs/config', {
|
|
params: keyword ? { keyword } : undefined,
|
|
})
|
|
return unwrap<DeviceLogConfigData>(data)
|
|
}
|
|
|
|
/** 最近上报过的终端(覆盖选择用):GET /api/admin/device-logs/devices */
|
|
export async function fetchDeviceLogDevices(): Promise<DeviceLogDevice[]> {
|
|
const { data } = await http.get('/api/admin/device-logs/devices')
|
|
return unwrap<DeviceLogDevice[]>(data)
|
|
}
|
|
|
|
/** 设置全局采集模式:PUT /api/admin/device-logs/config/global */
|
|
export async function updateDeviceLogGlobalMode(mode: string): Promise<void> {
|
|
const { data } = await http.put('/api/admin/device-logs/config/global', undefined, { params: { mode } })
|
|
unwrap<unknown>(data)
|
|
}
|
|
|
|
/** 设置/更新终端覆盖:PUT /api/admin/device-logs/config/device */
|
|
export async function updateDeviceLogOverride(
|
|
source: string,
|
|
deviceId: string,
|
|
deviceName: string | null,
|
|
mode: string,
|
|
): Promise<void> {
|
|
const { data } = await http.put('/api/admin/device-logs/config/device', undefined, {
|
|
params: { source, deviceId, deviceName: deviceName || undefined, mode },
|
|
})
|
|
unwrap<unknown>(data)
|
|
}
|
|
|
|
/** 删除终端覆盖(回落到全局默认):DELETE /api/admin/device-logs/config/device/{id} */
|
|
export async function deleteDeviceLogOverride(id: number): Promise<void> {
|
|
const { data } = await http.delete(`/api/admin/device-logs/config/device/${id}`)
|
|
unwrap<unknown>(data)
|
|
}
|