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<HTTPProxy[]>([])
const fetchData = () => {
let vhost_http_port: number
let subdomain_host: string
let vhostHTTPPort: number
let subdomainHost: string
fetch('../api/serverinfo', { credentials: 'include' })
.then((res) => {
return res.json()
})
.then((json) => {
vhost_http_port = json.vhost_http_port
subdomain_host = json.subdomain_host
if (vhost_http_port == null || vhost_http_port == 0) {
vhostHTTPPort = json.vhostHTTPPort
subdomainHost = json.subdomainHost
if (vhostHTTPPort == null || vhostHTTPPort == 0) {
return
}
fetch('../api/proxy/http', { credentials: 'include' })
@@ -29,7 +29,7 @@ const fetchData = () => {
.then((json) => {
for (let proxyStats of json.proxies) {
proxies.value.push(
new HTTPProxy(proxyStats, vhost_http_port, subdomain_host)
new HTTPProxy(proxyStats, vhostHTTPPort, subdomainHost)
)
}
})