- var filename = images[i];
- var path = "https://" + target + "/" + filename;
- var type = extractImageType(filename);
-
- if (type == "sysupgrade") {
- $("sysupgrade-image").href = path;
- $("sysupgrade-image").style.display = "inline-flex";
- }
-
- if (type == "factory") {
- $("factory-image").href = path;
- $("factory-image").style.display = "inline-flex";
- }
-
- if (type == "tftp") {
- $("tftp-image").href = path;
- $("tftp-image").style.display = "inline-flex";
- }
-
- if (type == "kernel") {
- $("kernel-image").href = path;
- $("kernel-image").style.display = "inline-flex";
- }
-
- if (type == "rootfs") {
- $("rootfs-image").href = path;
- $("rootfs-image").style.display = "inline-flex";
+ var file = images[i];
+ var path = config.downloadLink
+ .replace('%target', target)
+ .replace('%release', release)
+ .replace('%file', file)
+ .replace('%commit', commit);
+ var type = extractImageType(file);
+
+ if (types.includes(type)) {
+ showLink(type, path);