From 6e90050db47ca1d9ecec3de6bd95ea1bd1ca4060 Mon Sep 17 00:00:00 2001
From: 648540858 <648540858@qq.com>
Date: 星期一, 29 八月 2022 11:50:36 +0800
Subject: [PATCH] 去除zlm使用redis过期作为心跳超时的方式
---
web_src/src/components/StreamProxyList.vue | 25 +++++++++++++++----------
1 files changed, 15 insertions(+), 10 deletions(-)
diff --git a/web_src/src/components/StreamProxyList.vue b/web_src/src/components/StreamProxyList.vue
index 9f7ed61..99b2226 100644
--- a/web_src/src/components/StreamProxyList.vue
+++ b/web_src/src/components/StreamProxyList.vue
@@ -87,7 +87,7 @@
<el-divider direction="vertical"></el-divider>
<el-button size="medium" icon="el-icon-switch-button" type="text" v-if="scope.row.enable" @click="stop(scope.row)">鍋滅敤</el-button>
<el-divider direction="vertical"></el-divider>
- <el-button size="medium" icon="el-icon-check" type="text" :loading="startBtnLaoding" v-if="!scope.row.enable" @click="start(scope.row)">鍚敤</el-button>
+ <el-button size="medium" icon="el-icon-check" type="text" :loading="scope.row.startBtnLoading" v-if="!scope.row.enable" @click="start(scope.row)">鍚敤</el-button>
<el-divider v-if="!scope.row.enable" direction="vertical"></el-divider>
<el-button size="medium" icon="el-icon-delete" type="text" style="color: #f56c6c" @click="deleteStreamProxy(scope.row)">鍒犻櫎</el-button>
</template>
@@ -132,7 +132,7 @@
count:15,
total:0,
getListLoading: false,
- startBtnLaoding: false
+ startBtnLoading: false
};
},
computed: {
@@ -168,9 +168,14 @@
count: that.count
}
}).then(function (res) {
- that.total = res.data.total;
- that.streamProxyList = res.data.list;
- that.getListLoading = false;
+ if (res.data.code === 0) {
+ that.total = res.data.data.total;
+ for (let i = 0; i < res.data.data.list.length; i++) {
+ res.data.data.list[i]["startBtnLoading"] = false;
+ }
+ that.streamProxyList = res.data.data.list;
+ }
+ that.getListLoading = false;
}).catch(function (error) {
console.log(error);
that.getListLoading = false;
@@ -187,7 +192,7 @@
url:`/api/onvif/search?timeout=3000`,
}).then((res) =>{
this.getListLoading = false;
- if (res.data.code == 0 ){
+ if (res.data.code === 0 ){
if (res.data.data.length > 0) {
this.$refs.onvifEdit.openDialog(res.data.data, (url)=>{
if (url != null) {
@@ -263,7 +268,7 @@
start: function(row){
let that = this;
this.getListLoading = true;
- this.startBtnLaoding = true;
+ this.$set(row, 'startBtnLoading', true)
this.$axios({
method: 'get',
url:`/api/proxy/start`,
@@ -273,8 +278,8 @@
}
}).then(function (res) {
that.getListLoading = false;
- that.startBtnLaoding = false;
- if (res.data == "success"){
+ that.$set(row, 'startBtnLoading', false)
+ if (res.data.code === 0){
that.initData()
}else {
that.$message({
@@ -287,7 +292,7 @@
}).catch(function (error) {
console.log(error);
that.getListLoading = false;
- that.startBtnLaoding = false;
+ that.$set(row, 'startBtnLoading', false)
});
},
stop: function(row){
--
Gitblit v1.8.0