mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
telemetry: sandbox version
This commit is contained in:
1 parent
84c7815ef6
commit
5bc8882738
6 files changed
+20
-4
No files matched your search
@@ -198,7 +198,7 @@ SystemSetting(
|
||||
Setting('setting_smtp', 'smtp.from', null, 'text', 'smtp.from', 'Mail From'),
|
||||
Setting('setting_smtp', 'smtp.secure', false, 'boolean', 'smtp.secure', 'SSL'),
|
||||
Setting('setting_smtp', 'smtp.verify', true, 'boolean', 'smtp.verify', 'Verify register email'),
|
||||
Setting('setting_server', 'server.center', 'https://hydro.undefined.moe:8443/center', 'text', 'server.center', '', FLAG_HIDDEN),
|
||||
Setting('setting_server', 'server.center', 'https://hydro.ac/center', 'text', 'server.center', '', FLAG_HIDDEN),
|
||||
Setting('setting_server', 'server.name', 'Hydro', 'text', 'server.name', 'Server Name'),
|
||||
Setting('setting_server', 'server.displayName', 'Hydro', 'text', 'server.name', 'Server Name (Global Display)', FLAG_PRO),
|
||||
Setting('setting_server', 'server.url', '/', 'text', 'server.url', 'Server BaseURL'),
|
||||
|
||||
@@ -33,6 +33,13 @@ export async function feedback(): Promise<[string, StatusUpdate]> {
|
||||
document.coll.find({ docType: document.TYPE_DISCUSSION }).count(),
|
||||
record.coll.find().count(),
|
||||
]);
|
||||
let sandbox = '';
|
||||
try {
|
||||
let host = system.get('hydrojudge.sandbox_host') || 'http://localhost:5050/';
|
||||
if (!host.endsWith('/')) host += '/';
|
||||
const res = await superagent.get(`${host}version`);
|
||||
sandbox = res.body;
|
||||
} catch (e) { }
|
||||
const payload = crypt(dump({
|
||||
mid: mid.toString(),
|
||||
version,
|
||||
@@ -47,6 +54,7 @@ export async function feedback(): Promise<[string, StatusUpdate]> {
|
||||
memory: inf.memory,
|
||||
osinfo: inf.osinfo,
|
||||
cpu: inf.cpu,
|
||||
sandbox,
|
||||
}, {
|
||||
replacer: (key, value) => {
|
||||
if (typeof value === 'function') return '';
|
||||
|
||||
@@ -791,6 +791,10 @@ const scripts: UpgradeScript[] = [
|
||||
);
|
||||
return true;
|
||||
},
|
||||
async function _64_65() {
|
||||
await system.set('server.center', 'https://hydro.ac/center');
|
||||
return true;
|
||||
},
|
||||
];
|
||||
|
||||
export default scripts;
|
||||
Reference in new issue
Block a user