File tree Expand file tree Collapse file tree 3 files changed +17
-36
lines changed Expand file tree Collapse file tree 3 files changed +17
-36
lines changed Original file line number Diff line number Diff line change @@ -377,15 +377,8 @@ public function viewAction(
377
377
}
378
378
$ runs [] = $ runResult [0 ];
379
379
unset($ runResult [0 ]);
380
- if (empty ($ runResult ['metadata ' ])) {
381
- $ runResult ['cpu_time ' ] = $ firstJudgingRun === null ? 'n/a ' : $ firstJudgingRun ->getRuntime ();
382
- } else {
380
+ if (!empty ($ runResult ['metadata ' ])) {
383
381
$ metadata = $ this ->dj ->parseMetadata ($ runResult ['metadata ' ]);
384
- $ runResult ['cpu_time ' ] = $ metadata ['cpu-time ' ];
385
- $ runResult ['wall_time ' ] = $ metadata ['wall-time ' ];
386
- $ runResult ['memory ' ] = Utils::printsize ((int )$ metadata ['memory-bytes ' ], 2 );
387
- $ runResult ['exitcode ' ] = $ metadata ['exitcode ' ];
388
- $ runResult ['signal ' ] = $ metadata ['signal ' ] ?? -1 ;
389
382
$ runResult ['output_limit ' ] = $ metadata ['output-truncated ' ];
390
383
}
391
384
$ runResult ['terminated ' ] = preg_match ('/timelimit exceeded.*hard (wall|cpu) time/ ' ,
Original file line number Diff line number Diff line change @@ -1066,16 +1066,14 @@ public function printMetadata(?string $metadata): string
1066
1066
}
1067
1067
$ metadata = $ this ->dj ->parseMetadata ($ metadata );
1068
1068
return '<span style="display:inline; margin-left: 5px;"> '
1069
- . '<i class="fas fa-stopwatch" title="runtime"></i> '
1070
- . $ metadata ['cpu-time ' ] . 's '
1071
- . ' CPU, '
1072
- . $ metadata ['wall-time ' ] . 's '
1073
- . ' wall time, '
1074
- . '<i class="fas fa-memory" title="RAM"></i> '
1075
- . Utils::printsize ((int )($ metadata ['memory-bytes ' ]))
1076
- . ', '
1077
- . '<i class="fas fa-exitcode" title="runtime"></i> '
1078
- . 'exit-code: ' . $ metadata ['exitcode ' ];
1069
+ . '<i class="fas fa-stopwatch" title="runtime"></i> '
1070
+ . $ metadata ['cpu-time ' ] . 's CPU, '
1071
+ . $ metadata ['wall-time ' ] . 's wall, '
1072
+ . '<i class="fas fa-memory" title="RAM"></i> '
1073
+ . Utils::printsize ((int )($ metadata ['memory-bytes ' ])) . ', '
1074
+ . '<i class="far fa-question-circle" title="exit-status"></i> '
1075
+ . 'exit-code: ' . $ metadata ['exitcode ' ]
1076
+ . (($ metadata ['signal ' ] ?? -1 ) > 0 ? ' signal: ' . $ metadata ['signal ' ] : '' );
1079
1077
}
1080
1078
1081
1079
public function printWarningContent (ExternalSourceWarning $ warning ): string
Original file line number Diff line number Diff line change 712
712
</span >
713
713
</div >
714
714
<div class =" card-body" >
715
- {% if run .firstJudgingRun is not null and runsOutput [runIdx ].cpu_time %}
716
- <span style =" display:inline; margin-left: 5px;" >
717
- <i class =" fas fa-stopwatch" title =" runtime" ></i >
718
- {{ runsOutput [runIdx ].cpu_time }}s
719
- CPU{% if runsOutput [runIdx ].metadata is not null %},
720
- {{ runsOutput [runIdx ].wall_time }}s wall,
721
- <i class =" fas fa-memory" title =" RAM" ></i >
722
- {{ runsOutput [runIdx ].memory }},
723
- <i class =" far fa-question-circle" title =" exit-code" ></i >
724
- exit code:
725
- {{ runsOutput [runIdx ].exitcode }}{% if runsOutput [runIdx ].signal > 0 %},
726
- signal: {{ runsOutput [runIdx ].signal }}
727
- {% endif %}
728
- <button class =" btn btn-sm btn-outline-secondary" data-bs-toggle =" collapse"
729
- data-bs-target =" #collapseExample-{{ runIdx }}"
730
- aria-expanded =" false" >
731
- show complete metadata
732
- </button >
715
+ {% if run .firstJudgingRun is not null %}
716
+ {{ runsOutput [runIdx ].metadata | printMetadata }}
717
+ <button class =" btn btn-sm btn-outline-secondary" data-bs-toggle =" collapse"
718
+ data-bs-target =" #collapseExample-{{ runIdx }}"
719
+ aria-expanded =" false" >
720
+ show complete metadata
721
+ </button >
722
+ {% if runsOutput [runIdx ].metadata is not null %}
733
723
{% if runsOutput [runIdx ].output_limit %}
734
724
<div class =" alert alert-warning" >
735
725
The submission output (<code >{{ runsOutput [runIdx ].output_limit }}</code >) was
You can’t perform that action at this time.
0 commit comments