From: Moritz Warning Date: Sun, 2 Feb 2020 04:14:25 +0000 (+0100) Subject: fix unexpected prefix/image distinction X-Git-Tag: v1.0.0~32 X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=36da1fa2928588d59781ecde0d7087917215cf69;p=web%2Ffirmware-selector-openwrt-org.git fix unexpected prefix/image distinction this happens when only one image file is available, factory/sysupgrade might be part of the prefix --- diff --git a/www/index.js b/www/index.js index 99acb64..080e3aa 100644 --- a/www/index.js +++ b/www/index.js @@ -220,15 +220,16 @@ function updateImages(dllink, model, target, release, commit, prefix, images) { for (var i in images) { var image = images[i]; - if (image.includes('factory')) { + var file = prefix + image; + if (file.includes('-factory')) { entries['FACTORY'].push(image); - } else if (image.includes('sysupgrade')) { + } else if (file.includes('-sysupgrade')) { entries['SYSUPGRADE'].push(image); - } else if (image.includes('kernel') || image.includes('zImage') || image.includes('uImage')) { + } else if (file.includes('-kernel') || file.includes('-zImage') || file.includes('-uImage')) { entries['KERNEL'].push(image); - } else if (image.includes('rootfs')) { + } else if (file.includes('-rootfs')) { entries['ROOTFS'].push(image); - } else if (image.includes('sdcard')) { + } else if (file.includes('-sdcard')) { entries['SDCARD'].push(image); } else { entries['OTHER'].push(image);