luci-app-opkg: only show packages with higher version in upgrade tab
Fixes #2422. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
This commit is contained in:
parent
e847a93f78
commit
66c2bbc279
1 changed files with 4 additions and 1 deletions
|
@ -135,7 +135,7 @@ function display(pattern)
|
||||||
|
|
||||||
if (currentDisplayMode === 'updates') {
|
if (currentDisplayMode === 'updates') {
|
||||||
var avail = packages.available.pkgs[name];
|
var avail = packages.available.pkgs[name];
|
||||||
if (!avail || avail.version === pkg.version)
|
if (!avail || compareVersion(avail.version, pkg.version) <= 0)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
ver = '%s » %s'.format(
|
ver = '%s » %s'.format(
|
||||||
|
@ -291,6 +291,9 @@ function compareVersion(val, ref)
|
||||||
val = val || '';
|
val = val || '';
|
||||||
ref = ref || '';
|
ref = ref || '';
|
||||||
|
|
||||||
|
if (val === ref)
|
||||||
|
return 0;
|
||||||
|
|
||||||
while (vi < val.length || ri < ref.length) {
|
while (vi < val.length || ri < ref.length) {
|
||||||
var first_diff = 0;
|
var first_diff = 0;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue