btn = E('div', {
'class': 'btn cbi-button-positive',
'data-package': name,
+ 'data-action': 'upgrade',
'click': handleInstall
}, _('Upgrade…'));
}
btn = E('div', {
'class': 'btn cbi-button-action',
'data-package': name,
+ 'data-action': 'install',
'click': handleInstall
}, _('Install…'));
else if (inst.installed && inst.version != pkg.version)
btn = E('div', {
'class': 'btn cbi-button-positive',
'data-package': name,
+ 'data-action': 'upgrade',
'click': handleInstall
}, _('Upgrade…'));
else
function handleInstall(ev)
{
var name = ev.target.getAttribute('data-package'),
+ installcmd = ev.target.getAttribute('data-action'),
pkg = packages.available.pkgs[name],
depcache = {},
size;
}, _('Cancel')),
' ',
E('div', {
- 'data-command': 'install',
+ 'data-command': installcmd,
'data-package': name,
'class': 'btn cbi-button-action',
'click': handlePkg,
} else if (partials[i].name.match(/\.conf$/)) {
files.push(base_dir + '/' + partials[i].name);
}
- }
+ }
}
return Promise.all(files.map(function(file) {
"/usr/libexec/package-manager-call install *": [ "exec" ],
"/usr/libexec/package-manager-call remove *": [ "exec" ],
"/usr/libexec/package-manager-call update": [ "exec" ],
+ "/usr/libexec/package-manager-call upgrade": [ "exec" ],
+ "/usr/libexec/package-manager-call upgrade *": [ "exec" ],
"/etc/opkg.conf": [ "write" ],
"/etc/opkg/*.conf": [ "write" ],
"/etc/apk/repositories": [ "write" ],