diff options
Diffstat (limited to 'services')
| -rw-r--r-- | services/app/assets/loading.js | 8 | ||||
| -rw-r--r-- | services/app/src/App.php | 2 | ||||
| -rw-r--r-- | services/app/templates/answer_view.html.twig | 4 |
3 files changed, 13 insertions, 1 deletions
diff --git a/services/app/assets/loading.js b/services/app/assets/loading.js index 4c75692..49d8b48 100644 --- a/services/app/assets/loading.js +++ b/services/app/assets/loading.js @@ -11,6 +11,8 @@ document.addEventListener('DOMContentLoaded', () => { ); const statusElemsMap = getElemsMap('js-testcase-execution-status'); const statusLoadingIndicatorElemsMap = getElemsMap('js-testcase-execution-status-loading-indicator'); + const stdoutElemsMap = getElemsMap('js-testcase-execution-stdout'); + const stderrElemsMap = getElemsMap('js-testcase-execution-stderr'); if (!aggregatedStatusLoadingIndicatorElem) { return; @@ -30,12 +32,16 @@ document.addEventListener('DOMContentLoaded', () => { for (const ex of testcase_executions) { const statusElem = statusElemsMap.get(ex.id); const loadingIndicatorElem = statusLoadingIndicatorElemsMap.get(ex.id); + const stdoutElem = stdoutElemsMap.get(ex.id); + const stderrElem = stderrElemsMap.get(ex.id); - const { status } = ex; + const { status, stdout, stderr } = ex; if (status.label === statusElem.textContent) { continue; } statusElem.textContent = status.label; + stdoutElem.textContent = stdout; + stderrElem.textContent = stderr; if (loadingIndicatorElem && !status.show_loading_indicator) { loadingIndicatorElem.remove(); } diff --git a/services/app/src/App.php b/services/app/src/App.php index aef1b12..6cb9dc2 100644 --- a/services/app/src/App.php +++ b/services/app/src/App.php @@ -935,6 +935,8 @@ final class App 'label' => $ex->status->label(), 'show_loading_indicator' => $ex->status->showLoadingIndicator(), ], + 'stdout' => $ex->stdout, + 'stderr' => $ex->stderr, ], $testcaseExecutions), 'phper_token' => $phper_token, ])->withStatus(200); diff --git a/services/app/templates/answer_view.html.twig b/services/app/templates/answer_view.html.twig index 8c7e090..1ec88ab 100644 --- a/services/app/templates/answer_view.html.twig +++ b/services/app/templates/answer_view.html.twig @@ -46,6 +46,10 @@ <div class="js-testcase-execution-status-loading-indicator spinner-border text-primary spinner-border-sm" role="status" data-testcase-execution-id="{{ ex.testcase_execution_id }}"><span class="visually-hidden">Loading...</span></div> {% endif %} </div> + <h4>標準出力</h4> + <pre><code class="js-testcase-execution-stdout hljs language-plaintext" data-testcase-execution-id="{{ ex.testcase_execution_id }}">{{ ex.stdout }}</code></pre> + <h4>標準エラー出力</h4> + <pre><code class="js-testcase-execution-stderr hljs language-plaintext" data-testcase-execution-id="{{ ex.testcase_execution_id }}">{{ ex.stderr }}</code></pre> {% endfor %} </div> <script type="module" src="{{ base_path() }}/assets/loading.js"></script> |
