We don't need all those cancel callbacks, just staying on the page where we are is fine...

This commit is contained in:
Alexandre Aubin 2019-10-14 04:04:24 +02:00
parent 46c5e1c4ad
commit b58ea7a34c
8 changed files with 5 additions and 88 deletions

View file

@ -490,6 +490,8 @@
if ((is_safe_for_install_color === "warning") || (is_safe_for_install_color === "danger")) if ((is_safe_for_install_color === "warning") || (is_safe_for_install_color === "danger"))
{ {
// Disable the pacman while we ask for confirmation
$('div.loader').remove();
c.confirm( c.confirm(
y18n.t("applications"), y18n.t("applications"),
y18n.t("confirm_install_app_"+is_safe_for_install_color), y18n.t("confirm_install_app_"+is_safe_for_install_color),
@ -499,10 +501,6 @@
app_infos.manifest, app_infos.manifest,
c.params c.params
); );
},
function(){
$('div.loader').remove();
c.redirect_to('#/apps/install', {slide:false});
} }
); );
} }
@ -591,10 +589,6 @@
c.flash('fail', y18n.t('app_install_custom_no_manifest')); c.flash('fail', y18n.t('app_install_custom_no_manifest'));
c.redirect_to('#/apps/install', {slide:false}); c.redirect_to('#/apps/install', {slide:false});
}); });
},
function(){
c.flash('warning', y18n.t('app_install_cancel'));
c.redirect_to('#/apps/install');
} }
); );
}); });
@ -608,9 +602,6 @@
c.api('DELETE', '/apps/'+ c.params['app'], {}, function() { // http://api.yunohost.org/#!/app/app_remove_delete_4 c.api('DELETE', '/apps/'+ c.params['app'], {}, function() { // http://api.yunohost.org/#!/app/app_remove_delete_4
c.redirect_to('#/apps'); c.redirect_to('#/apps');
}); });
},
function() {
c.redirect_to('#/apps/'+ c.params['app'], {slide:false});
} }
); );
}); });
@ -673,9 +664,6 @@
c.api('DELETE', '/access?'+c.serialize(params), params, function(data) { c.api('DELETE', '/access?'+c.serialize(params), params, function(data) {
c.redirect_to('#/apps/'+ c.params['app']+ '/access', {slide:false}); c.redirect_to('#/apps/'+ c.params['app']+ '/access', {slide:false});
}); });
},
function() {
c.redirect_to('#/apps/'+ c.params['app']+ '/access', {slide:false});
} }
); );
}); });
@ -693,9 +681,6 @@
c.api('DELETE', '/access?'+c.serialize(params), params, function(data) { c.api('DELETE', '/access?'+c.serialize(params), params, function(data) {
c.redirect_to('#/apps/'+ c.params['app']+ '/access', {slide:false}); c.redirect_to('#/apps/'+ c.params['app']+ '/access', {slide:false});
}); });
},
function() {
c.redirect_to('#/apps/'+ c.params['app']+ '/access', {slide:false});
} }
); );
}); });
@ -713,9 +698,6 @@
c.api('PUT', '/access', params, function() { c.api('PUT', '/access', params, function() {
c.redirect_to('#/apps/'+ c.params['app'] +'/access', {slide:false}); c.redirect_to('#/apps/'+ c.params['app'] +'/access', {slide:false});
}); });
},
function() {
c.redirect_to('#/apps/'+ c.params['app']+ '/access', {slide:false});
} }
); );
}); });
@ -743,9 +725,6 @@
c.api('POST', '/access', params, function() { c.api('POST', '/access', params, function() {
c.redirect_to('#/apps/'+ c.params['app'] +'/access', {slide:false}); c.redirect_to('#/apps/'+ c.params['app'] +'/access', {slide:false});
}); });
},
function() {
c.redirect_to('#/apps/'+ c.params['app']+ '/access', {slide:false});
} }
); );
}); });
@ -759,9 +738,6 @@
c.api('PUT', '/apps/'+c.params['app']+'/default', {}, function() { c.api('PUT', '/apps/'+c.params['app']+'/default', {}, function() {
c.redirect_to('#/apps/'+ c.params['app'], {slide:false}); c.redirect_to('#/apps/'+ c.params['app'], {slide:false});
}); });
},
function() {
c.redirect_to('#/apps/'+ c.params['app'], {slide:false});
} }
); );
}); });
@ -823,9 +799,6 @@
c.api('PUT', '/apps/' + c.params['app'] + '/changeurl', params, function(data) { // Call changeurl API c.api('PUT', '/apps/' + c.params['app'] + '/changeurl', params, function(data) { // Call changeurl API
c.redirect_to('#/apps/'+ c.params['app']); c.redirect_to('#/apps/'+ c.params['app']);
}); });
},
function() {
c.redirect_to('#/apps/'+ c.params['app'] + '/changeurl', {slide:false});
} }
); );
}); });

