update frontend; add Walltime to meta.json struct

This commit is contained in:
Lou Knauer 2022-02-28 11:08:43 +01:00
parent 4138055f55
commit 5764937c7a
3 changed files with 16 additions and 1 deletions

@ -1 +1 @@
Subproject commit 63c44bf55bc1c50a437cc7961918129ca0406988 Subproject commit d8b1232bcbf02543d6edc1e5e36b6ea484473b9a

View File

@ -5,6 +5,7 @@ import (
"net/url" "net/url"
"strconv" "strconv"
"strings" "strings"
"time"
"github.com/ClusterCockpit/cc-backend/auth" "github.com/ClusterCockpit/cc-backend/auth"
"github.com/ClusterCockpit/cc-backend/config" "github.com/ClusterCockpit/cc-backend/config"
@ -72,6 +73,19 @@ func buildFilterPresets(query url.Values) map[string]interface{} {
filterPresets["arrayJobId"] = num 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 return filterPresets
} }

View File

@ -53,6 +53,7 @@ type Job struct {
type JobMeta struct { type JobMeta struct {
ID *int64 `json:"id,omitempty"` // never used in the job-archive, only available via REST-API ID *int64 `json:"id,omitempty"` // never used in the job-archive, only available via REST-API
BaseJob BaseJob
Walltime int64 `json:"walltime"` // TODO: Missing in DB
StartTime int64 `json:"startTime" db:"start_time"` StartTime int64 `json:"startTime" db:"start_time"`
Statistics map[string]JobStatistics `json:"statistics,omitempty"` Statistics map[string]JobStatistics `json:"statistics,omitempty"`
} }