Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
Signed-off-by: YujiOshima <yuji.oshima0x3fd@gmail.com>
  • Loading branch information
YujiOshima committed Nov 29, 2018
1 parent 0d99199 commit 9324cad
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 9 deletions.
2 changes: 1 addition & 1 deletion cmd/ui/template/studyjobgen.html
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ <h4>Suggestion Spec</h4>
</div>
<div class="form-group" v-if="SuggestAlgoSelect=='custom'">
<label for="txtSuggestionAlgo">Custom Algorithm:</label>
<input type="text" class="form-control form-control-sm" id="txtSuggestionAlgo" name="txtSuggestionAlgo" v-model="SuggestionAlgoCustom" />
<input type="text" class="form-control form-control-sm" id="txtSuggestionAlgo" name="txtSuggestionAlgo" v-model="SuggestAlgoCustom" />
</div>
<div class="form-group" >
<label for="txtSuggestionReqNum">RequestNumber:</label>
Expand Down
1 change: 1 addition & 0 deletions cmd/ui/template/studyjobgen.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
WorkerTemplateName: "scratch",
WorkerTemplateScratch: "",
SuggestAlgoSelect: "random",
SuggestAlgoCustom: "",
SuggestAlgoTmp: "",
SuggestionParameters: [],
SuggestionReqNum: 1,
Expand Down
20 changes: 12 additions & 8 deletions pkg/ui/ui.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand All @@ -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
}
}
}
Expand Down

0 comments on commit 9324cad

Please sign in to comment.