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

@@ -1,5 +1,5 @@
<template>
<div :id="proxy_name" style="width: 600px; height: 400px"></div>
<div :id="proxyName" style="width: 600px; height: 400px"></div>
</template>
<script setup lang="ts">
@@ -7,17 +7,17 @@ import { ElMessage } from 'element-plus'
import { DrawProxyTrafficChart } from '../utils/chart.js'
const props = defineProps<{
proxy_name: string
proxyName: string
}>()
const fetchData = () => {
let url = '../api/traffic/' + props.proxy_name
let url = '../api/traffic/' + props.proxyName
fetch(url, { credentials: 'include' })
.then((res) => {
return res.json()
})
.then((json) => {
DrawProxyTrafficChart(props.proxy_name, json.traffic_in, json.traffic_out)
DrawProxyTrafficChart(props.proxyName, json.trafficIn, json.trafficOut)
})
.catch((err) => {
ElMessage({