From 2d2832dbe98967a661323dd0a3fdc1607106b983 Mon Sep 17 00:00:00 2001
From: 648540858 <648540858@qq.com>
Date: 星期三, 22 二月 2023 18:01:30 +0800
Subject: [PATCH] 优化各个配置启动顺序
---
web_src/src/components/console.vue | 21 ++++++++++++---------
1 files changed, 12 insertions(+), 9 deletions(-)
diff --git a/web_src/src/components/console.vue b/web_src/src/components/console.vue
index 6e2dd83..2f5bb55 100644
--- a/web_src/src/components/console.vue
+++ b/web_src/src/components/console.vue
@@ -101,17 +101,20 @@
window.clearTimeout(this.timer);
}
this.timer = setTimeout(()=>{
- this.getSystemInfo();
- this.getLoad();
- this.timer = null;
- this.loopForSystemInfo()
- this.getResourceInfo()
+ if (this.$route.path === "/console") {
+ this.getSystemInfo();
+ this.getLoad();
+ this.timer = null;
+ this.loopForSystemInfo()
+ this.getResourceInfo()
+ }
+
}, 2000)
},
getSystemInfo: function (){
this.$axios({
method: 'get',
- url: `/api/server/system/info`,
+ url: `./api/server/system/info`,
}).then( (res)=> {
if (res.data.code === 0) {
this.$refs.consoleCPU.setData(res.data.data.cpu)
@@ -125,7 +128,7 @@
getLoad: function (){
this.$axios({
method: 'get',
- url: `/api/server/media_server/load`,
+ url: `./api/server/media_server/load`,
}).then( (res)=> {
if (res.data.code === 0) {
this.$refs.consoleNodeLoad.setData(res.data.data)
@@ -136,7 +139,7 @@
getResourceInfo: function (){
this.$axios({
method: 'get',
- url: `/api/server/resource/info`,
+ url: `./api/server/resource/info`,
}).then( (res)=> {
if (res.data.code === 0) {
this.$refs.consoleResource.setData(res.data.data)
@@ -148,7 +151,7 @@
this.$axios({
method: 'get',
- url: `/api/server/system/configInfo`,
+ url: `./api/server/system/configInfo`,
}).then( (res)=> {
console.log(res)
if (res.data.code === 0) {
--
Gitblit v1.8.0