Get region names from API instead of hard-coding them

This commit is contained in:
2024-05-06 16:57:12 -04:00
parent 4c4db6a734
commit 8ea657c757
21 changed files with 333 additions and 107 deletions

View File

@ -39,6 +39,13 @@ import { settings, elements, apiGet, apiPost, parseParams, regionNames, setupHea
ui.size = {};
ui.volumeLabel = {};
// Callback for region API call
var displayRegion = function(response)
{
if (response.label && response.label.length)
ui.location.innerHTML = response.label;
};
// Callback for volume API call
var displayVolume = function(response)
{
@ -55,6 +62,7 @@ import { settings, elements, apiGet, apiPost, parseParams, regionNames, setupHea
ui.location.innerHTML = response.region;
ui.cloneButton.disabled = false;
apiGet("/regions/" + response.region, displayRegion, null);
};
// Click handler for clone button