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:
@@ -21,6 +21,8 @@ import * as upload from '@midwayjs/upload';
|
||||
// import * as task from '@cool-midway/task';
|
||||
// import * as rpc from '@cool-midway/rpc';
|
||||
import { FileserverMonitorService } from './modules/center/service/fileserver-monitor';
|
||||
import { CenterLogService } from './modules/center/service/logstore';
|
||||
import { CenterRbacService } from './modules/center/service/rbac';
|
||||
|
||||
@Configuration({
|
||||
imports: [
|
||||
@@ -71,6 +73,26 @@ export class MainConfiguration {
|
||||
// 内网文件服务器离线监控(daemon 语义:随进程启停,异常不中断业务)
|
||||
const monitor = await this.app.getApplicationContext().getAsync(FileserverMonitorService);
|
||||
monitor.start();
|
||||
// 集中日志保留期清理(启动清理一次 + 周期清理,随进程启停)
|
||||
const logStore = await this.app.getApplicationContext().getAsync(CenterLogService);
|
||||
logStore.start();
|
||||
// 控制台 RBAC 幂等种子(initDB/initMenu=false,兜底超管角色、业务菜单、运行期账号)
|
||||
this.seedRbac();
|
||||
}
|
||||
|
||||
/** RBAC 种子:最多重试 3 次(等数据库连接就绪),失败仅记日志不阻断启动 */
|
||||
private seedRbac(attempt = 1) {
|
||||
this.app
|
||||
.getApplicationContext()
|
||||
.getAsync(CenterRbacService)
|
||||
.then(rbac => rbac.ensureSeed())
|
||||
.catch(e => {
|
||||
if (attempt < 3) {
|
||||
setTimeout(() => this.seedRbac(attempt + 1), 3000);
|
||||
return;
|
||||
}
|
||||
this.logger.error('[rbac] 控制台权限种子初始化失败:%s', (e as Error)?.message || e);
|
||||
});
|
||||
}
|
||||
|
||||
async onStop() {
|
||||
@@ -80,5 +102,11 @@ export class MainConfiguration {
|
||||
} catch (e) {
|
||||
/* ignore */
|
||||
}
|
||||
try {
|
||||
const logStore = await this.app.getApplicationContext().getAsync(CenterLogService);
|
||||
logStore.stop();
|
||||
} catch (e) {
|
||||
/* ignore */
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user