新增#椰奶监控

This commit is contained in:
yeyang
2023-04-21 21:26:15 +08:00
parent b17c086a67
commit 135f111198
6 changed files with 203 additions and 70 deletions

View File

@@ -24,20 +24,19 @@ export class NewState extends plugin {
}
async state (e) {
if (!/椰奶/.test(e.msg) && !Config.Notice.state) return false
if (!State.si) return e.reply('❎ 没有检测到systeminformation依赖请运行"pnpm add systeminformation -w"进行安装')
if (e.msg.includes('监控')) {
let data = {
chartData: JSON.stringify(_.every(_.omit(State.chartData, 'echarts_theme'), _.isEmpty) ? undefined : State.chartData)
}
return await puppeteer.render('state/monitor', {
...data
chartData: JSON.stringify(State.chartData)
}, {
e,
scale: 1.4
})
}
if (!/椰奶/.test(e.msg) && !Config.Notice.state) return false
if (!State.si) return e.reply('❎ 没有检测到systeminformation依赖请运行"pnpm add systeminformation -w"进行安装')
// 防止多次触发
if (interval) { return false } else interval = true
// 系统