add unrank & star user on scoreboard ui

This commit is contained in:
panda committed 2022-12-17 01:14:52 +00:00
1 parent dc0e397d77
commit b8fd94df50
5 files changed
+48 -11

No files matched your search

+2 -1
View File
@@ -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
+4
View File
@@ -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]);
}
+2 -2
View File
@@ -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) {