@@ -609,10 +628,10 @@ td, th {
// }
let status = $(`#${versionname}-status-span`).text()
- if(['IMAGE_FAILED','SUBMIT_FAILED','DELETE_FAILED','KILLED','COMPLETED','FAILED','CANCELED','LOST','START_FAILED','SUCCEEDED'].includes(status)){
+ if(['IMAGE_FAILED','SUBMIT_FAILED','DELETE_FAILED','KILLED','COMPLETED','FAILED','CANCELED','LOST','START_FAILED','SUCCEEDED','STOPPED'].includes(status)){
return
}
- let stopArray=["KILLED","FAILED","START_FAILED","KILLING","COMPLETED","SUCCEEDED"]
+ let stopArray=["KILLED","FAILED","START_FAILED","KILLING","COMPLETED","SUCCEEDED","STOPPED"]
$.get(`/api/v1/repos/${repoPath}/cloudbrain/${taskID}?version_name=${versionname}`, (data) => {
//$(`#${versionname}-duration-span`).text(data.JobDuration)
$(`#${versionname}-status-span span`).text(data.JobStatus)
@@ -649,5 +668,42 @@ td, th {
});
stopBubbling(arguments.callee.caller.arguments[0])
}
+
+ function parseInfo(){
+ 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(var 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){
+ for(var i=0; i < extras.length;i++){
+ html +="
[" +extras[i]["reason"] + "]
";
+ html +="
" +extras[i]["message"] + "
";
+ html +="
" +extras[i]["action"] + "
";
+ }
+ }
+ }
+
+ let string = document.getElementById("ExitDiagnostics").value;
+ string = string.replace(/\r\n/g,"
")
+ string = string.replace(/\n/g,"
");
+ string = string.replace(/(\r\n)|(\n)/g,'
');
+
+ html +="
[ExitDiagnostics]
";
+ html +="
" +string + "
";
+
+ document.getElementById("info_display").innerHTML=html;
+ }
\ No newline at end of file
From 65defbf8738d687c67c0686b60c68b0cf0b34845 Mon Sep 17 00:00:00 2001
From: zhoupzh
Date: Tue, 10 May 2022 17:15:34 +0800
Subject: [PATCH 2/3] fix issue
---
templates/repo/modelarts/trainjob/index.tmpl | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/templates/repo/modelarts/trainjob/index.tmpl b/templates/repo/modelarts/trainjob/index.tmpl
index d27ee66fd..edb146d7e 100755
--- a/templates/repo/modelarts/trainjob/index.tmpl
+++ b/templates/repo/modelarts/trainjob/index.tmpl
@@ -239,7 +239,7 @@ const params = new URLSearchParams(location.search)
if(!location.search){
$('.default.text').text(all)
}else{
- if(params.has('listType') && params.get('listType')=='all'){
+ if(!params.has('listType') || params.get('listType')=='all'){
$('.default.text').text(all)
}
else{
From 39f6a55e28f838908b1bad2a46c62264514dba4e Mon Sep 17 00:00:00 2001
From: lewis <747342561@qq.com>
Date: Tue, 10 May 2022 17:59:27 +0800
Subject: [PATCH 3/3] no show empty message
---
templates/repo/cloudbrain/show.tmpl | 16 ++++++++++------
templates/repo/cloudbrain/trainjob/show.tmpl | 22 ++++++++++++++--------
2 files changed, 24 insertions(+), 14 deletions(-)
diff --git a/templates/repo/cloudbrain/show.tmpl b/templates/repo/cloudbrain/show.tmpl
index 932a588c3..63c947477 100755
--- a/templates/repo/cloudbrain/show.tmpl
+++ b/templates/repo/cloudbrain/show.tmpl
@@ -516,17 +516,21 @@ td, th {
let podEventArray = podEvents[task0];
if(podEventArray != null){
for(var i=0; i < podEventArray.length;i++){
- html +="[" +podEventArray[i]["reason"] + "]
";
- html +="" +podEventArray[i]["message"] + "
";
- html +="" +podEventArray[i]["action"] + "
";
+ if (podEventArray[i]["reason"]!="") {
+ html +="[" +podEventArray[i]["reason"] + "]
";
+ html +="" +podEventArray[i]["message"] + "
";
+ html +="" +podEventArray[i]["action"] + "
";
+ }
}
}
let extras= jsonObj["extras"];
if(extras != null){
for(var i=0; i < extras.length;i++){
- html +="[" +extras[i]["reason"] + "]
";
- html +="" +extras[i]["message"] + "
";
- html +="" +extras[i]["action"] + "
";
+ if (extras[i]["reason"]!="") {
+ html +="[" +extras[i]["reason"] + "]
";
+ html +="" +extras[i]["message"] + "
";
+ html +="" +extras[i]["action"] + "
";
+ }
}
}
}
diff --git a/templates/repo/cloudbrain/trainjob/show.tmpl b/templates/repo/cloudbrain/trainjob/show.tmpl
index 03b3904a7..3ddeeb247 100755
--- a/templates/repo/cloudbrain/trainjob/show.tmpl
+++ b/templates/repo/cloudbrain/trainjob/show.tmpl
@@ -680,17 +680,21 @@ td, th {
let podEventArray = podEvents[task0];
if(podEventArray != null){
for(var i=0; i < podEventArray.length;i++){
- html +="[" +podEventArray[i]["reason"] + "]
";
- html +="" +podEventArray[i]["message"] + "
";
- html +="" +podEventArray[i]["action"] + "
";
+ if (podEventArray[i]["reason"]!="") {
+ html +="[" +podEventArray[i]["reason"] + "]
";
+ html +="" +podEventArray[i]["message"] + "
";
+ html +="" +podEventArray[i]["action"] + "
";
+ }
}
}
let extras= jsonObj["extras"];
if(extras != null){
for(var i=0; i < extras.length;i++){
- html +="[" +extras[i]["reason"] + "]
";
- html +="" +extras[i]["message"] + "
";
- html +="" +extras[i]["action"] + "
";
+ if (extras[i]["reason"]!="") {
+ html +="[" +extras[i]["reason"] + "]
";
+ html +="" +extras[i]["message"] + "
";
+ html +="" +extras[i]["action"] + "
";
+ }
}
}
}
@@ -700,8 +704,10 @@ td, th {
string = string.replace(/\n/g,"
");
string = string.replace(/(\r\n)|(\n)/g,'
');
- html +="[ExitDiagnostics]
";
- html +="" +string + "
";
+ if (string!=""){
+ html +="[ExitDiagnostics]
";
+ html +="" +string + "
";
+ }
document.getElementById("info_display").innerHTML=html;
}