Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function updateStats() {
- $.ajax({
- url: '/api/stats',
- type: 'post',
- success: r => {
- if(r.success) {
- $('.all').text(r.data.all);
- $('.http').text(r.data.http);
- $('.https').text(r.data.https);
- $('.socks4').text(r.data.socks4);
- $('.socks5').text(r.data.socks5);
- return setTimeout(updateStats, 3000);
- }
- console.warn('Что-то пошло не так при обновлении статистики!');
- setTimeout(updateStats, 3000);
- },
- error: e => {
- console.error('Ошибка при обновлении статистики!');
- setTimeout(updateStats, 3000);
- }
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement