| |
@@ -240,6 +240,22 @@
|
| |
const image = getMember(regions[region], "image");
|
| |
displayEntries.push({platform: prettyPlatform, region: region, release: release, image: image});
|
| |
}
|
| |
+ // put 'us', 'eu', and 'ap' first since those are the cheapest and
|
| |
+ // most popular; then everything else
|
| |
+ const continentOrdering = ["us", "eu", "ap"];
|
| |
+ displayEntries = displayEntries.sort(function(a, b) {
|
| |
+ const aIdx = continentOrdering.indexOf(a.region.slice(0, 2));
|
| |
+ const bIdx = continentOrdering.indexOf(b.region.slice(0, 2));
|
| |
+ if (aIdx == bIdx) {
|
| |
+ return a.region.localeCompare(b.region);
|
| |
+ } else if (aIdx == -1) {
|
| |
+ return 1;
|
| |
+ } else if (bIdx == -1){
|
| |
+ return -1;
|
| |
+ } else {
|
| |
+ return aIdx - bIdx;
|
| |
+ }
|
| |
+ });
|
| |
}
|
| |
Vue.set(this.streamDisplay.cloudLaunchable, platform, {list: displayEntries});
|
| |
}
|
| |
Put US, EU, and AP regions first since those are the most popular and
cheapest. Then put everything else. Within those buckets, sort them in
alphabetical order, so e.g.
us-east-1
is beforeus-east-2
. Thisroughly matches the way Fedora Cloud also lists its AMIs.