mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +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",
|
"name": "hydrooj",
|
||||||
"version": "2.26.15",
|
"version": "2.26.16",
|
||||||
"bin": "bin/hydrooj.js",
|
"bin": "bin/hydrooj.js",
|
||||||
"main": "dist/loader.js",
|
"main": "dist/loader.js",
|
||||||
"typings": "dist/loader.d.ts",
|
"typings": "dist/loader.d.ts",
|
||||||
|
|||||||
@@ -123,7 +123,7 @@ class TrainingDetailHandler extends Handler {
|
|||||||
for (const node of tdoc.dag) {
|
for (const node of tdoc.dag) {
|
||||||
ndict[node._id] = node;
|
ndict[node._id] = node;
|
||||||
const totalCount = node.pids.length;
|
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 = {
|
const nsdoc = {
|
||||||
progress: totalCount ? Math.floor(100 * (doneCount / totalCount)) : 100,
|
progress: totalCount ? Math.floor(100 * (doneCount / totalCount)) : 100,
|
||||||
isDone: training.isDone(node, doneNids, donePids),
|
isDone: training.isDone(node, doneNids, donePids),
|
||||||
|
|||||||
Reference in new issue
Block a user