From 7c9764bd7c03019cfc797b112d2b697de62c29f9 Mon Sep 17 00:00:00 2001 From: zouap Date: Fri, 8 Apr 2022 16:32:21 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zouap --- templates/repo/cloudbrain/show.tmpl | 58 ++++++++++++++++------------- 1 file changed, 33 insertions(+), 25 deletions(-) diff --git a/templates/repo/cloudbrain/show.tmpl b/templates/repo/cloudbrain/show.tmpl index 6fbff5956..c22012d3b 100755 --- a/templates/repo/cloudbrain/show.tmpl +++ b/templates/repo/cloudbrain/show.tmpl @@ -226,7 +226,7 @@ td, th {
@@ -418,17 +418,6 @@ td, th {
-
-
- {{$.i18n.Tr "repo.cloudbrain.exitinfo"}} - -
-
-
- - {{$.result.JobStatus.AppExitDiagnostics}} - -
@@ -439,8 +428,9 @@ td, th {
- - {{$.result.JobStatus.AppExitDiagnostics}} + + +
@@ -499,17 +489,35 @@ td, th { jobName = urlArr.slice(-1)[0] }) - function loadLog(version_name){ - document.getElementById("mask").style.display = "block" - $.get(`/api/v1/repos/${userName}/${repoPath}/cloudbrain/${jobName}/log?version_name=${version_name}&lines=50&order=asc`, (data) => { - $('input[name=end_line]').val(data.EndLine) - $('input[name=start_line]').val(data.StartLine) - $(`#log_file${version_name}`).text(data.Content) - document.getElementById("mask").style.display = "none" - }).fail(function(err) { - console.log(err); - document.getElementById("mask").style.display = "none" - }); + function parseLog(){ + let jsonValue = document.getElementById("json_value").value; + let jsonObj = JSON.parse(jsonValue); + let podRoleName = jsonObj["podRoleName"]; + let html = ""; + if (podRoleName != null){ + let task0 = podRoleName["task1-0"]; + let podEvents = jsonObj["podEvents"]; + let podEventArray = podEvents[task0]; + if(podEventArray != null){ + for(int i=0; i < podEventArray.length;i++){ + html +="

" +podEventArray[i]["reason"] + "

"; + html +="

" +podEventArray[i]["message"] + "

"; + html +="

" +podEventArray[i]["action"] + "

"; + } + } + let extras= jsonObj["extras"]; + if(extras != null){ + html +="

" +extras["reason"] + "

"; + html +="

" +extras["message"] + "

"; + html +="

" +extras["action"] + "

"; + } + + document.getElementById("info_display").innerHTML=html; + } + + + } +