mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 09:36:08 +08:00
core: fix training_detail.progress display
This commit is contained in:
1 parent
15827eeabb
commit
3abae22545
2 files changed
+2
-2
No files matched your search
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "hydrooj",
|
||||
"version": "2.26.15",
|
||||
"version": "2.26.16",
|
||||
"bin": "bin/hydrooj.js",
|
||||
"main": "dist/loader.js",
|
||||
"typings": "dist/loader.d.ts",
|
||||
|
||||
@@ -123,7 +123,7 @@ class TrainingDetailHandler extends Handler {
|
||||
for (const node of tdoc.dag) {
|
||||
ndict[node._id] = node;
|
||||
const totalCount = node.pids.length;
|
||||
const doneCount = Set.union(new Set(node.pids), donePids).size;
|
||||
const doneCount = Set.intersection(new Set(node.pids), donePids).size;
|
||||
const nsdoc = {
|
||||
progress: totalCount ? Math.floor(100 * (doneCount / totalCount)) : 100,
|
||||
isDone: training.isDone(node, doneNids, donePids),
|
||||
|
||||
Reference in new issue
Block a user