mirror of
https://github.com/YunoHost/yunohost-admin.git
synced 2024-09-03 20:06:15 +02:00
[fix] Postinstall
This commit is contained in:
parent
83199e1a9a
commit
b50562085b
1 changed files with 5 additions and 12 deletions
13
js/app.js
13
js/app.js
|
@ -168,7 +168,6 @@ app = Sammy('#main', function (sam) {
|
||||||
.always(function(data) {
|
.always(function(data) {
|
||||||
if (data.status !== 'undefined' && uri === '/login') {
|
if (data.status !== 'undefined' && uri === '/login') {
|
||||||
if (data.status === 401) {
|
if (data.status === 401) {
|
||||||
$('#popup').modal('hide');
|
|
||||||
c.flash('fail', y18n.t('wrong_password'));
|
c.flash('fail', y18n.t('wrong_password'));
|
||||||
}
|
}
|
||||||
// 200 & empty response TODO: better comment
|
// 200 & empty response TODO: better comment
|
||||||
|
@ -198,29 +197,21 @@ app = Sammy('#main', function (sam) {
|
||||||
// console.log('success');console.log(data);
|
// console.log('success');console.log(data);
|
||||||
// data = typeof data !== 'undefined' ? data : {};
|
// data = typeof data !== 'undefined' ? data : {};
|
||||||
data = data || {};
|
data = data || {};
|
||||||
if (typeof data.win !== 'undefined') {
|
|
||||||
$.each(data.win, function(k, v) {
|
|
||||||
c.flash('success', v);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
callback(data);
|
callback(data);
|
||||||
})
|
})
|
||||||
.fail(function(xhr) {
|
.fail(function(xhr) {
|
||||||
// console.log('fail');console.log(xhr);
|
// console.log('fail');console.log(xhr);
|
||||||
if (xhr.status == 401) {
|
if (xhr.status == 401) {
|
||||||
$('#popup').modal('hide');
|
|
||||||
if (uri !== '/login') {
|
if (uri !== '/login') {
|
||||||
c.flash('fail', y18n.t('unauthorized'));
|
c.flash('fail', y18n.t('unauthorized'));
|
||||||
c.redirect('#/login');
|
c.redirect('#/login');
|
||||||
}
|
}
|
||||||
} else if (typeof xhr.responseJSON !== 'undefined') {
|
} else if (typeof xhr.responseJSON !== 'undefined') {
|
||||||
$('#popup').modal('hide');
|
|
||||||
c.flash('fail', xhr.responseJSON.error);
|
c.flash('fail', xhr.responseJSON.error);
|
||||||
} else if (typeof xhr.responseText !== 'undefined' && uri !== '/postinstall') {
|
} else if (typeof xhr.responseText !== 'undefined' && uri !== '/postinstall') {
|
||||||
$('#popup').modal('hide');
|
|
||||||
c.flash('fail', xhr.responseText);
|
c.flash('fail', xhr.responseText);
|
||||||
} else {
|
} else {
|
||||||
if (uri == '/postinstall') {
|
if (uri === '/postinstall') {
|
||||||
if (installing) {
|
if (installing) {
|
||||||
checkInstall = setInterval(function () {
|
checkInstall = setInterval(function () {
|
||||||
c.checkInstall(function(isInstalled) {
|
c.checkInstall(function(isInstalled) {
|
||||||
|
@ -238,8 +229,10 @@ app = Sammy('#main', function (sam) {
|
||||||
c.flash('fail', y18n.t('error_server'));
|
c.flash('fail', y18n.t('error_server'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (uri !== '/postinstall') {
|
||||||
store.clear('slide');
|
store.clear('slide');
|
||||||
c.redirect(store.get('path-1'));
|
c.redirect(store.get('path-1'));
|
||||||
|
};
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
Loading…
Add table
Reference in a new issue