[enh] Automaticaly redirect to login if postinstalled from IP

This commit is contained in:
Kload 2014-05-17 23:16:36 +02:00
parent 5db95f08bc
commit a380c6b1b3

View file

@ -193,11 +193,17 @@ app = Sammy('#main', function (sam) {
interval = 5000; interval = 5000;
} }
setInterval(function () { setInterval(function () {
$('#popup-title').text(y18n.t('installation_complete')); if (window.location.hostname === args.domain) {
$('#popup-body').html( $('#popup-title').text(y18n.t('installation_complete'));
'<p>'+ y18n.t('installation_complete_desc', ['https://'+ args.domain +'/yunohost/admin', args.domain +'/yunohost/admin']) +'</p>' $('#popup-body').html(
+ '<br>' '<p>'+ y18n.t('installation_complete_desc', ['https://'+ args.domain +'/yunohost/admin', args.domain +'/yunohost/admin']) +'</p>'
+ '<p><small>'+ y18n.t('installation_complete_help_dns') +'</small></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); }, interval);
} else { } else {
$('#popup').modal('hide'); $('#popup').modal('hide');