2017-03-27 02:15:31 +08:00
|
|
|
<template>
|
2023-02-16 02:45:48 +08:00
|
|
|
<ProxyView :proxies="proxies" proxyType="https" />
|
2017-03-27 02:15:31 +08:00
|
|
|
</template>
|
|
|
|
|
2023-02-16 02:45:48 +08:00
|
|
|
<script setup lang="ts">
|
|
|
|
import { ref } from 'vue'
|
|
|
|
import { HTTPSProxy } from '../utils/proxy.js'
|
|
|
|
import ProxyView from './ProxyView.vue'
|
|
|
|
|
|
|
|
let proxies = ref<HTTPSProxy[]>([])
|
|
|
|
|
|
|
|
const fetchData = () => {
|
2023-10-11 15:01:07 +08:00
|
|
|
let vhostHTTPSPort: number
|
|
|
|
let subdomainHost: string
|
2023-02-16 02:45:48 +08:00
|
|
|
fetch('../api/serverinfo', { credentials: 'include' })
|
|
|
|
.then((res) => {
|
|
|
|
return res.json()
|
|
|
|
})
|
|
|
|
.then((json) => {
|
2023-10-11 15:01:07 +08:00
|
|
|
vhostHTTPSPort = json.vhostHTTPSPort
|
|
|
|
subdomainHost = json.subdomainHost
|
|
|
|
if (vhostHTTPSPort == null || vhostHTTPSPort == 0) {
|
2023-02-16 02:45:48 +08:00
|
|
|
return
|
2017-03-27 02:15:31 +08:00
|
|
|
}
|
2023-02-16 02:45:48 +08:00
|
|
|
fetch('../api/proxy/https', { credentials: 'include' })
|
|
|
|
.then((res) => {
|
|
|
|
return res.json()
|
|
|
|
})
|
|
|
|
.then((json) => {
|
|
|
|
for (let proxyStats of json.proxies) {
|
|
|
|
proxies.value.push(
|
2023-10-11 15:01:07 +08:00
|
|
|
new HTTPSProxy(proxyStats, vhostHTTPSPort, subdomainHost)
|
2023-02-16 02:45:48 +08:00
|
|
|
)
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
fetchData()
|
2017-03-27 02:15:31 +08:00
|
|
|
</script>
|
2021-01-25 16:04:33 +08:00
|
|
|
|
2023-02-16 02:45:48 +08:00
|
|
|
<style></style>
|