Skip to content

Commit

Permalink
resolver: make ci happy
Browse files Browse the repository at this point in the history
  • Loading branch information
undefined-moe committed Nov 12, 2024
1 parent 0d7d311 commit 0349a51
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 114 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
/* eslint-disable no-await-in-loop */
import { animated, easings, useSprings } from '@react-spring/web';
import useKey from 'react-use/lib/useKey';
import { React, ReactDOM } from '@hydrooj/ui-default';
import {
addPage, NamedPage, React, ReactDOM,
} from '@hydrooj/ui-default';
import { ResolverInput } from '../interface';

async function scrollTo(offset) {
Expand Down Expand Up @@ -228,6 +230,7 @@ export function start(data: ResolverInput, options: DisplaySettings) {
}, i) => {
const team = teams[i];
const teamInfo = data.teams.find((idx) => idx.id === team.id);
if (!teams[i]) return <animated.div key={i}>Team {i} not found</animated.div>;
if (!teamInfo) return <animated.div key={i}>Team info for id {team.id} not found</animated.div>;
return <animated.div
key={i}
Expand All @@ -251,9 +254,9 @@ export function start(data: ResolverInput, options: DisplaySettings) {
</div>
<div className="problems">
{data.problems.map((v) => {
const uncover = team?.id === selectedTeam && selectedProblem === v.id;
const uncover = team.id === selectedTeam && selectedProblem === v.id;
const problemStatus = team.problems.find((idx) => idx.id === v.id);
return <span className={`${status(problemStatus)} ${uncover ? 'uncover' : ''} item`}>
return <span key={v.id} className={`${status(problemStatus)} ${uncover ? 'uncover' : ''} item`}>
{submissions(problemStatus)}
</span>;
})}
Expand All @@ -268,3 +271,10 @@ export function start(data: ResolverInput, options: DisplaySettings) {
}
ReactDOM.createRoot(document.getElementById('rank-list')!).render(<MainList {...options} data={data} />);
}

addPage(new NamedPage(['resolver'], () => {
start(UiContext.payload, {
showAvatar: true,
showSchool: true,
});
}));
81 changes: 0 additions & 81 deletions packages/onsite-toolkit/frontend/resolver.page.ts

This file was deleted.

30 changes: 0 additions & 30 deletions packages/onsite-toolkit/templates/resolver.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,34 +12,4 @@
</header>
<div class="rank-list" id="rank-list"></div>
<link rel="stylesheet" href="/resolver.css?_={{ Date.now() }}" />
{% if not payload %}
<div class="dialog withBg " style="display: flex; z-index: 1003; opacity: 1;">
<div class="dialog__content" style="transform: scale(1, 1);">
<div class="dialog__body" style="height:calc(100% - 45px)">
<div class="row">
<div class="columns">
<h1>加载数据</h1>
</div>
</div>
<div class="row">
<div class="columns">
<label>
赛事数据
<textarea id="input-data" rows="5" style="width:800px"></textarea>
<br />
<p class="help-text">你也可以在比赛中选择直接滚榜</p>
</label>
</div>
</div>
<div class="row">
<div class="columns clearfix">
<div class="float-right dialog__action">
<button id="load" class="primary rounded button">确定</button>
</div>
</div>
</div>
</div>
</div>
</div>
{% endif %}
{% endblock %}

0 comments on commit 0349a51

Please sign in to comment.