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>
|
<script>
|
||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
@ -35,6 +36,11 @@ import axios from 'axios'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
this.fetchUsers()
|
||||||
|
this.intervalfetchUsers()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
fetchUsers() {
|
||||||
axios
|
axios
|
||||||
.get('https://fastdl.hackmi.ch/ts3users/users.info')
|
.get('https://fastdl.hackmi.ch/ts3users/users.info')
|
||||||
.then(response => {
|
.then(response => {
|
||||||
|
@ -45,6 +51,12 @@ import axios from 'axios'
|
||||||
this.errored = true
|
this.errored = true
|
||||||
})
|
})
|
||||||
.finally(() => this.loading = false)
|
.finally(() => this.loading = false)
|
||||||
|
},
|
||||||
|
intervalfetchUsers() {
|
||||||
|
setInterval(() => {
|
||||||
|
this.fetchUsers();
|
||||||
|
}, 60000);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
Loading…
Reference in a new issue