Get region names from API instead of hard-coding them
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user