[REV] Optimize state display priority

This commit is contained in:
zhoujunhao 2018-08-07 14:45:37 +08:00
parent b52bd9f55d
commit 5d7e1de76f
2 changed files with 6 additions and 5 deletions

View File

@ -31,6 +31,7 @@ import (
"github.com/go-chi/chi"
"github.com/goodrain/rainbond/db"
httputil "github.com/goodrain/rainbond/util/http"
"fmt"
)
//Event GetLogs
@ -95,14 +96,14 @@ func GetNotificationEvents(w http.ResponseWriter, r *http.Request) {
var startTime, endTime time.Time
start := r.FormValue("start")
end := r.FormValue("end")
println("======>form",start,end)
fmt.Println("======>form",start,end)
if si, err := strconv.Atoi(start); err == nil {
startTime = time.Unix(int64(si), 0)
}
if ei, err := strconv.Atoi(end); err == nil {
endTime = time.Unix(int64(ei), 0)
}
println("=====>",startTime,endTime)
fmt.Println("=====>",startTime,endTime)
res, err := db.GetManager().NotificationEventDao().GetNotificationEventByTime(startTime, endTime)
if err != nil {
httputil.ReturnError(r, w, 500, err.Error())

View File

@ -103,12 +103,12 @@ func handleStatus(serviceTable *termtables.Table, ready bool, v *client.HostNode
if ready == true {
status = "\033[0;32;32m running(healthy) \033[0m"
}
if ready == false {
status = "\033[0;32;32m running(unhealthy) \033[0m"
}
if v.Unschedulable == true {
status = "\033[0;32;32m running(unschedulable) \033[0m"
}
if ready == false {
status = "\033[0;32;32m running(unhealthy) \033[0m"
}
if v.Status == "unknown" {
status = "\033[0;31;31m unknown \033[0m"
}