diff options
Diffstat (limited to 'modules/luci-mod-system')
-rw-r--r-- | modules/luci-mod-system/htdocs/luci-static/resources/view/system/flash.js | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/modules/luci-mod-system/htdocs/luci-static/resources/view/system/flash.js b/modules/luci-mod-system/htdocs/luci-static/resources/view/system/flash.js index c40a5d3c5..9ad64dad4 100644 --- a/modules/luci-mod-system/htdocs/luci-static/resources/view/system/flash.js +++ b/modules/luci-mod-system/htdocs/luci-static/resources/view/system/flash.js @@ -161,24 +161,26 @@ function findStorageSize(procmtd, procpart) { var kernsize = 0, rootsize = 0, wholesize = 0; procmtd.split(/\n/).forEach(function(ln) { - var match = ln.match(/^mtd\d+: ([0-9a-f]+) [0-9a-f]+ "(.+)"$/); + var match = ln.match(/^mtd\d+: ([0-9a-f]+) [0-9a-f]+ "(.+)"$/), + size = match ? parseInt(match[1], 16) : 0; switch (match ? match[2] : '') { case 'linux': case 'firmware': - wholesize = parseInt(match[1], 16); + if (size > wholesize) + wholesize = size; break; case 'kernel': case 'kernel0': - kernsize = parseInt(match[1], 16); + kernsize = size; break; case 'rootfs': case 'rootfs0': case 'ubi': case 'ubi0': - rootsize = parseInt(match[1], 16); + rootsize = size; break; } }); |