fix broken server api and dashboard info (#3662)

This commit is contained in:
fatedier
2023-10-11 15:01:07 +08:00
committed by GitHub
parent 7cc67e852e
commit df12cc2b9d
14 changed files with 223 additions and 224 deletions

View File

@@ -10,16 +10,16 @@ import ProxyView from './ProxyView.vue'
let proxies = ref<HTTPSProxy[]>([])
const fetchData = () => {
let vhost_https_port: number
let subdomain_host: string
let vhostHTTPSPort: number
let subdomainHost: string
fetch('../api/serverinfo', { credentials: 'include' })
.then((res) => {
return res.json()
})
.then((json) => {
vhost_https_port = json.vhost_https_port
subdomain_host = json.subdomain_host
if (vhost_https_port == null || vhost_https_port == 0) {
vhostHTTPSPort = json.vhostHTTPSPort
subdomainHost = json.subdomainHost
if (vhostHTTPSPort == null || vhostHTTPSPort == 0) {
return
}
fetch('../api/proxy/https', { credentials: 'include' })
@@ -29,7 +29,7 @@ const fetchData = () => {
.then((json) => {
for (let proxyStats of json.proxies) {
proxies.value.push(
new HTTPSProxy(proxyStats, vhost_https_port, subdomain_host)
new HTTPSProxy(proxyStats, vhostHTTPSPort, subdomainHost)
)
}
})