From 4c307c9d8b124c13daba0dda412967f68009eaf9 Mon Sep 17 00:00:00 2001 From: zouap Date: Fri, 8 Apr 2022 16:41:55 +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 --- public/home/search.js | 26 ++++++++++++++++++++ templates/repo/cloudbrain/show.tmpl | 48 ++++++++++++++++++------------------- 2 files changed, 50 insertions(+), 24 deletions(-) diff --git a/public/home/search.js b/public/home/search.js index e23d27549..8a8e940cb 100644 --- a/public/home/search.js +++ b/public/home/search.js @@ -129,6 +129,32 @@ function search(){ } } +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; + } + } + function emptySearch(){ initDiv(false); initPageInfo(); diff --git a/templates/repo/cloudbrain/show.tmpl b/templates/repo/cloudbrain/show.tmpl index 3040fce8d..2a164e8de 100755 --- a/templates/repo/cloudbrain/show.tmpl +++ b/templates/repo/cloudbrain/show.tmpl @@ -168,31 +168,31 @@ td, th { }