Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Zhang <peter@innocraft.com>2022-07-20 03:40:38 +0300
committerGitHub <noreply@github.com>2022-07-20 03:40:38 +0300
commit0eeb042955f7110ba484333dad71ec174d2d1420 (patch)
tree1f9d20ef6ab607c9b295e4ef50eaf22687a1d6f8 /plugins/Dashboard
parent7c8227bb111af98f766fc48c2f6141b1115c41ab (diff)
Add 429 response Code UI (#19433)
* add template add template * Update AjaxHelper.ts update error code * add widget rate limit loader add widget rate limit loader * built vue files * built vue files * remove file remove file * update wording update wording * built vue files * Update WidgetLoader.vue remove console * built vue files * Update lang/en.json * built vue files * Update plugins/CoreHome/vue/src/AjaxHelper/AjaxHelper.ts Co-authored-by: Ben Burgess <88810029+bx80@users.noreply.github.com> * update text and rate limit update text and rate limit * built vue files * Update en.json remove api docs for now * built vue files Co-authored-by: peterhashair <peterhashair@users.noreply.github.com> Co-authored-by: Ben Burgess <88810029+bx80@users.noreply.github.com>
Diffstat (limited to 'plugins/Dashboard')
-rw-r--r--plugins/Dashboard/javascripts/dashboardWidget.js19
1 files changed, 16 insertions, 3 deletions
diff --git a/plugins/Dashboard/javascripts/dashboardWidget.js b/plugins/Dashboard/javascripts/dashboardWidget.js
index adf2247bc7..476d1235ee 100644
--- a/plugins/Dashboard/javascripts/dashboardWidget.js
+++ b/plugins/Dashboard/javascripts/dashboardWidget.js
@@ -174,10 +174,23 @@
return;
}
+ var errorMessage;
$('.widgetContent', currentWidget).removeClass('loading');
- var errorMessage = _pk_translate('General_ErrorRequest', ['', '']);
- if ($('#loadingError').html()) {
- errorMessage = $('#loadingError').html();
+
+
+ if (deferred.status === 429) {
+ errorMessage = `<div class="alert alert-danger">${_pk_translate('General_ErrorRateLimit')}>',
+ '</a>'])}</div>`;
+
+ if($('#loadingRateLimitError').html()) {
+ errorMessage = $('#loadingRateLimitError')
+ .html();
+ }
+ } else {
+ var errorMessage = _pk_translate('General_ErrorRequest', ['', '']);
+ if ($('#loadingError').html()) {
+ errorMessage = $('#loadingError').html();
+ }
}
$('.widgetContent', currentWidget).html('<div class="widgetLoadingError">' + errorMessage + '</div>');