View file

@ -78,10 +78,7 @@
c.api('POST', '/backup/restore/'+c.params['archive'], params, function(data) { c.api('POST', '/backup/restore/'+c.params['archive'], params, function(data) {
c.redirect_to('#/backup/'+ c.params['storage']+'/'+c.params['archive']); c.redirect_to('#/backup/'+ c.params['storage']+'/'+c.params['archive']);
}); });
}, this, c), }, this, c)
function(){
c.redirect_to('#/backup/'+ c.params['storage']+'/'+c.params['archive'], {slide: false});
}
); );
}); });
@ -94,9 +91,6 @@
c.api('DELETE', '/backup/archives/'+c.params['archive'], {}, function(data) { c.api('DELETE', '/backup/archives/'+c.params['archive'], {}, function(data) {
c.redirect_to('#/backup/'+ c.params['storage']); c.redirect_to('#/backup/'+ c.params['storage']);
}); });
},
function(){
c.redirect_to('#/backup/'+ c.params['storage']+'/'+c.params['archive'], {slide: false});
} }
); );
}); });

View file

@ -211,9 +211,6 @@
c.api('POST', '/domains/cert-install/' + c.params['domain'], {}, function(data) { c.api('POST', '/domains/cert-install/' + c.params['domain'], {}, function(data) {
c.redirect_to('#/domains/'+c.params['domain']+'/cert-management', {slide:false}); c.redirect_to('#/domains/'+c.params['domain']+'/cert-management', {slide:false});
}); });
},
function(){
c.redirect_to('#/domains/'+c.params['domain']+'/cert-management', {slide:false});
} }
); );
}); });
@ -227,9 +224,6 @@
c.api('POST', '/domains/cert-install/' + c.params['domain'] + "?self_signed", {}, function(data) { c.api('POST', '/domains/cert-install/' + c.params['domain'] + "?self_signed", {}, function(data) {
c.redirect_to('#/domains/'+c.params['domain']+'/cert-management', {slide:false}); c.redirect_to('#/domains/'+c.params['domain']+'/cert-management', {slide:false});
}); });
},
function(){
c.redirect_to('#/domains/'+c.params['domain']+'/cert-management', {slide:false});
} }
); );
}); });
@ -243,9 +237,6 @@
c.api('POST', '/domains/cert-renew/' + c.params['domain'] + "?force", {}, function(data) { c.api('POST', '/domains/cert-renew/' + c.params['domain'] + "?force", {}, function(data) {
c.redirect_to('#/domains/'+c.params['domain']+'/cert-management', {slide:false}); c.redirect_to('#/domains/'+c.params['domain']+'/cert-management', {slide:false});
}); });
},
function(){
c.redirect_to('#/domains/'+c.params['domain']+'/cert-management', {slide:false});
} }
); );
}); });
@ -259,9 +250,6 @@
c.api('POST', '/domains/cert-install/' + c.params['domain'] + "?self_signed&force", {}, function(data) { c.api('POST', '/domains/cert-install/' + c.params['domain'] + "?self_signed&force", {}, function(data) {
c.redirect_to('#/domains/'+c.params['domain']+'/cert-management', {slide:false}); c.redirect_to('#/domains/'+c.params['domain']+'/cert-management', {slide:false});
}); });
},
function(){
c.redirect_to('#/domains/'+c.params['domain']+'/cert-management', {slide:false});
} }
); );
}); });
@ -276,10 +264,8 @@
c.api('DELETE', '/domains/'+ c.params['domain'], {}, function(data) { c.api('DELETE', '/domains/'+ c.params['domain'], {}, function(data) {
c.redirect_to('#/domains'); c.redirect_to('#/domains');
}); });
}, }
function(){ );
c.redirect_to('#/domains/' + c.params["domain"], {slide:false});
})
}); });
// Set default domain // Set default domain
@ -305,9 +291,6 @@
var refreshDomain = window.setTimeout(function(){ var refreshDomain = window.setTimeout(function(){
c.redirect_to('#/domains'); c.redirect_to('#/domains');
}, 15000); }, 15000);
},
function(){
c.redirect_to('#/domains', {slide:false});
} }
); );
} }

