diff --git a/.gitmodules b/.gitmodules index 3beff03..08755e4 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ [submodule "frontend"] path = frontend - url = git@github.com:ClusterCockpit/cc-svelte-datatable.git + url = git@github.com:ClusterCockpit/cc-frontend.git diff --git a/config/config.go b/config/config.go index e35caaa..e13e101 100644 --- a/config/config.go +++ b/config/config.go @@ -132,21 +132,6 @@ func UpdateConfig(key, value string, ctx context.Context) error { return nil } -// http.HandlerFunc compatible function that serves the current configuration as JSON. -// TODO: Use templates and stuff instead of this... -func ServeConfig(rw http.ResponseWriter, r *http.Request) { - config, err := GetUIConfig(r) - if err != nil { - http.Error(rw, err.Error(), http.StatusInternalServerError) - return - } - - rw.Header().Set("Content-Type", "application/json") - if err := json.NewEncoder(rw).Encode(config); err != nil { - http.Error(rw, err.Error(), http.StatusInternalServerError) - } -} - func GetClusterConfig(cluster string) *model.Cluster { for _, c := range Clusters { if c.Name == cluster { diff --git a/graph/schema.graphqls b/graph/schema.graphqls index 26a8821..dc3456f 100644 --- a/graph/schema.graphqls +++ b/graph/schema.graphqls @@ -103,9 +103,9 @@ type Series { } type MetricStatistics { - avg: Float! - min: Float! - max: Float! + avg: NullableFloat! + min: NullableFloat! + max: NullableFloat! } type StatsSeries { diff --git a/utils/add-job.mjs b/utils/add-job.mjs new file mode 100644 index 0000000..dc14039 --- /dev/null +++ b/utils/add-job.mjs @@ -0,0 +1,40 @@ +import fetch from 'node-fetch' + +// Just for testing + +const job = { + jobId: 123, + user: 'lou', + project: 'testproj', + cluster: 'heidi', + partition: 'default', + arrayJobId: 0, + numNodes: 1, + numHwthreads: 8, + numAcc: 0, + exclusive: 1, + monitoringStatus: 1, + smt: 1, + jobState: 'running', + duration: 2*60*60, + tags: [], + resources: [ + { + hostname: 'heidi', + hwthreads: [0, 1, 2, 3, 4, 5, 6, 7] + } + ], + metaData: null, + startTime: 1641427200 +} + +fetch('http://localhost:8080/api/jobs/start_job/', { + method: 'POST', + body: JSON.stringify(job), + headers: { + 'Content-Type': 'application/json', + 'Authorization': 'Bearer eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJpc19hZG1pbiI6dHJ1ZSwiaXNfYXBpIjpmYWxzZSwic3ViIjoibG91In0.nY6dCgLSdm7zXz1xPkrb_3JnnUCgExXeXcrTlAAySs4p72VKJhmzzC1RxgkJE26l8tDYUilM-o-urzlaqK5aDA' + } + }) + .then(res => res.status == 200 ? res.json() : res.text()) + .then(res => console.log(res))