diff --git a/dist/desktop b/dist/desktop index 89e7db0fb8b42f13789ff2175c3bb622d0438831..adc9f85dd7d2667389bf179950f1ba9e2781c9aa 160000 --- a/dist/desktop +++ b/dist/desktop @@ -1 +1 @@ -Subproject commit 89e7db0fb8b42f13789ff2175c3bb622d0438831 +Subproject commit adc9f85dd7d2667389bf179950f1ba9e2781c9aa diff --git a/www/i18n/locale-ca.json b/www/i18n/locale-ca.json index a39ca3c7fabf0383b379630222046ee8d01d4652..d0e97c04c9c6a0145c7ce991b82ae35a3a2993ba 100644 --- a/www/i18n/locale-ca.json +++ b/www/i18n/locale-ca.json @@ -806,6 +806,7 @@ "POPUP_TITLE": "Error", "UNKNOWN_ERROR": "Error desconocido", "TIMEOUT_REACHED": "S'ha superat el temps d'espera del node ({{timeout|formatDurationMs}}).<br/><br/><small>{{url}}</small>", + "TOO_MANY_REQUESTS": "Heu enviat massa sol·licituds en un curt perÃode de temps. Espereu una estona abans de tornar-ho a provar.<br/><br/><small>{{url}}</small>", "CRYPTO_UNKNOWN_ERROR": "Su navegador parece incompatible con las funcionalidades de cryptografÃa.", "DOWNLOAD_KEYFILE_FAILED": "Error al generar el archivo de llaves.", "EQUALS_TO_PSEUDO": "Debe ser diferente del seudónimo.", diff --git a/www/i18n/locale-de-DE.json b/www/i18n/locale-de-DE.json index c3881dbb27573cb4c30a766f73c7f0bddb4a6d41..c0b83e4ee998c5c759d5347344025d01c74ae060 100644 --- a/www/i18n/locale-de-DE.json +++ b/www/i18n/locale-de-DE.json @@ -724,6 +724,7 @@ "POPUP_TITLE": "Fehler", "UNKNOWN_ERROR": "Unbekannter Fehler", "TIMEOUT_REACHED": "Zeitüberschreitung des Knotens überschritten ({{timeout|formatDurationMs}}).<br/><br/><small>{{url}}</small>", + "TOO_MANY_REQUESTS": "Sie haben in kurzer Zeit zu viele Anfragen gesendet. Bitte warten Sie eine Weile, bevor Sie es erneut versuchen.<br/><br/><small>{{url}}</small>", "CRYPTO_UNKNOWN_ERROR": "Dein Browser ist nicht kompatibel mit kryptographischen Eigenschaften.", "DOWNLOAD_KEYFILE_FAILED": "Die Schlüsselbunddatei konnte nicht generiert werden.", "EQUALS_TO_PSEUDO": "Muss sich vom Pseudonym unterscheiden", diff --git a/www/i18n/locale-en-GB.json b/www/i18n/locale-en-GB.json index 9a8d2121be90d360d3dc22d8fe28829bd6c4272d..978271ab6c40ead7c861fc68ac33009acd7fe511 100644 --- a/www/i18n/locale-en-GB.json +++ b/www/i18n/locale-en-GB.json @@ -710,6 +710,7 @@ "POPUP_TITLE": "Error", "UNKNOWN_ERROR": "Unknown error", "TIMEOUT_REACHED": "Peer timeout exceeded ({{timeout|formatDurationMs}}).<br/><br/><small>{{url}}</small>", + "TOO_MANY_REQUESTS": "You have made too many requests in a short period of time. Please wait a while before trying again.<br/><br/><small>{{url}}</small>", "CRYPTO_UNKNOWN_ERROR": "Your browser is not compatible with cryptographic features.", "DOWNLOAD_KEYFILE_FAILED": "Failed to generate the keychain file.", "EQUALS_TO_PSEUDO": "Must be different from pseudonym", diff --git a/www/i18n/locale-en.json b/www/i18n/locale-en.json index ed0b431f1d627ed847cc02c47583adef84665bf9..3cb8316cb37be146d16af80324c3d88b46bec7ef 100644 --- a/www/i18n/locale-en.json +++ b/www/i18n/locale-en.json @@ -710,6 +710,7 @@ "POPUP_TITLE": "Error", "UNKNOWN_ERROR": "Unknown error", "TIMEOUT_REACHED": "Peer timeout exceeded ({{timeout|formatDurationMs}}).<br/><br/><small>{{url}}</small>", + "TOO_MANY_REQUESTS": "You have made too many requests in a short period of time. Please wait a while before trying again.<br/><br/><small>{{url}}</small>", "CRYPTO_UNKNOWN_ERROR": "Your browser is not compatible with cryptographic features.", "DOWNLOAD_KEYFILE_FAILED": "Failed to generate the keychain file.", "EQUALS_TO_PSEUDO": "Must be different from pseudonym", diff --git a/www/i18n/locale-eo-EO.json b/www/i18n/locale-eo-EO.json index 83b6fb501990dafd5d6cd84c17d263d104e3f040..a34f632e39a1392912d20e65f7c17da40f910174 100644 --- a/www/i18n/locale-eo-EO.json +++ b/www/i18n/locale-eo-EO.json @@ -709,6 +709,7 @@ "POPUP_TITLE": "Eraro", "UNKNOWN_ERROR": "Eraro nekonata", "TIMEOUT_REACHED": "La atendo de la nodo superis la tempon ({{timeout|formatDurationMs}}).<br/><br/><small>{{url}}</small>", + "TOO_MANY_REQUESTS": "Vi sendis tro da petojn en mallonga tempodaÅro. Bonvolu atendi iomete antaÅ ol reprovu.<br/><br/><small>{{url}}</small>", "CRYPTO_UNKNOWN_ERROR": "Via retumilo Åajnas ne kongrua kun la kriptografiaj funkcioj.", "DOWNLOAD_KEYFILE_FAILED": "Malsukceso por la kreado de la dosiero pri Ålosilaro.", "EQUALS_TO_PSEUDO": "Devas esti malsama ol la pseÅdonimo", diff --git a/www/i18n/locale-es-ES.json b/www/i18n/locale-es-ES.json index 4e718acc4150007d7df6d2856dc827577c1c8601..42b1c9deabe68240bfa90c990240c1468ffd0e38 100644 --- a/www/i18n/locale-es-ES.json +++ b/www/i18n/locale-es-ES.json @@ -805,6 +805,7 @@ "POPUP_TITLE": "Error", "UNKNOWN_ERROR": "Error desconocido", "TIMEOUT_REACHED": "Se ha excedido el tiempo de espera del nodo ({{timeout|formatDurationMs}}).<br/><br/><small>{{url}}</small>", + "TOO_MANY_REQUESTS": "Has enviado demasiadas solicitudes en un corto perÃodo de tiempo. Por favor, espera un momento antes de intentarlo de nuevo.<br/><br/><small>{{url}}</small>", "CRYPTO_UNKNOWN_ERROR": "Su navegador parece incompatible con las funcionalidades de cryptografÃa.", "DOWNLOAD_KEYFILE_FAILED": "Error al generar el archivo de llaves.", "EQUALS_TO_PSEUDO": "Debe ser diferente del seudónimo.", diff --git a/www/i18n/locale-fr-FR.json b/www/i18n/locale-fr-FR.json index a93e50348ef6796a8d7ca6b8af1c45efbb5da09a..f5ec93b01c9205f7889626793532e86f8b6beaa2 100644 --- a/www/i18n/locale-fr-FR.json +++ b/www/i18n/locale-fr-FR.json @@ -709,6 +709,7 @@ "PUBKEY_INVALID_CHECKSUM": "Clé publique invalide (bad checksum).", "POPUP_TITLE": "Erreur", "TIMEOUT_REACHED": "Délai d'attente du nÅ“ud dépassé ({{timeout|formatDurationMs}}).<br/><br/><small>{{url}}</small>", + "TOO_MANY_REQUESTS": "Vous avez envoyé trop de demandes dans un court laps de temps. Veuillez attendre un moment avant de réessayer.<br/><br/><small>{{url}}</small>", "UNKNOWN_ERROR": "Erreur inconnue", "CRYPTO_UNKNOWN_ERROR": "Votre navigateur ne semble pas compatible avec les fonctionnalités de cryptographie.", "DOWNLOAD_KEYFILE_FAILED": "Échec de la génération du fichier de trousseau.", diff --git a/www/i18n/locale-it-IT.json b/www/i18n/locale-it-IT.json index 35982bd0166795bae4d68402440e489814e1f004..a878177309da12b65140f9fefc5888d9b69cfe2c 100644 --- a/www/i18n/locale-it-IT.json +++ b/www/i18n/locale-it-IT.json @@ -710,6 +710,7 @@ "POPUP_TITLE": "Errore", "UNKNOWN_ERROR": "Errore", "TIMEOUT_REACHED": "Tempo di attesa del nodo superato ({{timeout|formatDurationMs}}).<br/><br/><small>{{url}}</small>", + "TOO_MANY_REQUESTS": "Hai inviato troppe richieste in un breve lasso di tempo. Attendere un attimo prima di riprovare.<br/><br/><small>{{url}}</small>", "CRYPTO_UNKNOWN_ERROR": "Il tuo navigatore non sembra compatibile con le funzionalità di cryptografia.", "DOWNLOAD_KEYFILE_FAILED": "Errore nel generare il file del portachiavi", "EQUALS_TO_PSEUDO": "Deve essere diverso dallo pseudonimo", diff --git a/www/i18n/locale-nl-NL.json b/www/i18n/locale-nl-NL.json index 64aca5029ab2089e2498c5bcc3d38be662db123d..8787f3fede5901126890a2a332af92295b9dbc42 100644 --- a/www/i18n/locale-nl-NL.json +++ b/www/i18n/locale-nl-NL.json @@ -549,6 +549,7 @@ "POPUP_TITLE": "Error", "UNKNOWN_ERROR": "Unknown error", "TIMEOUT_REACHED": "Node timeout overschreden ({{timeout|formatDurationMs}}).<br/><br/><small>{{url}}</small>", + "TOO_MANY_REQUESTS": "U heeft te veel verzoeken in een korte tijd verzonden. Wacht even voordat u het opnieuw probeert.<br/><br/><small>{{url}}</small>", "CRYPTO_UNKNOWN_ERROR": "Your browser is not compatible with cryptographic features.", "FIELD_REQUIRED": "This field is required.", "FIELD_TOO_SHORT": "Value is too short (min {{minLength]] characters).", diff --git a/www/i18n/locale-pt-PT.json b/www/i18n/locale-pt-PT.json index 7c5ae5c2487f338819f6257ca2b76292671e6e56..6110a0b71217b70eb4e24e60418a704e881468e7 100644 --- a/www/i18n/locale-pt-PT.json +++ b/www/i18n/locale-pt-PT.json @@ -805,6 +805,7 @@ "POPUP_TITLE": "Erro", "UNKNOWN_ERROR": "Erro desconhecido", "TIMEOUT_REACHED": "Tempo de espera do nó excedido ({{timeout|formatDurationMs}}).<br/><br/><small>{{url}}</small>", + "TOO_MANY_REQUESTS": "Enviou demasiados pedidos em um curto perÃodo de tempo. Por favor, aguarde um momento antes de tentar novamente.<br/><br/><small>{{url}}</small>", "CRYPTO_UNKNOWN_ERROR": "O seu navegador parece incompatÃvel com as funcionalidades de criptografia.", "DOWNLOAD_KEYFILE_FAILED": "Falha ao gerar o arquivo de chaves.", "EQUALS_TO_PSEUDO": "Deve ser diferente do seu pseudónimo.", diff --git a/www/js/services/http-services.js b/www/js/services/http-services.js index 60ea5fcf907bfc2b3e54541f301b04861c32542e..910a6b4369e92078cc48b72421409f354e7ebcfa 100644 --- a/www/js/services/http-services.js +++ b/www/js/services/http-services.js @@ -15,6 +15,7 @@ angular.module('cesium.http.services', ['cesium.cache.services']) TIMEOUT: -1, // Timeout reached FORBIDDEN: 403, NOT_FOUND: 404, + TOO_MANY_REQUESTS: 429 } ; @@ -35,10 +36,11 @@ angular.module('cesium.http.services', ['cesium.cache.services']) function processError(reject, data, url, status, config, startTime) { // Detected timeout error + var urlWithParenthesis = + (url ? ' ('+url+')' : ''); var reachTimeout = status === -1 && (config && config.timeout > 0 && startTime > 0) && (Date.now() - startTime) >= config.timeout; if (reachTimeout) { console.error('[http] Request timeout on [{0}] after waiting {1}ms'.format(url, config.timeout)); - $translate('ERROR.TIMEOUT_REACHED', {timeout: config.timeout, url: url || '?'}) + $translate('ERROR.TIMEOUT_REACHED', {timeout: config.timeout, url: url || ''}) .then(function(message) { reject({ucode: errorCodes.TIMEOUT, message: message}); }) @@ -47,20 +49,30 @@ angular.module('cesium.http.services', ['cesium.cache.services']) reject({ucode: errorCodes.TIMEOUT, message: 'Request timeout ({0})'.format(url)}); }); } - else if (data && data.message) { reject(data); } else { - if (status == errorCodes.FORBIDDEN) { - reject({ucode: errorCodes.FORBIDDEN, message: 'Resource is forbidden' + (url ? ' ('+url+')' : '')}); + if (status === errorCodes.FORBIDDEN) { + reject({ucode: errorCodes.FORBIDDEN, message: 'Resource is forbidden' + urlWithParenthesis}); + } + else if (status === errorCodes.NOT_FOUND) { + reject({ucode: errorCodes.NOT_FOUND, message: 'Resource not found' + urlWithParenthesis}); } - else if (status == errorCodes.NOT_FOUND) { - reject({ucode: errorCodes.NOT_FOUND, message: 'Resource not found' + (url ? ' ('+url+')' : '')}); + else if (status === errorCodes.TOO_MANY_REQUESTS) { + console.error('[http] Too many request' + urlWithParenthesis); + $translate('ERROR.TOO_MANY_REQUESTS', {url: url || ''}) + .then(function(message) { + reject({ucode: errorCodes.TOO_MANY_REQUESTS, message: message}); + }) + .catch(function() { + // No translation: use hardcoded message + reject({ucode: errorCodes.TOO_MANY_REQUESTS, message: 'Too many requests' + urlWithParenthesis}); + }); } else if (url) { - console.error('[http] Get HTTP error {status: {0}} on [{1}]'.format(status, url)); - reject('Error while requesting [{0}}'.format(url)); + console.error('[http] Get HTTP error {status: {0}}'.format(status) + urlWithParenthesis); + reject('Error while requesting network' + urlWithParenthesis); } else { reject('Unknown HTTP error'); diff --git a/www/plugins/es/js/controllers/admin-controllers.js b/www/plugins/es/js/controllers/admin-controllers.js index 2c50e9e6ccb1624059cf42aaf841d9ca7535aa96..02e6756fdc124805bfaad52054c86541a71221f7 100644 --- a/www/plugins/es/js/controllers/admin-controllers.js +++ b/www/plugins/es/js/controllers/admin-controllers.js @@ -125,10 +125,12 @@ function ESAdminViewLogController($scope, $q, $window, $state, UIUtils, csWot, e $scope.search.fetchMore = items && items.length === options.size; // Set Motion - $scope.motion.show({ - selector: '.item', - ink: false - }); + if (items.length) { + $scope.motion.show({ + selector: '.item', + ink: false + }); + } }) .catch(UIUtils.onError("ADMIN.ERROR.LOAD_LOG_FAILED")); };