Added auto-refresh ts3user every 60s
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
Phil 2024-10-28 13:12:02 +01:00
parent 2b3ecbe35a
commit 830d028de4
Signed by: Phil
GPG key ID: 350C8B7C4EF5DED4

View file

@ -28,6 +28,7 @@ import axios from 'axios'
<script>
import axios from 'axios'
export default {
data() {
return {
@ -35,16 +36,27 @@ import axios from 'axios'
}
},
mounted() {
axios
.get('https://fastdl.hackmi.ch/ts3users/users.info')
.then(response => {
this.info = response.data;
})
.catch(error => {
console.log(error);
this.errored = true
})
.finally(() => this.loading = false)
this.fetchUsers()
this.intervalfetchUsers()
},
methods: {
fetchUsers() {
axios
.get('https://fastdl.hackmi.ch/ts3users/users.info')
.then(response => {
this.info = response.data;
})
.catch(error => {
console.log(error);
this.errored = true
})
.finally(() => this.loading = false)
},
intervalfetchUsers() {
setInterval(() => {
this.fetchUsers();
}, 60000);
}
}
}
</script>