Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enrich GUI #264

Merged
merged 7 commits into from
Dec 11, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix bug
Signed-off-by: YujiOshima <yuji.oshima0x3fd@gmail.com>
  • Loading branch information
YujiOshima committed Dec 7, 2018
commit 1c27e540214d9e3a7561548985b28e3771d8e211
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