mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 09:36:08 +08:00
ui: move limits display to sidebar
This commit is contained in:
1 parent
90443546c8
commit
5bd851028c
4 files changed
+20
-19
No files matched your search
@@ -6,7 +6,7 @@ import {
|
||||
SolutionNotFoundError, ProblemNotFoundError, BadRequestError,
|
||||
} from '../error';
|
||||
import {
|
||||
Pdoc, User, Rdoc, PathComponent,
|
||||
Pdoc, User, Rdoc, PathComponent, ProblemStatusDoc,
|
||||
} from '../interface';
|
||||
import paginate from '../lib/paginate';
|
||||
import { isPid } from '../lib/validator';
|
||||
@@ -157,8 +157,12 @@ export class ProblemRandomHandler extends ProblemHandler {
|
||||
}
|
||||
}
|
||||
|
||||
export interface PdocWithPsdoc extends Pdoc {
|
||||
psdoc?: ProblemStatusDoc
|
||||
}
|
||||
|
||||
export class ProblemDetailHandler extends ProblemHandler {
|
||||
pdoc: Pdoc;
|
||||
pdoc: PdocWithPsdoc;
|
||||
udoc: User;
|
||||
|
||||
@route('pid', Types.Name, true, null, parsePid)
|
||||
@@ -196,6 +200,9 @@ export class ProblemDetailHandler extends ProblemHandler {
|
||||
} catch (e) {
|
||||
this.response.body.pdoc.config = `Cannot parse: ${e.message}`;
|
||||
}
|
||||
if (this.pdoc.psdoc) {
|
||||
this.response.body.rdoc = await record.get(this.domainId, this.pdoc.psdoc.rid);
|
||||
}
|
||||
}
|
||||
|
||||
@param('pid', Types.UnsignedInt)
|
||||
|
||||
@@ -88,7 +88,7 @@ class Loader extends nunjucks.Loader {
|
||||
};
|
||||
}
|
||||
let fullpath = null;
|
||||
if (typeof argv.template !== 'string') argv.template = path.resolve(__dirname, '..', 'template');
|
||||
if (typeof argv.template !== 'string') argv.template = path.resolve(__dirname, '..', 'templates');
|
||||
const p = path.resolve(process.cwd(), argv.template, name);
|
||||
if (fs.existsSync(p)) fullpath = p;
|
||||
if (!fullpath) {
|
||||
|
||||
@@ -114,6 +114,10 @@
|
||||
<dl class="large horizontal">
|
||||
<dt>{{ _('ID') }}</dt>
|
||||
<dd>{{ pdoc.docId }}</dd>
|
||||
<dt>{{ _('Time') }}</dt>
|
||||
<dd>{{ pdoc.config.timeMax if pdoc.config.timeMax == pdoc.config.timeMin else pdoc.config.timeMin+'~'+pdoc.config.timeMax }}ms</dd>
|
||||
<dt>{{ _('Memory') }}</dt>
|
||||
<dd>{{ pdoc.config.memoryMax if pdoc.config.memoryMax == pdoc.config.memoryMin else pdoc.config.memoryMin+'~'+pdoc.config.memoryMax }}MiB</dd>
|
||||
{% if page_name != 'discussion_node' and page_name != 'discussion_detail' %}
|
||||
{% if handler.user.hasPriv(PRIV.PRIV_USER_PROFILE) %}
|
||||
<dt>{{ _('Submission') }}</dt>
|
||||
|
||||
@@ -24,28 +24,18 @@
|
||||
<div class="medium-9 columns">
|
||||
<div class="section">
|
||||
<div class="problem-content-container"><div class="problem-content" data-marker-enabled>
|
||||
<div class="section__header non-scratchpad--hide">
|
||||
<h1 class="section__title">
|
||||
{%- if rdoc -%}
|
||||
<span class="icon record-status--icon {{ model.builtin.STATUS_CODES[rdoc['status']] }}"></span>
|
||||
<span class="record-status--text {{ model.builtin.STATUS_CODES[rdoc['status']] }}">
|
||||
{{ rdoc.score }}
|
||||
</span>
|
||||
{%- endif %}
|
||||
{{ pdoc.title }}
|
||||
</h1>
|
||||
</div>
|
||||
<div class="section__header scratchpad--hide">
|
||||
<div class="section__header">
|
||||
{% if rdoc %}
|
||||
<h1 class="section__title">
|
||||
<h1 class="section__title scratchpad--hide">
|
||||
<span class="icon record-status--icon {{ model.builtin.STATUS_CODES[rdoc['status']] }}"></span>
|
||||
<span class="record-status--text {{ model.builtin.STATUS_CODES[rdoc['status']] }}">
|
||||
{{ rdoc.score }}
|
||||
{{ 'Accepted' if rdoc.status == model.builtin.STATUS.STATUS_ACCEPTED else rdoc.score }}
|
||||
</span>
|
||||
</h1>
|
||||
{% endif %}
|
||||
<span class="record-status--text">{{ _('Time Limit') }}: {{ pdoc.config.timeMax if pdoc.config.timeMax == pdoc.config.timeMin else pdoc.config.timeMin+'~'+pdoc.config.timeMax }}ms</span>
|
||||
<span class="record-status--text">{{ _('Memory Limit') }}: {{ pdoc.config.memoryMax if pdoc.config.memoryMax == pdoc.config.memoryMin else pdoc.config.memoryMin+'~'+pdoc.config.memoryMax }}MiB</span>
|
||||
<h1 class="section__title non-scratchpad--hide">
|
||||
{{ pdoc.title }}
|
||||
</h1>
|
||||
</div>
|
||||
<div class="section__body typo">
|
||||
{% if tdoc %}
|
||||
|
||||
Reference in new issue
Block a user