View file

@ -47,9 +47,6 @@
c.api('GET', '/firewall/upnp', params, function(data) { c.api('GET', '/firewall/upnp', params, function(data) {
c.redirect_to('#/tools/firewall'); c.redirect_to('#/tools/firewall');
}); });
},
function(){
c.redirect_to('#/tools/firewall', {slide: false});
} }
); );
}); });
@ -135,9 +132,6 @@
c.params['connection'], c.params['connection'],
c.params['action'] c.params['action']
); );
},
function(){
c.redirect_to('#/tools/firewall', {slide: false});
} }
); );
}); });
@ -154,9 +148,6 @@
c.params['connection'], c.params['connection'],
c.params['action'] c.params['action']
); );
},
function(){
c.redirect_to('#/tools/firewall', {slide: false});
} }
); );
}); });

View file

@ -92,8 +92,6 @@
c.api('POST', '/postinstall', params, function(data) { c.api('POST', '/postinstall', params, function(data) {
c.redirect_to('#/login'); c.redirect_to('#/login');
}); });
},
function(){
} }
); );
} else { } else {

View file

@ -121,9 +121,6 @@
else { else {
c.redirect_to('#/services/'+ c.params['service'], {slide: false}); c.redirect_to('#/services/'+ c.params['service'], {slide: false});
} }
},
function(){
c.redirect_to('#/services/'+ c.params['service'], {slide: false});
} }
); );
}); });

View file

@ -61,9 +61,6 @@
c.api('PUT', '/upgrade?'+c.params["type"], {}, function(data) { c.api('PUT', '/upgrade?'+c.params["type"], {}, function(data) {
c.redirect_to('#/tools/logs'); c.redirect_to('#/tools/logs');
}); });
},
function(){
c.redirect_to('#/update', {slide: false});
} }
); );
}); });
@ -77,9 +74,6 @@
c.api('PUT', '/upgrade/apps?app='+c.params['app'].toLowerCase(), {}, function(data) { c.api('PUT', '/upgrade/apps?app='+c.params['app'].toLowerCase(), {}, function(data) {
c.redirect_to('#/tools/logs'); c.redirect_to('#/tools/logs');
}); });
},
function(){
c.redirect_to('#/update', {slide: false});
} }
); );
}); });
@ -239,10 +233,6 @@
// Force scrollTop on page load // Force scrollTop on page load
$('html, body').scrollTop(0); $('html, body').scrollTop(0);
}, false); }, false);
},
function(){
c.redirect_to('#/tools/reboot', {slide: false});
} }
); );
} }
@ -338,9 +328,6 @@
c.api('POST', '/migrations/migrate?skip&targets=' + c.params['migration_id'], {}, function(data) { c.api('POST', '/migrations/migrate?skip&targets=' + c.params['migration_id'], {}, function(data) {
c.redirect_to('#/tools/migrations', {slide: false}); c.redirect_to('#/tools/migrations', {slide: false});
}); });
},
function(){
c.redirect_to('#/tools/migrations', {slide: false});
} }
); );
}); });
@ -417,9 +404,6 @@
c.api('DELETE', '/appslists', {'name' : c.params['appslist']}, function() { c.api('DELETE', '/appslists', {'name' : c.params['appslist']}, function() {
c.redirect_to('#/tools/appslists'); c.redirect_to('#/tools/appslists');
}); });
},
function() {
c.redirect_to('#/tools/appslists/'+ c.params['appslist'], {slide: false});
} }
); );
}); });

View file

@ -206,9 +206,6 @@
c.api('DELETE', '/users/'+ c.params['user'], params, function(data) { c.api('DELETE', '/users/'+ c.params['user'], params, function(data) {
c.redirect_to('#/users'); c.redirect_to('#/users');
}); });
},
function(){
c.redirect_to('#/users/'+ c.params['user'], {slide: false});
} }
); );