feat:移除了弹窗,服务器添加sls

This commit is contained in:
2026-09-08 22:39:45 +08:00
commit 6a295f9a7a
4082 changed files with 1322534 additions and 0 deletions

View File

@ -0,0 +1,40 @@
import fs from 'node:fs/promises'
const [file] = process.argv.slice(2)
const input = file
? await fs.readFile(file, 'utf8')
: await new Promise((resolve, reject) => {
let data = ''
process.stdin.setEncoding('utf8')
process.stdin.on('data', (chunk) => {
data += chunk
})
process.stdin.on('end', () => resolve(data))
process.stdin.on('error', reject)
})
const engines = { 0: 'legacy', 1: 'xmcl' }
const rules = {
1: 'R1NoProgress',
2: 'R2BelowExpectation',
3: 'R3SegmentWaste',
4: 'R4FrequentSwitches',
}
const sources = {
0: 'official',
1: 'bmclapi',
2: 'mcim',
3: 'alternate',
4: 'unknown',
5: 'tianpao',
}
for (const line of input.split('\n')) {
if (!line) continue
const [timestamp, engine, rule, source, ...detail] = line.split('|')
const date = new Date(Number(timestamp) * 1000).toISOString()
console.log(
`${date} engine=${engines[engine] ?? engine} rule=${rules[rule] ?? rule} source=${sources[source] ?? source} ${detail.join('|')}`,
)
}