From 9324cadffccf685f0405a3bb681cd75ba9afcef6 Mon Sep 17 00:00:00 2001 From: YujiOshima Date: Thu, 29 Nov 2018 23:52:21 +0900 Subject: [PATCH] fix bug Signed-off-by: YujiOshima --- cmd/ui/template/studyjobgen.html | 2 +- cmd/ui/template/studyjobgen.js | 1 + pkg/ui/ui.go | 20 ++++++++++++-------- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/cmd/ui/template/studyjobgen.html b/cmd/ui/template/studyjobgen.html index fe12ef3def7..3133914086a 100644 --- a/cmd/ui/template/studyjobgen.html +++ b/cmd/ui/template/studyjobgen.html @@ -80,7 +80,7 @@

Suggestion Spec

- +
diff --git a/cmd/ui/template/studyjobgen.js b/cmd/ui/template/studyjobgen.js index 40bedbbd95e..4d1d55f5091 100644 --- a/cmd/ui/template/studyjobgen.js +++ b/cmd/ui/template/studyjobgen.js @@ -31,6 +31,7 @@ WorkerTemplateName: "scratch", WorkerTemplateScratch: "", SuggestAlgoSelect: "random", + SuggestAlgoCustom: "", SuggestAlgoTmp: "", SuggestionParameters: [], SuggestionReqNum: 1, diff --git a/pkg/ui/ui.go b/pkg/ui/ui.go index 362cc0f0be0..69bd7f1eb39 100644 --- a/pkg/ui/ui.go +++ b/pkg/ui/ui.go @@ -102,6 +102,7 @@ func (k *KatibUIHandler) Index(w http.ResponseWriter, r *http.Request) { ss = &StudySummary{ StudyNameStacks: []*StudyNameStack{}, LatestJobCondition: "Unknown", + LastJobUpdateTime: nil, } slv.StudySummarys[so.Name] = ss } @@ -123,16 +124,19 @@ func (k *KatibUIHandler) Index(w http.ResponseWriter, r *http.Request) { } for i := range ss.StudyNameStacks { if ss.StudyNameStacks[i].StudyId == sj.Status.StudyID { - ss.StudyNameStacks[i].StudyJobName = sj.Name - ss.StudyNameStacks[i].StudyJobCondition = string(sj.Status.Condition) - if sj.Status.LastReconcileTime != nil { - if ss.LastJobUpdateTime != nil { - if ss.LastJobUpdateTime.Before(sj.Status.LastReconcileTime.Time) { - continue + if ss.StudyNameStacks[i].StudyJobName == "None" { + ss.StudyNameStacks[i].StudyJobName = sj.Name + ss.StudyNameStacks[i].StudyJobCondition = string(sj.Status.Condition) + if sj.Status.LastReconcileTime != nil { + if ss.LastJobUpdateTime != nil { + if ss.LastJobUpdateTime.Before(sj.Status.LastReconcileTime.Time) { + continue + } } + ss.LatestJobCondition = string(sj.Status.Condition) + ss.LastJobUpdateTime = &sj.Status.LastReconcileTime.Time } - ss.LatestJobCondition = string(sj.Status.Condition) - ss.LastJobUpdateTime = &sj.Status.LastReconcileTime.Time + break } } }