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