mirror of
https://github.com/YunoHost/yunohost-admin.git
synced 2024-09-03 20:06:15 +02:00
[enh] Automaticaly redirect to login if postinstalled from IP
This commit is contained in:
parent
5db95f08bc
commit
a380c6b1b3
1 changed files with 11 additions and 5 deletions
16
js/app.js
16
js/app.js
|
@ -193,11 +193,17 @@ app = Sammy('#main', function (sam) {
|
|||
interval = 5000;
|
||||
}
|
||||
setInterval(function () {
|
||||
$('#popup-title').text(y18n.t('installation_complete'));
|
||||
$('#popup-body').html(
|
||||
'<p>'+ y18n.t('installation_complete_desc', ['https://'+ args.domain +'/yunohost/admin', args.domain +'/yunohost/admin']) +'</p>'
|
||||
+ '<br>'
|
||||
+ '<p><small>'+ y18n.t('installation_complete_help_dns') +'</small></p>');
|
||||
if (window.location.hostname === args.domain) {
|
||||
$('#popup-title').text(y18n.t('installation_complete'));
|
||||
$('#popup-body').html(
|
||||
'<p>'+ y18n.t('installation_complete_desc', ['https://'+ args.domain +'/yunohost/admin', args.domain +'/yunohost/admin']) +'</p>'
|
||||
+ '<br>'
|
||||
+ '<p><small>'+ y18n.t('installation_complete_help_dns') +'</small></p>');
|
||||
} else {
|
||||
$('#popup').modal('hide');
|
||||
c.flash('success', y18n.t('installation_complete'));
|
||||
c.redirect('#/login');
|
||||
}
|
||||
}, interval);
|
||||
} else {
|
||||
$('#popup').modal('hide');
|
||||
|
|
Loading…
Reference in a new issue