mirror of
https://github.com/YunoHost/yunohost-admin.git
synced 2024-09-03 20:06:15 +02:00
Fix #48 : Display warning before installing an app on domain root (/)
This commit is contained in:
parent
92b6cd0c0f
commit
17bbb55545
1 changed files with 19 additions and 11 deletions
|
@ -872,6 +872,8 @@ app = Sammy('#main', function (sam) {
|
|||
});
|
||||
|
||||
sam.post('#/apps', function(c) {
|
||||
// Warn admin if app is going to be installed on domain root.
|
||||
if (c.params['path'] !== '/' || confirm(y18n.t('confirm_install_domain_root', [c.params['domain']]))) {
|
||||
params = { 'label': c.params['label'], 'app': c.params['app'] }
|
||||
delete c.params['label'];
|
||||
delete c.params['app'];
|
||||
|
@ -884,6 +886,12 @@ app = Sammy('#main', function (sam) {
|
|||
c.api('/apps', function() { // http://api.yunohost.org/#!/app/app_install_post_2
|
||||
c.redirect('#/apps');
|
||||
}, 'POST', params);
|
||||
}
|
||||
else {
|
||||
c.flash('warning', y18n.t('app_install_cancel'));
|
||||
store.clear('slide');
|
||||
c.redirect('#/apps/install');
|
||||
}
|
||||
});
|
||||
|
||||
// Install custom app from github
|
||||
|
|
Loading…
Add table
Reference in a new issue