[enh] Directly login after postinstallation

This commit is contained in:
Kload 2014-05-17 23:01:30 +02:00
parent f4a638f887
commit 09b9441e58

View file

@ -188,16 +188,21 @@ app = Sammy('#main', function (sam) {
if (args.domain.match(/\.nohost\.me$/) || args.domain.match(/\.noho\.st$/)) { if (args.domain.match(/\.nohost\.me$/) || args.domain.match(/\.noho\.st$/)) {
$('#popup-title').text(y18n.t('installed')); $('#popup-title').text(y18n.t('installed'));
$('#popup-body p').text(y18n.t('installation_complete_dns')); $('#popup-body p').text(y18n.t('installation_complete_dns'));
interval = 180000; interval = 120000;
} else { } else {
interval = 5000; interval = 5000;
} }
setInterval(function () { setInterval(function () {
$('#popup-title').text(y18n.t('installation_complete')); $.post(store.get('url') +'/login', function(data) {
$('#popup-body').html( store.set('connected', true);
'<p>'+ y18n.t('installation_complete_desc', ['https://'+ args.domain +'/yunohost/admin', args.domain +'/yunohost/admin']) +'</p>' $('.logout-button').fadeIn();
+ '<br>' c.flash('success', y18n.t('installation_complete'));
+ '<p><small>'+ y18n.t('installation_complete_help_dns') +'</small></p>'); c.redirect('#/');
})
.fail(function() {
$('#popup').modal('hide');
c.flash('fail', y18n.t('error_occured'));
});
}, interval); }, interval);
} else { } else {
$('#popup').modal('hide'); $('#popup').modal('hide');