Skip to content

Commit

Permalink
luci-app-opkg: add warning about upgrading packages
Browse files Browse the repository at this point in the history
It is a well-known fact that opkg doesn't check ABI-compatibility between dependencies and upgrading packages in a stable release is therefore not recommended. This commit adds a warning which should help especially new users find more information on why this is and avoiding soft-bricking their device.

Signed-off-by: Daniel Nilsson <daniel.nilsson94@outlook.com>
  • Loading branch information
dannil committed Feb 20, 2024
1 parent c8cddc3 commit 8744961
Showing 1 changed file with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,15 @@ function display(pattern)
var src = packages[currentDisplayMode === 'updates' ? 'installed' : currentDisplayMode],
table = document.querySelector('#packages'),
pagers = document.querySelectorAll('.controls > .pager'),
updates_warning = document.querySelector('#updates-warning'),
i18n_filter = null;

if (currentDisplayMode !== 'updates') {
updates_warning.style.display = 'none';
} else {
updates_warning.style.display = '';
}

currentDisplayRows.length = 0;

if (typeof(pattern) === 'string' && pattern.length > 0)
Expand Down Expand Up @@ -1212,6 +1219,13 @@ return view.extend({
E('li', { 'data-mode': 'updates', 'class': 'installed cbi-tab-disabled', 'click': handleMode }, E('a', { 'href': '#' }, [ _('Updates') ]))
]),

E('div', { 'id': 'updates-warning', 'class': 'alert-message warning', 'style': 'display:none' }, [
E('p', _('Warning! Upgrading packages may cause serious problems, including soft-bricking your device!')),
E('p', _('See <a %s">explanation on wiki</a> why caution is advised.').format(
'href="https://openwrt.org/meta/infobox/upgrade_packages_warning" target="_blank" rel="noreferrer"'
))
]),

E('div', { 'class': 'controls', 'style': 'display:none' }, [
E('div', { 'class': 'pager center' }, [
E('button', { 'class': 'btn cbi-button-neutral prev', 'aria-label': _('Previous page'), 'click': handlePage }, [ '«' ]),
Expand Down

0 comments on commit 8744961

Please sign in to comment.