update types

This commit is contained in:
undefined committed 2023-12-17 21:46:00 +08:00
1 parent 3a28faff25
commit ca65b3371f
2 files changed
+2 -7

No files matched your search

+1 -6
View File
@@ -106,10 +106,7 @@ class SystemScriptHandler extends SystemHandler {
args = global.Hydro.script[id].validate(args); args = global.Hydro.script[id].validate(args);
} }
const rid = await record.add(domainId, -1, this.user._id, '-', id, false, { input: raw, type: 'pretest' }); const rid = await record.add(domainId, -1, this.user._id, '-', id, false, { input: raw, type: 'pretest' });
const rdoc = await record.get(rid); const report = (data) => judge.next({ domainId, rid, ...data });
const report = (data) => judge.next({
domainId, rid, ...data, rdoc,
});
report({ message: `Running script: ${id} `, status: STATUS.STATUS_JUDGING }); report({ message: `Running script: ${id} `, status: STATUS.STATUS_JUDGING });
const start = Date.now(); const start = Date.now();
// Maybe async? // Maybe async?
@@ -124,7 +121,6 @@ class SystemScriptHandler extends SystemHandler {
judger: 1, judger: 1,
time, time,
memory: 0, memory: 0,
rdoc,
}); });
}) })
.catch((err: Error) => { .catch((err: Error) => {
@@ -138,7 +134,6 @@ class SystemScriptHandler extends SystemHandler {
judger: 1, judger: 1,
time, time,
memory: 0, memory: 0,
rdoc,
}); });
}); });
this.response.body = { rid }; this.response.body = { rid };
@@ -4,7 +4,7 @@
{% if avatar %} {% if avatar %}
<img class="small user-profile-avatar v-center" loading="lazy" src="{{ avatarUrl(udoc.avatar|default('')) }}" width="20" height="20"> <img class="small user-profile-avatar v-center" loading="lazy" src="{{ avatarUrl(udoc.avatar|default('')) }}" width="20" height="20">
{% endif %} {% endif %}
<a class="user-profile-name" href="{{ url('user_detail', uid=udoc._id) }}"> <a class="user-profile-name uname--lv{{ udoc.level|default(0) }}" href="{{ url('user_detail', uid=udoc._id) }}">
{% if handler.user.hasPerm(perm.PERM_VIEW_DISPLAYNAME) and udoc.displayName and udoc.displayName != udoc.uname %} {% if handler.user.hasPerm(perm.PERM_VIEW_DISPLAYNAME) and udoc.displayName and udoc.displayName != udoc.uname %}
{{ udoc.displayName }} ({{ udoc.uname }}) {{ udoc.displayName }} ({{ udoc.uname }})
{% else %} {% else %}