mirror of
https://github.com/YunoHost/yunohost-admin.git
synced 2024-09-03 20:06:15 +02:00
Treat postinstall right
This commit is contained in:
parent
349eca613f
commit
4839a57646
1 changed files with 12 additions and 0 deletions
12
js/app.js
12
js/app.js
|
@ -42,6 +42,13 @@ app = Sammy('#main', function (sam) {
|
||||||
method = typeof method !== 'undefined' ? method : 'GET';
|
method = typeof method !== 'undefined' ? method : 'GET';
|
||||||
data = typeof data !== 'undefined' ? data : {};
|
data = typeof data !== 'undefined' ? data : {};
|
||||||
auth = "Basic "+ btoa(store.get('user') +':'+ atob(store.get('password')));
|
auth = "Basic "+ btoa(store.get('user') +':'+ atob(store.get('password')));
|
||||||
|
if (uri == '/postinstall') {
|
||||||
|
var installing = false;
|
||||||
|
|
||||||
|
check = setInterval(function () {
|
||||||
|
installing = true;
|
||||||
|
}, 4000);
|
||||||
|
}
|
||||||
jQuery.ajax({
|
jQuery.ajax({
|
||||||
url: store.get('url') + uri,
|
url: store.get('url') + uri,
|
||||||
type: method,
|
type: method,
|
||||||
|
@ -69,6 +76,11 @@ app = Sammy('#main', function (sam) {
|
||||||
} else if (typeof xhr.responseJSON !== 'undefined') {
|
} else if (typeof xhr.responseJSON !== 'undefined') {
|
||||||
c.flash('fail', xhr.responseJSON.error);
|
c.flash('fail', xhr.responseJSON.error);
|
||||||
} else {
|
} else {
|
||||||
|
if (uri == '/postinstall') {
|
||||||
|
if (installing) {
|
||||||
|
window.location.replace('https://'+ data['domain'] +'/ynhadmin');
|
||||||
|
}
|
||||||
|
}
|
||||||
c.flash('fail', 'Server error');
|
c.flash('fail', 'Server error');
|
||||||
}
|
}
|
||||||
store.clear('slide');
|
store.clear('slide');
|
||||||
|
|
Loading…
Add table
Reference in a new issue