修复首页未获取到zlm消息时发送错误消息的bug
parent
e05d0aa0a9
commit
2a5c12746b
|
@ -324,7 +324,7 @@ export default {
|
||||||
*/
|
*/
|
||||||
getThreadsLoad: function () {
|
getThreadsLoad: function () {
|
||||||
let that = this;
|
let that = this;
|
||||||
if (that.mediaServerChoose != null) {
|
if (!!that.mediaServerChoose) {
|
||||||
this.$axios({
|
this.$axios({
|
||||||
method: 'get',
|
method: 'get',
|
||||||
url: '/zlm/' + that.mediaServerChoose + '/index/api/getThreadsLoad'
|
url: '/zlm/' + that.mediaServerChoose + '/index/api/getThreadsLoad'
|
||||||
|
@ -375,7 +375,7 @@ export default {
|
||||||
},
|
},
|
||||||
getLoadCount: function () {
|
getLoadCount: function () {
|
||||||
let that = this;
|
let that = this;
|
||||||
if (that.mediaServerChoose != null) {
|
if (!!that.mediaServerChoose) {
|
||||||
that.mediaServer.getMediaServer(that.mediaServerChoose, (data) => {
|
that.mediaServer.getMediaServer(that.mediaServerChoose, (data) => {
|
||||||
if (data.code == 0) {
|
if (data.code == 0) {
|
||||||
that.loadCount = data.data.count
|
that.loadCount = data.data.count
|
||||||
|
@ -473,42 +473,46 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
getAllSession: function () {
|
getAllSession: function () {
|
||||||
let that = this;
|
this.allSessionData = [];
|
||||||
that.allSessionData = [];
|
if (!!this.mediaServerChoose) {
|
||||||
this.$axios({
|
this.$axios({
|
||||||
method: 'get',
|
method: 'get',
|
||||||
url: '/zlm/' + that.mediaServerChoose + '/index/api/getAllSession'
|
url: '/zlm/' + this.mediaServerChoose + '/index/api/getAllSession'
|
||||||
}).then(function (res) {
|
}).then((res)=> {
|
||||||
res.data.data.forEach(item => {
|
res.data.data.forEach(item => {
|
||||||
let data = {
|
let data = {
|
||||||
peer_ip: item.peer_ip,
|
peer_ip: item.peer_ip,
|
||||||
local_ip: item.local_ip,
|
local_ip: item.local_ip,
|
||||||
typeid: item.typeid,
|
typeid: item.typeid,
|
||||||
id: item.id
|
id: item.id
|
||||||
};
|
};
|
||||||
that.allSessionData.push(data);
|
this.allSessionData.push(data);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
getServerConfig: function () {
|
getServerConfig: function () {
|
||||||
let that = this;
|
if (!!this.mediaServerChoose) {
|
||||||
this.$axios({
|
this.$axios({
|
||||||
method: 'get',
|
method: 'get',
|
||||||
url: '/zlm/' + that.mediaServerChoose + '/index/api/getServerConfig'
|
url: '/zlm/' + that.mediaServerChoose + '/index/api/getServerConfig'
|
||||||
}).then(function (res) {
|
}).then((res)=> {
|
||||||
let info = res.data.data[0];
|
let info = res.data.data[0];
|
||||||
let serverInfo = {}
|
let serverInfo = {}
|
||||||
for (let i = 0; i < Object.keys(info).length; i++) {
|
for (let i = 0; i < Object.keys(info).length; i++) {
|
||||||
let key = Object.keys(info)[i];
|
let key = Object.keys(info)[i];
|
||||||
let group = key.substring(0, key.indexOf("."))
|
let group = key.substring(0, key.indexOf("."))
|
||||||
let itemKey = key.substring(key.indexOf(".") + 1)
|
let itemKey = key.substring(key.indexOf(".") + 1)
|
||||||
if (!serverInfo[group]) serverInfo[group] = {}
|
if (!serverInfo[group]) serverInfo[group] = {}
|
||||||
serverInfo[group][itemKey] = info[key]
|
serverInfo[group][itemKey] = info[key]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.serverConfig = serverInfo;
|
||||||
|
this.visible = true;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
that.serverConfig = serverInfo;
|
|
||||||
that.visible = true;
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
getWVPServerConfig: function () {
|
getWVPServerConfig: function () {
|
||||||
let that = this;
|
let that = this;
|
||||||
|
@ -531,6 +535,14 @@ export default {
|
||||||
},
|
},
|
||||||
reStartServer: function () {
|
reStartServer: function () {
|
||||||
let that = this;
|
let that = this;
|
||||||
|
if (!!!this.mediaServerChoose) {
|
||||||
|
this.$message({
|
||||||
|
type: 'info',
|
||||||
|
message: '未选择节点'
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
this.$confirm('此操作将重启媒体服务器, 是否继续?', '提示', {
|
this.$confirm('此操作将重启媒体服务器, 是否继续?', '提示', {
|
||||||
confirmButtonText: '确定',
|
confirmButtonText: '确定',
|
||||||
cancelButtonText: '取消',
|
cancelButtonText: '取消',
|
||||||
|
@ -571,17 +583,19 @@ export default {
|
||||||
console.log(JSON.stringify(tabledata[index]));
|
console.log(JSON.stringify(tabledata[index]));
|
||||||
},
|
},
|
||||||
deleteSession: function (id) {
|
deleteSession: function (id) {
|
||||||
let that = this;
|
if (!!this.mediaServerChoose) {
|
||||||
this.$axios({
|
this.$axios({
|
||||||
method: 'get',
|
method: 'get',
|
||||||
url: '/zlm/' + that.mediaServerChoose + '/index/api/kick_session?id=' + id
|
url: '/zlm/' + this.mediaServerChoose + '/index/api/kick_session?id=' + id
|
||||||
}).then(function (res) {
|
}).then((res)=>{
|
||||||
that.getAllSession();
|
this.getAllSession();
|
||||||
that.$message({
|
this.$message({
|
||||||
type: 'success',
|
type: 'success',
|
||||||
message: '删除成功!'
|
message: '删除成功!'
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
getNameFromKey: function (key) {
|
getNameFromKey: function (key) {
|
||||||
let nameData = {
|
let nameData = {
|
||||||
|
|
Loading…
Reference in New Issue