Get region names from API instead of hard-coding them
This commit is contained in:
@ -83,6 +83,13 @@ import { settings, elements, regionNames, apiGet, apiPost, apiPut, parseParams,
|
||||
}
|
||||
};
|
||||
|
||||
// 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)
|
||||
{
|
||||
@ -117,6 +124,8 @@ import { settings, elements, regionNames, apiGet, apiPost, apiPut, parseParams,
|
||||
}
|
||||
|
||||
ui.saveButton.disabled = false;
|
||||
|
||||
apiGet("/regions/" + data.volume.region, displayRegion, null);
|
||||
};
|
||||
|
||||
// Click handler for save button
|
||||
|
Reference in New Issue
Block a user