mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-19 01:38:19 +08:00
workspace: add oxlint
This commit is contained in:
18 files changed
+120
-44
No files matched your search
@@ -2,7 +2,7 @@ import * as status from '@hydrooj/common/status';
|
||||
import { findFileSync } from '@hydrooj/utils/lib/utils';
|
||||
import { convert } from 'html-to-text';
|
||||
import {
|
||||
avatar, Context, fs, PERM, PRIV, Service, STATUS, yaml,
|
||||
avatar, Context, difficultyAlgorithm, fs, PERM, PRIV, Service, STATUS, yaml,
|
||||
} from 'hydrooj';
|
||||
import jsesc from 'jsesc';
|
||||
import nunjucks from 'nunjucks';
|
||||
@@ -134,6 +134,7 @@ class Nunjucks extends nunjucks.Environment {
|
||||
this.addGlobal('avatarUrl', avatar);
|
||||
this.addGlobal('formatSeconds', misc.formatSeconds);
|
||||
this.addGlobal('model', global.Hydro.model);
|
||||
this.addGlobal('lib', { difficulty: difficultyAlgorithm });
|
||||
this.addGlobal('ui', global.Hydro.ui);
|
||||
this.addGlobal('isIE', (str) => {
|
||||
if (!str) return false;
|
||||
|
||||
@@ -38,7 +38,7 @@ export default function reducer(state = {}, action = {}) {
|
||||
return {
|
||||
...state,
|
||||
[to]: {
|
||||
...state[to] || {},
|
||||
...state[to],
|
||||
udoc,
|
||||
messages: [
|
||||
...state[to]?.messages || [],
|
||||
|
||||
@@ -242,7 +242,7 @@ const page = new NamedPage(['problem_detail', 'contest_detail_problem', 'homewor
|
||||
function ProblemNavigation() {
|
||||
[, setUpdate] = React.useState(0);
|
||||
return <div className="contest-problems" style={{ margin: '1em' }}>
|
||||
{pids.map((i) => <a href={`#p${i}`} className={ans[i] ? 'pending ' : ''}>
|
||||
{pids.map((i) => <a href={`#p${i}`} key={i} className={ans[i] ? 'pending ' : ''}>
|
||||
<span className="id">{i}</span>
|
||||
</a>)}
|
||||
</div>;
|
||||
|
||||
@@ -160,12 +160,12 @@ async function get(request: Request) {
|
||||
method: request.method,
|
||||
credentials: isResource ? 'same-origin' : 'include',
|
||||
headers: request.headers,
|
||||
body: request.body,
|
||||
redirect: request.redirect,
|
||||
keepalive: request.keepalive,
|
||||
referrer: request.referrer,
|
||||
referrerPolicy: request.referrerPolicy,
|
||||
signal: request.signal,
|
||||
...(request.method.toLowerCase() === 'get' ? {} : { body: request.body }),
|
||||
});
|
||||
if (r.ok) {
|
||||
console.log('Load success from ', source.toString());
|
||||
|
||||
Reference in new issue
Block a user