luci-app-opkg: fix sorting by size column
authorJo-Philipp Wich <jo@mein.io>
Tue, 7 Nov 2023 20:59:25 +0000 (21:59 +0100)
committerJo-Philipp Wich <jo@mein.io>
Tue, 7 Nov 2023 21:00:35 +0000 (22:00 +0100)
Fixes: #6120
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 63e5d38db02fa18dd471e974d1410a454e0aa086)

applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js

index d4d5b8b88b5b4f793c7b2b1f28e3091f4a94baca..af1e972efc3a58d1e279c755c364e8cee5a3abc7 100644 (file)
@@ -310,8 +310,9 @@ function display(pattern)
                currentDisplayRows.push([
                        name,
                        ver,
-                       pkg.size ? '%1024mB'.format(pkg.size)
-                                : (altsize ? '~%1024mB'.format(altsize) : '-'),
+                       [ pkg.size || 0,
+                          pkg.size ? '%1024mB'.format(pkg.size)
+                                : (altsize ? '~%1024mB'.format(altsize) : '-') ],
                        desc,
                        btn
                ]);