From 1154c4198a763aabd7c2fbe0f5419af7c2d04681 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Wed, 19 Jun 2019 13:29:19 +0200 Subject: luci-app-opkg: make overwriting package files optional Ref: #2775 Signed-off-by: Dirk Brenken [split into multiple commits, sync translations] Signed-off-by: Jo-Philipp Wich --- .../luci-app-opkg/htdocs/luci-static/resources/view/opkg.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'applications/luci-app-opkg/htdocs/luci-static/resources') diff --git a/applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js b/applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js index 4d67a034c3..2c0c460d15 100644 --- a/applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js +++ b/applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js @@ -589,6 +589,10 @@ function handleInstall(ev) desc || '', errs || inst || '', E('div', { 'class': 'right' }, [ + E('label', { 'class': 'cbi-checkbox', 'style': 'float:left; padding-top:.5em' }, [ + E('input', { 'type': 'checkbox', 'name': 'overwrite' }), ' ', + _('Overwrite files from other package(s)') + ]), E('div', { 'class': 'btn', 'click': L.hideModal @@ -744,6 +748,7 @@ function handleOpkg(ev) var cmd = ev.target.getAttribute('data-command'), pkg = ev.target.getAttribute('data-package'), rem = document.querySelector('input[name="autoremove"]'), + owr = document.querySelector('input[name="overwrite"]'), url = 'admin/system/opkg/exec/' + encodeURIComponent(cmd); var dlg = L.showModal(_('Executing package manager'), [ @@ -751,7 +756,7 @@ function handleOpkg(ev) _('Waiting for the opkg %h command to complete…').format(cmd)) ]); - L.post(url, { package: pkg, autoremove: rem ? rem.checked : false }, function(xhr, res) { + L.post(url, { package: pkg, autoremove: rem ? rem.checked : false, overwrite: owr ? owr.checked : false }, function(xhr, res) { dlg.removeChild(dlg.lastChild); if (res.stdout) -- cgit v1.2.3