mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
core: fix js-yaml options
This commit is contained in:
1 parent
2f99407669
commit
591dbd31c0
9 files changed
+25
-29
No files matched your search
@@ -113,10 +113,10 @@ ${padEnd(formatSeconds(Math.floor((Date.now() - i.pm2_env.pm_uptime) / 1000), fa
|
||||
infoDetails['now'] = new Date().toISOString();
|
||||
infos['now'] = new Date().toISOString();
|
||||
logger.info('System info:');
|
||||
console.log(yaml.dump(infos, { noCompatMode: true, noArrayIndent: true, lineWidth: process.stdout.columns || 80 }));
|
||||
console.log(yaml.dump(infos, { schema: yaml.CORE_SCHEMA, seqNoIndent: true, lineWidth: process.stdout.columns || 80 }));
|
||||
logger.info('Uploading detail to pastebin...');
|
||||
const tmpFile = path.join(tmpdir(), 'report.yaml');
|
||||
fs.writeFileSync(tmpFile, yaml.dump(infoDetails, { noArrayIndent: true, lineWidth: 300 }));
|
||||
fs.writeFileSync(tmpFile, yaml.dump(infoDetails, { seqNoIndent: true, lineWidth: 300 }));
|
||||
if (process.env.VSCODE_INJECTION) {
|
||||
try {
|
||||
child.exec(`code ${tmpFile}`);
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { dump } from 'js-yaml';
|
||||
import { cloneDeepWith } from 'lodash';
|
||||
import superagent from 'superagent';
|
||||
import type { StatusUpdate } from '@hydrooj/utils/lib/sysinfo';
|
||||
import * as sysinfo from '@hydrooj/utils/lib/sysinfo';
|
||||
@@ -55,12 +56,7 @@ export async function feedback(): Promise<[string, StatusUpdate]> {
|
||||
info.dbVersion = status.version;
|
||||
} catch (e) { }
|
||||
await bus.serial('monitor/collect', info);
|
||||
const payload = dump(info, {
|
||||
replacer: (key, value) => {
|
||||
if (typeof value === 'function') return '';
|
||||
return value;
|
||||
},
|
||||
});
|
||||
const payload = dump(cloneDeepWith(info, (value) => typeof value === 'function' ? '' : undefined));
|
||||
if (process.env.CI) return [mid, $update];
|
||||
superagent.post(`${system.get('server.center')}/report`)
|
||||
.send({ installId, payload })
|
||||
|
||||
Reference in new issue
Block a user