Skip to content

Commit 0939c8c

Browse files
committed
restructure cloud-image-templates.json
1 parent 64b0cc0 commit 0939c8c

File tree

2 files changed

+19
-60
lines changed

2 files changed

+19
-60
lines changed

ui/public/cloud-image-templates.json

Lines changed: 18 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -2,145 +2,109 @@
22
{
33
"id": 1,
44
"name": "Ubuntu 24.04",
5-
"version": "24.04",
6-
"distro": "Ubuntu",
75
"arch": "x86_64",
8-
"filename": "ubuntu-24.04-server-cloudimg-amd64.img"
6+
"url": "https://download.cloudstack.org/templates/cloud-images/ubuntu/ubuntu-24.04-server-cloudimg-amd64.img"
97
},
108
{
119
"id": 2,
1210
"name": "Ubuntu 22.04",
13-
"version": "22.04",
14-
"distro": "Ubuntu",
1511
"arch": "x86_64",
16-
"filename": "ubuntu-22.04-server-cloudimg-amd64.img"
12+
"url": "https://download.cloudstack.org/templates/cloud-images/ubuntu/ubuntu-22.04-server-cloudimg-amd64.img"
1713
},
1814
{
1915
"id": 3,
2016
"name": "Ubuntu 20.04",
21-
"version": "20.04",
22-
"distro": "Ubuntu",
2317
"arch": "x86_64",
24-
"filename": "ubuntu-20.04-server-cloudimg-amd64.img"
18+
"url": "https://download.cloudstack.org/templates/cloud-images/ubuntu/ubuntu-20.04-server-cloudimg-amd64.img"
2519
},
2620
{
2721
"id": 4,
2822
"name": "Debian GNU/Linux 12 (64-bit)",
29-
"version": "12",
30-
"distro": "Debian",
3123
"arch": "x86_64",
32-
"filename": "debian-12-genericcloud-amd64.qcow2"
24+
"url": "https://download.cloudstack.org/templates/cloud-images/debian/debian-12-genericcloud-amd64.qcow2"
3325
},
3426
{
3527
"id": 5,
3628
"name": "Rocky Linux 8",
37-
"version": "8",
38-
"distro": "Rockylinux",
3929
"arch": "x86_64",
40-
"filename": "Rocky-8-GenericCloud.latest.x86_64.qcow2"
30+
"url": "https://download.cloudstack.org/templates/cloud-images/rockylinux/Rocky-8-GenericCloud.latest.x86_64.qcow2"
4131
},
4232
{
4333
"id": 6,
4434
"name": "Rocky Linux 9",
45-
"version": "9",
46-
"distro": "Rockylinux",
4735
"arch": "x86_64",
48-
"filename": "Rocky-9-GenericCloud.latest.x86_64.qcow2"
36+
"url": "https://download.cloudstack.org/templates/cloud-images/rockylinux/Rocky-9-GenericCloud.latest.x86_64.qcow2"
4937
},
5038
{
5139
"id": 7,
5240
"name": "OpenSUSE 15.5",
53-
"version": "15.5",
54-
"distro": "OpenSUSE",
5541
"arch": "x86_64",
56-
"filename": "openSUSE-Leap-15.5-Minimal-VM.x86_64-Cloud.qcow2"
42+
"url": "https://download.cloudstack.org/templates/cloud-images/opensuse/openSUSE-Leap-15.5-Minimal-VM.x86_64-Cloud.qcow2"
5743
},
5844
{
5945
"id": 8,
6046
"name": "Ubuntu 24.04",
61-
"version": "24.04",
62-
"distro": "Ubuntu",
6347
"arch": "aarch64",
64-
"filename": "ubuntu-24.04-server-cloudimg-arm64.img"
48+
"url": "https://download.cloudstack.org/templates/cloud-images/ubuntu/ubuntu-24.04-server-cloudimg-arm64.img"
6549
},
6650
{
6751
"id": 9,
6852
"name": "Ubuntu 22.04",
69-
"version": "22.04",
70-
"distro": "Ubuntu",
7153
"arch": "aarch64",
72-
"filename": "ubuntu-22.04-server-cloudimg-arm64.img"
54+
"url": "https://download.cloudstack.org/templates/cloud-images/ubuntu/ubuntu-22.04-server-cloudimg-arm64.img"
7355
},
7456
{
7557
"id": 10,
7658
"name": "Ubuntu 20.04",
77-
"version": "20.04",
78-
"distro": "Ubuntu",
7959
"arch": "aarch64",
80-
"filename": "ubuntu-20.04-server-cloudimg-arm64.img"
60+
"url": "https://download.cloudstack.org/templates/cloud-images/ubuntu/ubuntu-20.04-server-cloudimg-arm64.img"
8161
},
8262
{
8363
"id": 11,
8464
"name": "Debian GNU/Linux 12 (64-bit)",
85-
"version": "12",
86-
"distro": "Debian",
8765
"arch": "aarch64",
88-
"filename": "debian-12-genericcloud-arm64.qcow2"
66+
"url": "https://download.cloudstack.org/templates/cloud-images/debian/debian-12-genericcloud-arm64.qcow2"
8967
},
9068
{
9169
"id": 12,
9270
"name": "Rocky Linux 8",
93-
"version": "8",
94-
"distro": "Rockylinux",
9571
"arch": "aarch64",
96-
"filename": "Rocky-8-GenericCloud.latest.aarch64.qcow2"
72+
"url": "https://download.cloudstack.org/templates/cloud-images/rockylinux/Rocky-8-GenericCloud.latest.aarch64.qcow2"
9773
},
9874
{
9975
"id": 13,
10076
"name": "Rocky Linux 9",
101-
"version": "9",
102-
"distro": "Rockylinux",
10377
"arch": "aarch64",
104-
"filename": "Rocky-9-GenericCloud.latest.aarch64.qcow2"
78+
"url": "https://download.cloudstack.org/templates/cloud-images/rockylinux/Rocky-9-GenericCloud.latest.aarch64.qcow2"
10579
},
10680
{
10781
"id": 14,
10882
"name": "OpenSUSE 15.5",
109-
"version": "15.5",
110-
"distro": "OpenSUSE",
11183
"arch": "aarch64",
112-
"filename": "openSUSE-Leap-15.5-Minimal-VM.aarch64-Cloud.qcow2"
84+
"url": "https://download.cloudstack.org/templates/cloud-images/opensuse/openSUSE-Leap-15.5-Minimal-VM.aarch64-Cloud.qcow2"
11385
},
11486
{
11587
"id": 15,
11688
"name": "Oracle Linux 8",
117-
"version": "8.10",
118-
"distro": "OracleLinux",
11989
"arch": "aarch64",
120-
"filename": "OL8U10_aarch64-kvm-b122.qcow2"
90+
"url": "https://download.cloudstack.org/templates/cloud-images/oraclelinux/OL8U10_aarch64-kvm-b122.qcow2"
12191
},
12292
{
12393
"id": 16,
12494
"name": "Oracle Linux 8",
125-
"version": "8.10",
126-
"distro": "OracleLinux",
12795
"arch": "x86_64",
128-
"filename": "OL8U10_x86_64-kvm-b258.qcow2"
96+
"url": "https://download.cloudstack.org/templates/cloud-images/oraclelinux/OL8U10_x86_64-kvm-b258.qcow2"
12997
},
13098
{
13199
"id": 17,
132100
"name": "Oracle Linux 9",
133-
"version": "9.5",
134-
"distro": "OracleLinux",
135101
"arch": "aarch64",
136-
"filename": "OL9U5_aarch64-kvm-b126.qcow2"
102+
"url": "https://download.cloudstack.org/templates/cloud-images/oraclelinux/OL9U5_aarch64-kvm-b126.qcow2"
137103
},
138104
{
139105
"id": 18,
140106
"name": "Oracle Linux 9",
141-
"version": "9.5",
142-
"distro": "OracleLinux",
143107
"arch": "x86_64",
144-
"filename": "OL9U5_x86_64-kvm-b259.qcow2"
108+
"url": "https://download.cloudstack.org/templates/cloud-images/oraclelinux/OL9U5_x86_64-kvm-b259.qcow2"
145109
}
146110
]

ui/src/views/infra/zone/ZoneWizardRegisterTemplate.vue

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -223,12 +223,7 @@ export default {
223223
if (!response.ok) {
224224
throw new Error(`Error fetching predefined templates, status_code: ${response.status}`)
225225
}
226-
const templates = await response.json()
227-
const templatesBaseUrl = 'https://download.cloudstack.org/templates/cloud-images/'
228-
for (const template of templates) {
229-
template.url = templatesBaseUrl + template.distro.toLowerCase() + '/' + template.filename
230-
}
231-
this.predefinedTemplates = templates
226+
this.predefinedTemplates = await response.json()
232227
} catch (error) {
233228
console.error('Error fetching predefined templates:', error)
234229
this.predefinedTemplates = []

0 commit comments

Comments
 (0)