mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 09:36:08 +08:00
fix: undefined xcpcio scoreboard team_id (#1082)
This commit is contained in:
1 parent
1b633f1184
commit
15d5cefe85
2 files changed
+4
-4
No files matched your search
@@ -25,12 +25,12 @@ const status = {
|
||||
[STATUS.STATUS_CANCELED]: 'CANCELED',
|
||||
};
|
||||
|
||||
function submissionBase(tdoc: Tdoc, rdoc: RecordDoc) {
|
||||
function submissionBase(tdoc: Tdoc, rdoc: RecordDoc, uid?: number) {
|
||||
// NOTE: rdoc can be either record, or a tsdoc detail entry
|
||||
const submit = new ObjectId(rdoc._id || (rdoc as any).rid).getTimestamp().getTime();
|
||||
return {
|
||||
problem_id: tdoc.pids.indexOf(rdoc.pid),
|
||||
team_id: `${rdoc.uid}`,
|
||||
team_id: `${uid || rdoc.uid}`,
|
||||
timestamp: Math.floor(submit - tdoc.beginAt.getTime()),
|
||||
language: rdoc.lang || '',
|
||||
submission_id: rdoc._id,
|
||||
@@ -60,7 +60,7 @@ async function loadContestState(tdoc: Tdoc, realtime: boolean) {
|
||||
const submit = new ObjectId(j.rid as string).getTimestamp().getTime();
|
||||
const curStatus = status[j.status] || 'SYSTEM_ERROR';
|
||||
return {
|
||||
...submissionBase(tdoc, j),
|
||||
...submissionBase(tdoc, j, i.uid),
|
||||
status: (ContestModel.isLocked(tdoc) && submit > tdoc.lockAt.getTime() && !realtime)
|
||||
? 'PENDING'
|
||||
: curStatus,
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<div>
|
||||
<ol class="menu">
|
||||
{% if mode == 'contest' or mode == 'correction' %}
|
||||
{% if page_name == 'contest_detail_problem' and handler.ctx.setting.get('ui-default.enableScratchpad') %} %}
|
||||
{% if page_name == 'contest_detail_problem' and handler.ctx.setting.get('ui-default.enableScratchpad') %}
|
||||
<li class="menu__item scratchpad--hide nojs--hide"><a class="menu__link highlight" name="problem-sidebar__open-scratchpad" href="javascript:;" data-global-hotkey="alt+e">
|
||||
<span class="icon icon-enlarge"></span> {{ _('Open Scratchpad') }} (Alt+E)
|
||||
</a></li>
|
||||
|
||||
Reference in new issue
Block a user