summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/pages/instance_statistics/cohorts/usage_ping.js
blob: 914a9661c27e9cb99b0aadc90e2faf215e299c01 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
import axios from '../../../lib/utils/axios_utils';
import { __ } from '../../../locale';
import flash from '../../../flash';

export default function UsagePing() {
  const el = document.querySelector('.usage-data');

  axios.get(el.dataset.endpoint, {
    responseType: 'text',
  }).then(({ data }) => {
    el.innerHTML = data;
  }).catch(() => flash(__('Error fetching usage ping data.')));
}