From 7068578b6a6d3d8c3f991e50026bd141f14146a6 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Wed, 24 Apr 2019 18:10:56 +0200 Subject: [PATCH] Redirect to #/tools/logs after upgrade --- src/js/yunohost/controllers/tools.js | 49 +++++++++++++++------------- 1 file changed, 26 insertions(+), 23 deletions(-) diff --git a/src/js/yunohost/controllers/tools.js b/src/js/yunohost/controllers/tools.js index b4bdb475..1e18c72d 100644 --- a/src/js/yunohost/controllers/tools.js +++ b/src/js/yunohost/controllers/tools.js @@ -60,9 +60,32 @@ // confirm_update_apps and confirm_update_packages y18n.t('confirm_update_' + c.params['type'].toLowerCase()), function(){ - c.api('/upgrade?'+c.params["type"], function(data) { - c.view('home', data); - }, 'PUT'); + c.api('/upgrade?'+c.params["type"], + function(data) { + store.clear('slide'); + c.redirect('#/tools/logs'); + }, + 'PUT'); + }, + function(){ + store.clear('slide'); + c.redirect('#/update'); + } + ); + }); + + // Upgrade a specific apps + app.get('#/upgrade/apps/:app', function (c) { + c.confirm( + y18n.t('tools'), + y18n.t('confirm_update_specific_app', [c.params['app']]), + function(){ + c.api('/upgrade/apps?app='+c.params['app'].toLowerCase(), + function(data) { + store.clear('slide'); + c.redirect('#/tools/logs'); + }, + 'PUT'); }, function(){ store.clear('slide'); @@ -121,26 +144,6 @@ }); }); - // Upgrade a specific apps - app.get('#/upgrade/apps/:app', function (c) { - c.confirm( - y18n.t('tools'), - y18n.t('confirm_update_specific_app', [c.params['app']]), - function(){ - c.api('/upgrade/apps?app='+c.params['app'].toLowerCase(), - function(data) { - // 'log' is a reserved name, maybe in handlebars - data.logs = data.log; - c.view('upgrade/upgrade', data); - }, 'PUT'); - }, - function(){ - store.clear('slide'); - c.redirect('#/update'); - } - ); - }); - // Download SSL Certificate Authority app.get('#/tools/ca', function (c) {