From 09b9441e58f76b2f4aa4489e19b1557fe64a7d4a Mon Sep 17 00:00:00 2001 From: Kload Date: Sat, 17 May 2014 23:01:30 +0200 Subject: [PATCH] [enh] Directly login after postinstallation --- js/app.js | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/js/app.js b/js/app.js index f1a59fce..eed3008b 100644 --- a/js/app.js +++ b/js/app.js @@ -188,16 +188,21 @@ app = Sammy('#main', function (sam) { if (args.domain.match(/\.nohost\.me$/) || args.domain.match(/\.noho\.st$/)) { $('#popup-title').text(y18n.t('installed')); $('#popup-body p').text(y18n.t('installation_complete_dns')); - interval = 180000; + interval = 120000; } else { interval = 5000; } setInterval(function () { - $('#popup-title').text(y18n.t('installation_complete')); - $('#popup-body').html( - '

'+ y18n.t('installation_complete_desc', ['https://'+ args.domain +'/yunohost/admin', args.domain +'/yunohost/admin']) +'

' - + '
' - + '

'+ y18n.t('installation_complete_help_dns') +'

'); + $.post(store.get('url') +'/login', function(data) { + store.set('connected', true); + $('.logout-button').fadeIn(); + c.flash('success', y18n.t('installation_complete')); + c.redirect('#/'); + }) + .fail(function() { + $('#popup').modal('hide'); + c.flash('fail', y18n.t('error_occured')); + }); }, interval); } else { $('#popup').modal('hide');