mirror of
https://github.com/YunoHost/yunohost-admin.git
synced 2024-09-03 20:06:15 +02:00
Fixes
This commit is contained in:
parent
37949b852c
commit
37d5a82196
3 changed files with 31 additions and 6 deletions
|
@ -70,3 +70,11 @@ body .page-header {
|
|||
div.br {
|
||||
height: 30px;
|
||||
}
|
||||
|
||||
div.loader-content {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
padding: 30px;
|
||||
right: 0;
|
||||
z-index: 2000;
|
||||
}
|
||||
|
|
|
@ -35,7 +35,6 @@
|
|||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
<h3 class="modal-title" id="popup-title"></h3>
|
||||
</div>
|
||||
<div class="modal-body" id="popup-body"></div>
|
||||
|
|
28
js/app.js
28
js/app.js
|
@ -9,6 +9,7 @@ app = Sammy('#main', function (sam) {
|
|||
|
||||
// Initialize storage
|
||||
var store = new Sammy.Store({name: 'storage', type: 'session'});
|
||||
var loaded = false;
|
||||
|
||||
/**
|
||||
* Helpers
|
||||
|
@ -59,11 +60,20 @@ app = Sammy('#main', function (sam) {
|
|||
setInterval(function () {
|
||||
installing = true;
|
||||
}, 6000);
|
||||
}
|
||||
if (uri == '/postinstall') {
|
||||
|
||||
$('#popup-title').text('Installing');
|
||||
$('#popup-body').html('<p>YunoHost is being installed on <strong>'+ data.domain +'</strong>. It may take a few minutes ...</p><br><div class="text-center"><img src="img/ajax-loader.gif"></div>');
|
||||
$('#popup-body').html('<p>YunoHost is being installed on <strong>'+ data.domain +'</strong>. It may take a few minutes ...</p><br><div class="text-center"><img src="img/ajax-loader.gif"></div><br>');
|
||||
$('#popup').modal('show');
|
||||
} else {
|
||||
loaded = false;
|
||||
if ($('div.loader-content').length == 0) {
|
||||
setInterval(function () {
|
||||
if (!loaded && $('div.loader-content').length == 0) {
|
||||
console.log('meh');
|
||||
$('#main').append('<div class="loader-content"><img src="img/ajax-loader.gif"></div>');
|
||||
}
|
||||
}, 500);
|
||||
}
|
||||
}
|
||||
jQuery.ajax({
|
||||
url: store.get('url') + uri,
|
||||
|
@ -87,15 +97,18 @@ app = Sammy('#main', function (sam) {
|
|||
})
|
||||
.fail(function(xhr) {
|
||||
console.log(xhr);
|
||||
c.flash('fail', 'Wrong password');
|
||||
if (xhr.status == 401) {
|
||||
c.flash('fail', 'Wrong password');
|
||||
} else if (typeof xhr.responseJSON !== 'undefined') {
|
||||
} else if (typeof xhr.responseJSON !== undefined) {
|
||||
c.flash('fail', xhr.responseJSON.error);
|
||||
} else {
|
||||
if (uri == '/postinstall') {
|
||||
if (installing) {
|
||||
if (args.domain.match(/\.nohost\.me$/) || args.domain.match(/\.noho\.st$/)) {
|
||||
interval = 150000;
|
||||
$('#popup-title').text('Installed');
|
||||
$('#popup-body').html('<p>YunoHost has been successfully installed, we\'ll wait for DNS to be propagated. It will take 3 minutes ...</p><br><div class="text-center"><img src="img/ajax-loader.gif"></div><br>');
|
||||
interval = 180000;
|
||||
} else {
|
||||
interval = 5000;
|
||||
}
|
||||
|
@ -115,6 +128,8 @@ app = Sammy('#main', function (sam) {
|
|||
c.redirect(store.get('path-1'));
|
||||
})
|
||||
.done(function(data) {
|
||||
loaded = true;
|
||||
$('div.loader-content').remove();
|
||||
console.log(data);
|
||||
});
|
||||
},
|
||||
|
@ -125,6 +140,9 @@ app = Sammy('#main', function (sam) {
|
|||
|
||||
enableSlide = true; // Change to false to disable animation
|
||||
|
||||
loaded = true;
|
||||
$('div.loader-content').remove();
|
||||
|
||||
if (enableSlide) {
|
||||
function leSwap() {
|
||||
rendered.swap(function() {
|
||||
|
|
Loading…
Add table
Reference in a new issue