mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
add unrank & star user on scoreboard ui
This commit is contained in:
1 parent
dc0e397d77
commit
b8fd94df50
5 files changed
+48
-11
No files matched your search
@@ -368,7 +368,8 @@ export interface Tdoc<docType = document['TYPE_CONTEST'] | document['TYPE_TRAINI
|
||||
unlocked?: boolean;
|
||||
access?: number;
|
||||
autoHide?: boolean;
|
||||
unrankUsers?: number[];
|
||||
unrankUser?: number[];
|
||||
uninvite?: boolean;
|
||||
|
||||
/**
|
||||
* In hours
|
||||
|
||||
@@ -11,6 +11,10 @@ const ranked: ranked = async (cursor, equ) => {
|
||||
for (const doc of docs) {
|
||||
count++;
|
||||
if (!last || !equ(last, doc)) r = count;
|
||||
if (doc.unrank) {
|
||||
results.push([0, doc]);
|
||||
continue;
|
||||
}
|
||||
last = doc;
|
||||
results.push([r, doc]);
|
||||
}
|
||||
|
||||
@@ -127,7 +127,7 @@ const acm = buildContestRule({
|
||||
async scoreboardRow(isExport, _, tdoc, pdict, udoc, rank, tsdoc, meta) {
|
||||
const tsddict = tsdoc.detail || {};
|
||||
const row: ScoreboardRow = [
|
||||
{ type: 'rank', value: rank.toString() },
|
||||
{ type: 'rank', value: rank ? rank.toString() : '*' },
|
||||
{ type: 'user', value: udoc.uname, raw: tsdoc.uid },
|
||||
];
|
||||
if (isExport) {
|
||||
@@ -263,7 +263,7 @@ const oi = buildContestRule({
|
||||
async scoreboardRow(isExport, _, tdoc, pdict, udoc, rank, tsdoc, meta) {
|
||||
const tsddict = tsdoc.detail || {};
|
||||
const row: ScoreboardNode[] = [
|
||||
{ type: 'rank', value: rank.toString() },
|
||||
{ type: 'rank', value: rank ? rank.toString() : '*' },
|
||||
{ type: 'user', value: udoc.uname, raw: tsdoc.uid },
|
||||
];
|
||||
if (isExport) {
|
||||
|
||||
Reference in new issue
Block a user