From a19d10e17b289c35ed08203fd63735bcec96cae8 Mon Sep 17 00:00:00 2001
From: whycq <10027870+whycq@user.noreply.gitee.com>
Date: 星期二, 23 七月 2024 18:50:07 +0800
Subject: [PATCH] #
---
Monitor-APP/pages/home/home.vue | 40 ++++++++++++++++++++++++++++++----------
1 files changed, 30 insertions(+), 10 deletions(-)
diff --git a/Monitor-APP/pages/home/home.vue b/Monitor-APP/pages/home/home.vue
index 43ff67d..de5d0d0 100644
--- a/Monitor-APP/pages/home/home.vue
+++ b/Monitor-APP/pages/home/home.vue
@@ -391,7 +391,8 @@
swiperList: [],
timeOut: false,
times: 0,
- currDate: ''
+ currDate: '',
+ socketInfo2: ''
}
},
onShow() {
@@ -415,25 +416,44 @@
// this.getUrl()
},
onLoad() {
+ this.ws()
setInterval(()=>{
- this.getServerData()
- this.initlineChart()
- this.initPieChart()
- this.getOther()
+ // this.getServerData()
+ // this.initlineChart()
+ // this.initPieChart()
+ // this.getOther()
// this.getDate()
- this.getDate2()
+ // this.getDate2()
this.getInfo()
- this.getError()
+ // this.getError()
// this.getInfo2()
// this.getError2()
- this.getUrl()
- this.controller()
+ // this.getUrl()
+ // this.controller()
+
// 娴嬭瘯鐢�
},1000)
+
},
methods: {
- timeOut() {
+ ws() {
+ let _this = this
+ _this.connectWS()
+ uni.onSocketOpen(function (res) {
+ console.log("Open");
+ })
+ uni.onSocketClose(function (res) {
+ console.log("Close");
+ setInterval(()=>{
+ _this.connectWS()
+ },1000)
+ })
+ },
+ connectWS() {
+ uni.connectSocket({ url: `http://127.0.0.1:9090/pswcs/console/websocket`, })
+ },
+ timeOut1() {
console.log(this.times);
},
getUrl() {
--
Gitblit v1.9.1