2018-12-09 13:21:20 +00:00
|
|
|
import { apiurl, fetch } from "@/util/auth";
|
|
|
|
|
2019-03-27 14:41:29 +00:00
|
|
|
export async function fetchRuns(group, lastrun) {
|
|
|
|
let u = apiurl("/runs");
|
|
|
|
if (group) {
|
|
|
|
u.searchParams.append("group", group)
|
|
|
|
}
|
|
|
|
if (lastrun) {
|
|
|
|
u.searchParams.append("lastrun", true)
|
|
|
|
}
|
|
|
|
let res = await fetch(u)
|
|
|
|
return res.json();
|
|
|
|
}
|
|
|
|
|
2018-12-09 13:21:20 +00:00
|
|
|
export async function fetchRun(runid) {
|
|
|
|
let res = await fetch(apiurl("/run/" + runid));
|
|
|
|
return res.json();
|
|
|
|
}
|
|
|
|
|
|
|
|
export async function fetchTask(runid, taskid) {
|
|
|
|
let res = await fetch(apiurl("/run/" + runid + "/task/" + taskid))
|
|
|
|
return res.json();
|
2019-03-22 07:39:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export async function fetchVariables(ownertype, ownername, projectname, all) {
|
|
|
|
let path =
|
|
|
|
"/projects/" +
|
|
|
|
encodeURIComponent(ownertype + "/" + ownername + "/" + projectname);
|
|
|
|
path += "/variables";
|
|
|
|
if (all) {
|
|
|
|
path += "?tree&removeoverridden";
|
|
|
|
}
|
|
|
|
let res = await fetch(apiurl(path));
|
|
|
|
return res.json();
|
2018-12-09 13:21:20 +00:00
|
|
|
}
|