mirror of
https://github.com/ClusterCockpit/cc-backend
synced 2024-12-26 13:29:05 +01:00
update frontend; add Walltime to meta.json struct
This commit is contained in:
parent
4138055f55
commit
5764937c7a
2
frontend
2
frontend
@ -1 +1 @@
|
||||
Subproject commit 63c44bf55bc1c50a437cc7961918129ca0406988
|
||||
Subproject commit d8b1232bcbf02543d6edc1e5e36b6ea484473b9a
|
14
routes.go
14
routes.go
@ -5,6 +5,7 @@ import (
|
||||
"net/url"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/ClusterCockpit/cc-backend/auth"
|
||||
"github.com/ClusterCockpit/cc-backend/config"
|
||||
@ -72,6 +73,19 @@ func buildFilterPresets(query url.Values) map[string]interface{} {
|
||||
filterPresets["arrayJobId"] = num
|
||||
}
|
||||
}
|
||||
if query.Get("startTime") != "" {
|
||||
parts := strings.Split(query.Get("startTime"), "-")
|
||||
if len(parts) == 2 {
|
||||
a, e1 := strconv.ParseInt(parts[0], 10, 64)
|
||||
b, e2 := strconv.ParseInt(parts[1], 10, 64)
|
||||
if e1 == nil && e2 == nil {
|
||||
filterPresets["startTime"] = map[string]string{
|
||||
"from": time.Unix(a, 0).Format(time.RFC3339),
|
||||
"to": time.Unix(b, 0).Format(time.RFC3339),
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return filterPresets
|
||||
}
|
||||
|
@ -53,6 +53,7 @@ type Job struct {
|
||||
type JobMeta struct {
|
||||
ID *int64 `json:"id,omitempty"` // never used in the job-archive, only available via REST-API
|
||||
BaseJob
|
||||
Walltime int64 `json:"walltime"` // TODO: Missing in DB
|
||||
StartTime int64 `json:"startTime" db:"start_time"`
|
||||
Statistics map[string]JobStatistics `json:"statistics,omitempty"`
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user