Renamed ArbitraryResourceSummary to ArbitraryResourceStatus, and added status titles & descriptions

This allows for consistent messaging about each status to be shown in different parts of the system. Previously these strings were hardcoded in the loading screen html so were inaccessible elsewhere.
This commit is contained in:
CalDescent
2021-12-29 19:41:49 +00:00
parent 46e4cb4f50
commit 4d4f661548
7 changed files with 90 additions and 78 deletions

View File

@@ -58,42 +58,42 @@
console.log("status: " + json.status);
if (json.status == "UNSUPPORTED") {
textStatus = "Unsupported request";
if (json.id == "UNSUPPORTED") {
textStatus = response.description;
document.getElementById("status").style.color = "red";
}
else if (json.status == "BLOCKED") {
else if (json.id == "BLOCKED") {
textStatus = name + " is blocked so content cannot be served";
retryInterval = 5000;
document.getElementById("status").style.color = "red";
}
else if (json.status == "READY") {
textStatus = "Ready";
else if (json.id == "READY") {
textStatus = response.statusDescription;
window.location.reload();
}
else if (json.status == "BUILDING") {
textStatus = "Building...";
else if (json.id == "BUILDING") {
textStatus = response.statusDescription;
retryInterval = 1000;
}
else if (json.status == "BUILD_FAILED") {
textStatus = "Build failed. Please try again later.";
else if (json.id == "BUILD_FAILED") {
textStatus = response.statusDescription;
}
else if (json.status == "NOT_STARTED") {
textStatus = "Waiting...";
else if (json.id == "NOT_STARTED") {
textStatus = response.statusDescription;
retryInterval = 1000;
}
else if (json.status == "DOWNLOADING") {
textStatus = "Locating and downloading files...";
textStatus = response.statusDescription;
retryInterval = 1000;
}
else if (json.status == "MISSING_DATA") {
textStatus = "Unable to locate all files. Please try again later.";
else if (json.id == "MISSING_DATA") {
textStatus = response.statusDescription;
retryInterval = 10000;
document.getElementById("status").style.color = "red";
document.getElementById("c").style.opacity = "0.5";
}
else if (json.status == "DOWNLOADED") {
textStatus = "Files downloaded";
else if (json.id == "DOWNLOADED") {
textStatus = response.statusDescription;
}
document.getElementById("status").innerHTML = textStatus;