mirror of
https://github.com/YunoHost/yunohost-admin.git
synced 2024-09-03 20:06:15 +02:00
[fix] API's 404 breaks page and message layout.
This commit is contained in:
parent
6de20e73c7
commit
22514d7c8a
3 changed files with 10 additions and 2 deletions
5
src/dist/js/script.min.js
vendored
5
src/dist/js/script.min.js
vendored
File diff suppressed because one or more lines are too long
|
@ -146,6 +146,12 @@ var app = Sammy('#main', function (sam) {
|
|||
if (xhr.status == 200) {
|
||||
// Fail with 200, WTF
|
||||
callback({});
|
||||
} else if (xhr.status == 404) {
|
||||
// API's 404 are not JSON, we can't use raw responseJSON
|
||||
// and responseText is a complete HTML document.
|
||||
c.flash('fail', y18n.t('uri_not_found', [uri]));
|
||||
// Redirect to previous page.
|
||||
c.redirect(store.get('path-1'));
|
||||
} else if (xhr.status == 401) {
|
||||
if (uri === '/login') {
|
||||
c.flash('fail', y18n.t('wrong_password'));
|
||||
|
|
|
@ -63,6 +63,7 @@
|
|||
"unknown_argument" : "Unknown argument : %s",
|
||||
"api_not_responding" : "API is not responding (Error : %s)",
|
||||
"error_retrieve_feed" : "Could not retrieve feed : %s",
|
||||
"uri_not_found" : "Page not found : %s",
|
||||
|
||||
"confirm_delete" : "Are you sure you want to delete %s ?",
|
||||
"confirm_change_maindomain" : "Are you sure you want to change the main domain ?",
|
||||
|
|
Loading…
Add table
Reference in a new issue