mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
ui: 修复比赛中评测记录列表不会自动刷新的问题
This commit is contained in:
1 parent
998248e212
commit
bc90574735
5 files changed
+11
-8
No files matched your search
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "hydrooj",
|
"name": "hydrooj",
|
||||||
"version": "2.30.10",
|
"version": "2.30.11",
|
||||||
"bin": "bin/hydrooj.js",
|
"bin": "bin/hydrooj.js",
|
||||||
"main": "src/loader",
|
"main": "src/loader",
|
||||||
"module": "src/loader",
|
"module": "src/loader",
|
||||||
|
|||||||
@@ -232,9 +232,9 @@ class RecordMainConnectionHandler extends ConnectionHandler {
|
|||||||
// eslint-disable-next-line prefer-const
|
// eslint-disable-next-line prefer-const
|
||||||
let [udoc, pdoc] = await Promise.all([
|
let [udoc, pdoc] = await Promise.all([
|
||||||
user.getById(this.domainId, rdoc.uid),
|
user.getById(this.domainId, rdoc.uid),
|
||||||
problem.get(this.domainId, rdoc.pid),
|
problem.get(rdoc.pdomain, rdoc.pid),
|
||||||
]);
|
]);
|
||||||
const tdoc = this.tid ? contest.get(this.domainId, new ObjectID(this.tid)) : null;
|
const tdoc = this.tid ? await contest.get(this.domainId, new ObjectID(this.tid)) : null;
|
||||||
if (pdoc && !rdoc.contest) {
|
if (pdoc && !rdoc.contest) {
|
||||||
if (pdoc.hidden && !this.user.own(pdoc) && !this.user.hasPerm(PERM.PERM_VIEW_PROBLEM_HIDDEN)) pdoc = null;
|
if (pdoc.hidden && !this.user.own(pdoc) && !this.user.hasPerm(PERM.PERM_VIEW_PROBLEM_HIDDEN)) pdoc = null;
|
||||||
if (!this.user.hasPerm(PERM.PERM_VIEW_PROBLEM)) pdoc = null;
|
if (!this.user.hasPerm(PERM.PERM_VIEW_PROBLEM)) pdoc = null;
|
||||||
|
|||||||
@@ -103,9 +103,9 @@ export interface EventMap extends Record<string, any> {
|
|||||||
|
|
||||||
function getHooks<K extends keyof EventMap>(name: K) {
|
function getHooks<K extends keyof EventMap>(name: K) {
|
||||||
const hooks = _hooks[name] || (_hooks[name] = []);
|
const hooks = _hooks[name] || (_hooks[name] = []);
|
||||||
if (hooks.length >= 128) {
|
if (hooks.length >= 2048) {
|
||||||
logger.warn(
|
logger.warn(
|
||||||
'max listener count (128) for event "%s" exceeded, which may be caused by a memory leak',
|
'max listener count (2048) for event "%s" exceeded, which may be caused by a memory leak',
|
||||||
name,
|
name,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@hydrooj/ui-default",
|
"name": "@hydrooj/ui-default",
|
||||||
"version": "4.14.8",
|
"version": "4.14.9",
|
||||||
"author": "undefined <i@undefined.moe>",
|
"author": "undefined <i@undefined.moe>",
|
||||||
"license": "AGPL-3.0",
|
"license": "AGPL-3.0",
|
||||||
"main": "hydro.js",
|
"main": "hydro.js",
|
||||||
|
|||||||
@@ -1,6 +1,10 @@
|
|||||||
{% extends "layout/basic.html" %}
|
{% extends "layout/basic.html" %}
|
||||||
{% block content %}
|
{% block content %}
|
||||||
{{ set(UiContext, 'socketUrl', "/record-conn?domainId=" + handler.domainId) }}
|
{% if filterTid %}
|
||||||
|
{{ set(UiContext, 'socketUrl', "/record-conn?domainId=" + handler.domainId + "&tid=" + filterTid) }}
|
||||||
|
{% else %}
|
||||||
|
{{ set(UiContext, 'socketUrl', "/record-conn?domainId=" + handler.domainId) }}
|
||||||
|
{% endif %}
|
||||||
{{ set(UiContext, 'rids', rdocs.map(eval("rdoc=>rdoc._id.toString()"))) }}
|
{{ set(UiContext, 'rids', rdocs.map(eval("rdoc=>rdoc._id.toString()"))) }}
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="medium-12 columns">
|
<div class="medium-12 columns">
|
||||||
@@ -15,7 +19,6 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="section__body">
|
<div class="section__body">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<!-- TODO: replace with form_builder -->
|
|
||||||
<div class="medium-3 columns">
|
<div class="medium-3 columns">
|
||||||
<label class="filter-user">
|
<label class="filter-user">
|
||||||
{{ _('By Username / UID') }}
|
{{ _('By Username / UID') }}
|
||||||
|
|||||||
Reference in new issue
Block a user