ProxiesSUDP.vue 607 B

123456789101112131415161718192021222324252627
  1. <template>
  2. <ProxyView :proxies="proxies" proxyType="sudp" @refresh="fetchData"/>
  3. </template>
  4. <script setup lang="ts">
  5. import { ref } from 'vue'
  6. import { SUDPProxy } from '../utils/proxy.js'
  7. import ProxyView from './ProxyView.vue'
  8. let proxies = ref<SUDPProxy[]>([])
  9. const fetchData = () => {
  10. fetch('../api/proxy/sudp', { credentials: 'include' })
  11. .then((res) => {
  12. return res.json()
  13. })
  14. .then((json) => {
  15. proxies.value = []
  16. for (let proxyStats of json.proxies) {
  17. proxies.value.push(new SUDPProxy(proxyStats))
  18. }
  19. })
  20. }
  21. fetchData()
  22. </script>
  23. <style></style>