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

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2018-02-01 14:18:01 +0300
committerPhil Hughes <me@iamphill.com>2018-02-01 14:18:01 +0300
commit43f1088f5b086b95a3d5cdd90a33d26bb483cba5 (patch)
tree93d503d6f317a0aae0b8d557315db1883f7369ce /app/assets/javascripts/pages/admin/cohorts
parentee1c471bad95cb640ea63393954825dd5a68a9e2 (diff)
Converted usage_ping.js to use axios
also removed dependancy on jQuery because it is super simple & not required
Diffstat (limited to 'app/assets/javascripts/pages/admin/cohorts')
-rw-r--r--app/assets/javascripts/pages/admin/cohorts/usage_ping.js19
1 files changed, 10 insertions, 9 deletions
diff --git a/app/assets/javascripts/pages/admin/cohorts/usage_ping.js b/app/assets/javascripts/pages/admin/cohorts/usage_ping.js
index 2389056bd02..914a9661c27 100644
--- a/app/assets/javascripts/pages/admin/cohorts/usage_ping.js
+++ b/app/assets/javascripts/pages/admin/cohorts/usage_ping.js
@@ -1,12 +1,13 @@
+import axios from '../../../lib/utils/axios_utils';
+import { __ } from '../../../locale';
+import flash from '../../../flash';
+
export default function UsagePing() {
- const usageDataUrl = $('.usage-data').data('endpoint');
+ const el = document.querySelector('.usage-data');
- $.ajax({
- type: 'GET',
- url: usageDataUrl,
- dataType: 'html',
- success(html) {
- $('.usage-data').html(html);
- },
- });
+ axios.get(el.dataset.endpoint, {
+ responseType: 'text',
+ }).then(({ data }) => {
+ el.innerHTML = data;
+ }).catch(() => flash(__('Error fetching usage ping data.')));
}