generated from Phil/vue3template
Added auto-refresh ts3user every 60s
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
parent
2b3ecbe35a
commit
830d028de4
1 changed files with 22 additions and 10 deletions
|
@ -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>
|
Loading…
Reference in a new issue