未验证 提交 43f1088f 编写于 作者: P Phil Hughes

Converted usage_ping.js to use axios

also removed dependancy on jQuery because it is super simple & not required
上级 ee1c471b
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.')));
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册