opkg.patch 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. From 955488467c8f86aa1994d9a9cccd9dfe7922e459 Mon Sep 17 00:00:00 2001
  2. From: kiddin9 <[email protected]>
  3. Date: Tue, 27 Oct 2020 13:48:23 +0800
  4. Subject: [PATCH] Update opkg.js
  5. ---
  6. .../htdocs/luci-static/resources/view/opkg.js | 9 ++++++---
  7. 1 file changed, 6 insertions(+), 3 deletions(-)
  8. diff --git a/package/feeds/luci/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js b/package/feeds/luci/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js
  9. index a5abfc168c..e139370fe5 100644
  10. --- a/package/feeds/luci/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js
  11. +++ b/package/feeds/luci/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js
  12. @@ -232,7 +232,7 @@ function display(pattern)
  13. var avail = packages.available.pkgs[name],
  14. inst = packages.installed.pkgs[name];
  15. - if (!inst || !inst.installed)
  16. + if (!inst || !inst.installed || pkg.name.includes('luci-app-opkg') || (!pkg.name.includes('luci-app') && !pkg.name.includes('luci-theme') && !pkg.name.includes('default-settings')))
  17. continue;
  18. if (!avail || compareVersion(avail.version, pkg.version) <= 0)
  19. @@ -260,6 +260,9 @@ function display(pattern)
  20. }, _('Remove…'));
  21. }
  22. else {
  23. + if (pkg.name.includes('kmod') || pkg.name.includes('luci-i18n'))
  24. + continue;
  25. +
  26. var inst = packages.installed.pkgs[name];
  27. ver = truncateVersion(pkg.version || '-');
  28. @@ -370,6 +373,12 @@ function handleMode(ev)
  29. currentDisplayMode = tab.getAttribute('data-mode');
  30. + if (currentDisplayMode == "updates"){
  31. + var filterv = document.querySelector('input[name="filter"]')
  32. + if ( filterv.value == "luci-app-")
  33. + filterv.value = ""
  34. + }
  35. +
  36. display(document.querySelector('input[name="filter"]').value);
  37. ev.target.blur();
  38. @@ -687,7 +696,7 @@ function handleInstall(ev)
  39. errs || inst || '',
  40. E('div', { 'class': 'right' }, [
  41. E('label', { 'class': 'cbi-checkbox', 'style': 'float:left' }, [
  42. - E('input', { 'id': 'overwrite-cb', 'type': 'checkbox', 'name': 'overwrite', 'disabled': isReadonlyView }), ' ',
  43. + E('input', { 'id': 'overwrite-cb', 'type': 'checkbox', 'name': 'overwrite', 'checked': 'checked', 'disabled': isReadonlyView }), ' ',
  44. E('label', { 'for': 'overwrite-cb' }), ' ',
  45. _('Overwrite files from other package(s)')
  46. ]),
  47. @@ -881,6 +890,10 @@ function handleOpkg(ev)
  48. ]);
  49. var argv = [ cmd, '--force-removal-of-dependent-packages' ];
  50. +
  51. + argv.push('--force-checksum');
  52. +
  53. + argv.push('--force-depends');
  54. if (rem && rem.checked)
  55. argv.push('--autoremove');
  56. @@ -1027,7 +1040,7 @@ return view.extend({
  57. E('div', {}, [
  58. E('label', {}, _('Filter') + ':'),
  59. E('span', { 'class': 'control-group' }, [
  60. - E('input', { 'type': 'text', 'name': 'filter', 'placeholder': _('Type to filter…'), 'value': query, 'keyup': handleKeyUp }),
  61. + E('input', { 'type': 'text', 'name': 'filter', 'placeholder': _('Type to filter…'), 'value': 'luci-app-', 'keyup': handleKeyUp }),
  62. E('button', { 'class': 'btn cbi-button', 'click': handleReset }, [ _('Clear') ])
  63. ])
  64. ]),