mirror of
https://github.com/YunoHost/yunohost-admin.git
synced 2024-09-03 20:06:15 +02:00
[fix] Upgrade wrong arguments.
This commit is contained in:
parent
bd2764872b
commit
1baf558208
1 changed files with 8 additions and 7 deletions
15
js/app.js
15
js/app.js
|
@ -1326,19 +1326,20 @@ app = Sammy('#main', function (sam) {
|
||||||
|
|
||||||
sam.get('#/tools/upgrade/:type', function (c) {
|
sam.get('#/tools/upgrade/:type', function (c) {
|
||||||
if (c.params['type'] !== 'apps' && c.params['type'] !== 'packages') {
|
if (c.params['type'] !== 'apps' && c.params['type'] !== 'packages') {
|
||||||
c.flash('fail', y18n.t('error_server'));
|
c.flash('fail', y18n.t('unknown_argument', [c.params['type']]));
|
||||||
store.clear('slide');
|
store.clear('slide');
|
||||||
c.redirect('#/tools/update');
|
c.redirect('#/tools/update');
|
||||||
}
|
}
|
||||||
if (confirm(y18n.t('confirm_update_type', [y18n.t('system_'+c.params['type']).toLowerCase()]))) {
|
else if (confirm(y18n.t('confirm_update_type', [y18n.t('system_'+c.params['type']).toLowerCase()]))) {
|
||||||
params = []
|
endurl = '';
|
||||||
if (c.params['type'] == 'packages') {params.push('ignore-apps');}
|
if (c.params['type'] == 'packages') {endurl = 'ignore_apps';}
|
||||||
if (c.params['type'] == 'apps') {params.push('ignore-packages');}
|
else if (c.params['type'] == 'apps') {endurl = 'ignore_packages';}
|
||||||
c.api('/upgrade', function(data) {
|
|
||||||
|
c.api('/upgrade?'+endurl, function(data) {
|
||||||
// 'log' is a reserved name, maybe in handlebars
|
// 'log' is a reserved name, maybe in handlebars
|
||||||
data.logs = data.log;
|
data.logs = data.log;
|
||||||
c.view('tools/tools_upgrade', data);
|
c.view('tools/tools_upgrade', data);
|
||||||
}, 'PUT', params);
|
}, 'PUT');
|
||||||
} else {
|
} else {
|
||||||
store.clear('slide');
|
store.clear('slide');
|
||||||
c.redirect('#/tools/update');
|
c.redirect('#/tools/update');
|
||||||
|
|
Loading…
Add table
Reference in a new issue