Merge branch 'wvp-28181-2.0'

# Conflicts:
#	src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/ISIPCommander.java
#	src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommander.java
#	src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommanderFroPlatform.java
#	src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/SIPRequestProcessorParent.java
#	src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/AckRequestProcessor.java
#	src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/ByeRequestProcessor.java
#	src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/InviteRequestProcessor.java
#	src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/RegisterRequestProcessor.java
#	src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/SubscribeRequestProcessor.java
#	src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/response/cmd/BroadcastResponseMessageHandler.java
#	src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMHttpHookListener.java
#	src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMRTPServerFactory.java
#	src/main/java/com/genersoft/iot/vmp/media/zlm/dto/HookSubscribeFactory.java
#	src/main/java/com/genersoft/iot/vmp/service/IMediaServerService.java
#	src/main/java/com/genersoft/iot/vmp/service/impl/MediaServerServiceImpl.java
#	src/main/java/com/genersoft/iot/vmp/service/impl/MediaServiceImpl.java
#	src/main/java/com/genersoft/iot/vmp/service/impl/PlayServiceImpl.java
#	src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/play/PlayController.java
#	web_src/src/components/dialog/devicePlayer.vue
This commit is contained in:
648540858
2022-11-18 18:39:44 +08:00
189 changed files with 19462 additions and 3340 deletions

View File

@@ -109,15 +109,26 @@
that.mediaServerList = data.data;
if (that.mediaServerList.length > 0) {
that.mediaServerId = that.mediaServerList[0].id
let port = that.mediaServerList[0].httpPort;
if (location.protocol === "https:" && that.mediaServerList[0].httpSSlPort) {
port = that.mediaServerList[0].httpSSlPort
}
that.mediaServerPath = location.protocol + "//" + that.mediaServerList[0].streamIp + ":" + port
that.setMediaServerPath(that.mediaServerId);
that.getRecordList();
}
})
},
setMediaServerPath: function (serverId) {
let that = this;
let i;
for (i = 0; i < that.mediaServerList.length; i++) {
if (serverId === that.mediaServerList[i].id) {
break;
}
}
let port = that.mediaServerList[i].httpPort;
if (location.protocol === "https:" && that.mediaServerList[i].httpSSlPort) {
port = that.mediaServerList[i].httpSSlPort
}
that.mediaServerPath = location.protocol + "//" + that.mediaServerList[i].streamIp + ":" + port
console.log(that.mediaServerPath)
},
getRecordList: function (){
let that = this;
this.$axios({
@@ -146,6 +157,7 @@
console.log(val)
this.total = 0;
this.recordList = [];
this.setMediaServerPath(val);
this.getRecordList();
},
showRecordDetail(row){

View File

@@ -3,6 +3,8 @@
<div class="page-header">
<div class="page-title">设备列表</div>
<div class="page-header-btn">
<el-button icon="el-icon-plus" size="mini" style="margin-right: 1rem;" type="primary" @click="add">添加设备
</el-button>
<el-button icon="el-icon-refresh-right" circle size="mini" :loading="getDeviceListLoading"
@click="getDeviceList()"></el-button>
</div>
@@ -16,7 +18,8 @@
<el-table-column label="地址" min-width="160" >
<template slot-scope="scope">
<div slot="reference" class="name-wrapper">
<el-tag size="medium">{{ scope.row.hostAddress }}</el-tag>
<el-tag v-if="scope.row.hostAddress" size="medium">{{ scope.row.hostAddress }}</el-tag>
<el-tag v-if="!scope.row.hostAddress" size="medium">未知</el-tag>
</div>
</template>
</el-table-column>
@@ -164,7 +167,6 @@ export default {
console.error(error);
this.getDeviceListLoading = false;
});
},
deleteDevice: function (row) {
let msg = "确定删除此设备?"
@@ -254,21 +256,6 @@ export default {
})
return result;
},
//通知设备上传媒体流
sendDevicePush: function (itemData) {
// let deviceId = this.currentDevice.deviceId;
// let channelId = itemData.channelId;
// console.log("通知设备推流1" + deviceId + " : " + channelId);
// let that = this;
// this.$axios({
// method: 'get',
// url: '/api/play/' + deviceId + '/' + channelId
// }).then(function(res) {
// let ssrc = res.data.ssrc;
// that.$refs.devicePlayer.play(ssrc,deviceId,channelId);
// }).catch(function(e) {
// });
},
transportChange: function (row) {
console.log(`修改传输方式为 ${row.streamMode}${row.deviceId} `);
let that = this;
@@ -290,9 +277,22 @@ export default {
});
setTimeout(this.getDeviceList, 200)
})
},
add: function () {
this.$refs.deviceEdit.openDialog(null, () => {
this.$refs.deviceEdit.close();
this.$message({
showClose: true,
message: "添加成功",
type: "success",
});
setTimeout(this.getDeviceList, 200)
})
}
}
};
</script>

View File

@@ -0,0 +1,177 @@
<template>
<div id="app" style="width: 100%">
<div class="page-header">
<div class="page-title">控制台</div>
<div class="page-header-btn">
<el-button icon="el-icon-info" size="mini" style="margin-right: 1rem;" type="primary" @click="showInfo">平台信息
</el-button>
</div>
</div>
<el-row style="width: 100%">
<el-col :xl="{ span: 8 }" :lg="{ span: 8 }" :md="{ span: 12 }" :sm="{ span: 12 }" :xs="{ span: 24 }" >
<div class="control-cell" id="ThreadsLoad" >
<div style="width:100%; height:100%; ">
<consoleCPU ref="consoleCPU"></consoleCPU>
</div>
</div>
</el-col>
<el-col :xl="{ span: 8 }" :lg="{ span: 8 }" :md="{ span: 12 }" :sm="{ span: 12 }" :xs="{ span: 24 }" >
<div class="control-cell" id="WorkThreadsLoad" >
<div style="width:100%; height:100%; ">
<consoleResource ref="consoleResource"></consoleResource>
</div>
</div>
</el-col>
<el-col :xl="{ span: 8 }" :lg="{ span: 8 }" :md="{ span: 12 }" :sm="{ span: 12 }" :xs="{ span: 24 }" >
<div class="control-cell" id="WorkThreadsLoad" >
<div style="width:100%; height:100%; ">
<consoleNet ref="consoleNet"></consoleNet>
</div>
</div>
</el-col>
<el-col :xl="{ span: 8 }" :lg="{ span: 8 }" :md="{ span: 12 }" :sm="{ span: 12 }" :xs="{ span: 24 }" >
<div class="control-cell" id="WorkThreadsLoad" >
<div style="width:100%; height:100%; ">
<consoleMem ref="consoleMem"></consoleMem>
</div>
</div>
</el-col>
<el-col :xl="{ span: 8 }" :lg="{ span: 8 }" :md="{ span: 12 }" :sm="{ span: 12 }" :xs="{ span: 24 }" >
<div class="control-cell" id="WorkThreadsLoad" >
<div style="width:100%; height:100%; ">
<consoleNodeLoad ref="consoleNodeLoad"></consoleNodeLoad>
</div>
</div>
</el-col>
<el-col :xl="{ span: 8 }" :lg="{ span: 8 }" :md="{ span: 12 }" :sm="{ span: 12 }" :xs="{ span: 24 }" >
<div class="control-cell" id="WorkThreadsLoad" >
<div style="width:100%; height:100%; ">
<consoleDisk ref="consoleDisk"></consoleDisk>
</div>
</div>
</el-col>
</el-row>
<configInfo ref="configInfo"></configInfo>
</div>
</template>
<script>
import uiHeader from '../layout/UiHeader.vue'
import consoleCPU from './console/ConsoleCPU.vue'
import consoleMem from './console/ConsoleMEM.vue'
import consoleNet from './console/ConsoleNet.vue'
import consoleNodeLoad from './console/ConsoleNodeLoad.vue'
import consoleDisk from './console/ConsoleDisk.vue'
import consoleResource from './console/ConsoleResource.vue'
import configInfo from './dialog/configInfo.vue'
import echarts from 'echarts';
export default {
name: 'app',
components: {
echarts,
uiHeader,
consoleCPU,
consoleMem,
consoleNet,
consoleNodeLoad,
consoleDisk,
consoleResource,
configInfo,
},
data() {
return {
timer: null,
};
},
created() {
this.getSystemInfo();
this.getLoad();
this.getResourceInfo();
this.loopForSystemInfo();
},
destroyed() {
},
methods: {
loopForSystemInfo: function (){
if (this.timer != null) {
window.clearTimeout(this.timer);
}
this.timer = setTimeout(()=>{
this.getSystemInfo();
this.getLoad();
this.timer = null;
this.loopForSystemInfo()
this.getResourceInfo()
}, 2000)
},
getSystemInfo: function (){
this.$axios({
method: 'get',
url: `/api/server/system/info`,
}).then( (res)=> {
if (res.data.code === 0) {
this.$refs.consoleCPU.setData(res.data.data.cpu)
this.$refs.consoleMem.setData(res.data.data.mem)
this.$refs.consoleNet.setData(res.data.data.net, res.data.data.netTotal)
this.$refs.consoleDisk.setData(res.data.data.disk)
}
}).catch( (error)=> {
});
},
getLoad: function (){
this.$axios({
method: 'get',
url: `/api/server/media_server/load`,
}).then( (res)=> {
if (res.data.code === 0) {
this.$refs.consoleNodeLoad.setData(res.data.data)
}
}).catch( (error)=> {
});
},
getResourceInfo: function (){
this.$axios({
method: 'get',
url: `/api/server/resource/info`,
}).then( (res)=> {
if (res.data.code === 0) {
this.$refs.consoleResource.setData(res.data.data)
}
}).catch( (error)=> {
});
},
showInfo: function (){
this.$axios({
method: 'get',
url: `/api/server/system/configInfo`,
}).then( (res)=> {
console.log(res)
if (res.data.code === 0) {
console.log(2222)
console.log(this.$refs.configInfo)
this.$refs.configInfo.openDialog(res.data.data)
}
}).catch( (error)=> {
});
}
}
};
</script>
<style>
#app {
height: 100%;
}
.control-cell {
padding-top: 10px;
padding-left: 5px;
padding-right: 10px;
height: 360px;
}
</style>

View File

@@ -0,0 +1,109 @@
<template>
<div id="consoleCPU" style="width: 100%; height: 100%; background: #FFFFFF; text-align: center">
<ve-line ref="consoleCPU" :data="chartData" :extend="extend" width="100%" height="100%" :legend-visible="false"></ve-line>
</div>
</template>
<script>
import moment from "moment/moment";
export default {
name: 'consoleCPU',
data() {
return {
chartData: {
columns: ['time', 'data'],
rows: []
},
extend: {
title: {
show: true,
text: "CPU",
left: "center",
top: 20,
},
grid: {
show: true,
right: "30px",
containLabel: true,
},
xAxis: {
time: "time",
max: 'dataMax',
boundaryGap: ['20%', '20%'],
axisLabel: {
formatter:(v)=>{
return moment(v).format("HH:mm:ss");
},
showMaxLabel: true,
}
},
yAxis: {
type: 'value',
min: 0,
max: 1,
splitNumber: 6,
position: "left",
silent: true,
axisLabel: {
formatter: (v)=>{
return v*100 + "%";
},
}
},
tooltip: {
trigger: 'axis',
formatter: (data)=>{
console.log(data)
return moment(data[0].data[0]).format("HH:mm:ss") + "</br> "
+ data[0].marker + "使用:" + (data[0].data[1]*100).toFixed(2) + "%";
}
},
series: {
itemStyle: {
color: "#409EFF"
},
areaStyle: {
color: {
type: 'linear',
x: 0,
y: 0,
x2: 0,
y2: 1,
colorStops: [{
offset: 0, color: '#50a3f8' // 0% 处的颜色
}, {
offset: 1, color: '#69b0fa' // 100% 处的颜色
}],
global: false // 缺省为 false
}
}
}
}
};
},
created() {
},
mounted() {
this.$nextTick(_ => {
setTimeout(()=>{
this.$refs.consoleCPU.echarts.resize()
}, 100)
})
},
destroyed() {
},
methods: {
setData: function(data) {
this.chartData .rows = data;
}
}
};
</script>

View File

@@ -0,0 +1,81 @@
<template>
<div id="ConsoleNet" style="width: 100%; height: 100%; background: #FFFFFF; text-align: center">
<ve-bar ref="ConsoleNet" :data="chartData" :extend="extend" :settings="chartSettings" width="100%" height="100%" ></ve-bar>
</div>
</template>
<script>
import moment from "moment/moment";
export default {
name: 'ConsoleNet',
data() {
return {
chartData: {
columns: ['path','free','use'],
rows: []
},
chartSettings: {
stack: {
'xxx': ['free', 'use']
},
labelMap: {
'free': '剩余',
'use': '已使用'
},
},
extend: {
title: {
show: true,
text: "磁盘",
left: "center",
top: 20,
},
grid: {
show: true,
right: "30px",
containLabel: true,
},
series: {
barWidth: 30
},
legend: {
left: "center",
bottom: "15px",
},
tooltip: {
trigger: 'axis',
formatter: (data)=>{
console.log(data)
let relVal = "";
for (let i = 0; i < data.length; i++) {
relVal += data[i].marker + data[i].seriesName + ":" + data[i].value.toFixed(2) + "GB"
if (i < data.length - 1) {
relVal += "</br>";
}
}
return relVal;
}
},
}
};
},
mounted() {
this.$nextTick(_ => {
setTimeout(()=>{
this.$refs.ConsoleNet.echarts.resize()
}, 100)
})
},
destroyed() {
},
methods: {
setData: function(data) {
this.chartData.rows = data;
}
}
};
</script>

View File

@@ -0,0 +1,103 @@
<template>
<div id="ConsoleMEM" style="width: 100%; height: 100%; background: #FFFFFF; text-align: center">
<ve-line ref="ConsoleMEM" :data="chartData" :extend="extend" width="100%" height="100%" :legend-visible="false"></ve-line>
</div>
</template>
<script>
import moment from "moment/moment";
export default {
name: 'ConsoleMEM',
data() {
return {
chartData: {
columns: ['time', 'data'],
rows: []
},
extend: {
title: {
show: true,
text: "内存",
left: "center",
top: 20,
},
grid: {
show: true,
right: "30px",
containLabel: true,
},
xAxis: {
time: "time",
max: 'dataMax',
boundaryGap: ['20%', '20%'],
axisLabel: {
formatter:(v)=>{
return moment(v).format("HH:mm:ss");
},
showMaxLabel: true,
}
},
yAxis: {
type: 'value',
min: 0,
max: 1,
splitNumber: 6,
position: "left",
silent: true,
axisLabel: {
formatter: (v)=>{
return v*100 + "%";
},
}
},
tooltip: {
trigger: 'axis',
formatter: (data)=>{
console.log(data)
return moment(data[0].data[0]).format("HH:mm:ss") + "</br>"+ data[0].marker +" 使用:" + (data[0].data[1]*100).toFixed(2) + "%";
}
},
series: {
itemStyle: {
color: "#409EFF"
},
areaStyle: {
color: {
type: 'linear',
x: 0,
y: 0,
x2: 0,
y2: 1,
colorStops: [{
offset: 0, color: '#50a3f8' // 0% 处的颜色
}, {
offset: 1, color: '#69b0fa' // 100% 处的颜色
}],
global: false // 缺省为 false
}
}
}
}
};
},
mounted() {
this.$nextTick(_ => {
setTimeout(()=>{
this.$refs.ConsoleMEM.echarts.resize()
}, 100)
})
},
destroyed() {
},
methods: {
setData: function(data) {
this.chartData .rows = data;
}
}
};
</script>

View File

@@ -0,0 +1,85 @@
<template>
<div id="ConsoleMediaServer" style="width: 100%; height: 100%; background: #FFFFFF; text-align: center">
<ve-histogram ref="ConsoleMEM" :data="chartData" :extend="extend" :settings="chartSettings" width="100%" height="100%" ></ve-histogram>
</div>
</template>
<script>
import moment from "moment/moment";
export default {
name: 'ConsoleMediaServer',
data() {
return {
chartData: {
columns: ['time', 'in', 'out'],
rows: [
]
},
chartSettings: {
area: true,
labelMap: {
'in': '下载',
'out': '上传'
},
},
extend: {
title: {
show: true,
text: "网络",
left: "center",
top: 20,
},
grid: {
show: true,
right: "30px",
containLabel: true,
},
xAxis: {
time: "time",
max: 'dataMax',
boundaryGap: ['20%', '20%'],
axisLabel: {
formatter:(v)=>{
return moment(v).format("HH:mm:ss");
},
showMaxLabel: true,
},
},
tooltip: {
trigger: 'axis',
formatter: (data)=>{
console.log(parseFloat(data[0].data[1]).toFixed(2))
console.log(parseFloat(data[1].data[1]).toFixed(2))
console.log("############")
return "下载:" + parseFloat(data[0].data[1]).toFixed(2) + "Mbps" + "</br> 上传:" + parseFloat(data[1].data[1]).toFixed(2) + "Mbps";
}
},
legend: {
left: "center",
bottom: "15px",
}
}
};
},
mounted() {
this.$nextTick(_ => {
setTimeout(()=>{
this.$refs.ConsoleMEM.echarts.resize()
}, 100)
})
},
destroyed() {
},
methods: {
setData: function(data) {
console.log(data)
this.chartData .rows = data;
}
}
};
</script>

View File

@@ -0,0 +1,89 @@
<template>
<div id="ConsoleNet" style="width: 100%; height: 100%; background: #FFFFFF; text-align: center">
<ve-line ref="ConsoleNet" :data="chartData" :extend="extend" :settings="chartSettings" width="100%" height="100%" ></ve-line>
</div>
</template>
<script>
import moment from "moment/moment";
export default {
name: 'ConsoleNet',
data() {
return {
chartData: {
columns: ['time','out','in'],
rows: []
},
chartSettings: {
area: true,
labelMap: {
'in': '下载',
'out': '上传'
},
},
extend: {
title: {
show: true,
text: "网络",
left: "center",
top: 20,
},
grid: {
show: true,
right: "30px",
containLabel: true,
},
xAxis: {
time: "time",
max: 'dataMax',
boundaryGap: ['20%', '20%'],
axisLabel: {
formatter:(v)=>{
return moment(v).format("HH:mm:ss");
},
showMaxLabel: true,
},
},
yAxis: {
type: 'value',
min: 0,
max: 1000,
splitNumber: 6,
position: "left",
silent: true,
},
tooltip: {
trigger: 'axis',
formatter: (data)=>{
return data[1].marker + "下载:" + parseFloat(data[1].data[1]).toFixed(2) + "Mbps" + "</br> "+ data[0].marker +" 上传:" + parseFloat(data[0].data[1]).toFixed(2) + "Mbps";
}
},
legend: {
left: "center",
bottom: "15px",
}
}
};
},
mounted() {
this.$nextTick(_ => {
setTimeout(()=>{
this.$refs.ConsoleNet.echarts.resize()
}, 100)
})
},
destroyed() {
},
methods: {
setData: function(data, total) {
this.chartData .rows = data;
this.extend.yAxis.max= total;
}
}
};
</script>

View File

@@ -0,0 +1,63 @@
<template>
<div id="ConsoleNodeLoad" style="width: 100%; height: 100%; background: #FFFFFF; text-align: center">
<ve-histogram ref="consoleNodeLoad" :data="chartData" :extend="extend" :settings="chartSettings" width="100%" height="100%" :legend-visible="true"></ve-histogram>
</div>
</template>
<script>
import moment from "moment/moment";
export default {
name: 'ConsoleNodeLoad',
data() {
return {
chartData: {
columns: ['id', 'push', 'proxy', 'gbReceive', 'gbSend'],
rows: []
},
chartSettings: {
labelMap: {
'push': '直播推流',
'proxy': '拉流代理',
'gbReceive': '国标收流',
'gbSend': '国标推流',
},
},
extend: {
title: {
show: true,
text: "节点负载",
left: "center",
top: 20,
},
legend: {
left: "center",
bottom: "15px",
},
label: {
show: true,
position: "top"
}
}
};
},
mounted() {
this.$nextTick(_ => {
setTimeout(()=>{
this.$refs.consoleNodeLoad.echarts.resize()
}, 100)
})
},
destroyed() {
},
methods: {
setData: function(data) {
this.chartData .rows = data;
}
}
};
</script>

View File

@@ -0,0 +1,86 @@
<template >
<div id="consoleResource" style="width: 100%; height: 100%; background: #FFFFFF; text-align: center">
<div style="width: 50%;height: 50%; float:left; ">
<el-progress :width="100" :stroke-width="8" type="circle" :percentage="Math.floor(deviceInfo.online/deviceInfo.total*100)" style="margin-top: 20px; font-size: 18px"></el-progress>
<div class="resourceInfo">
设备总数:{{deviceInfo.total}}<br/>
在线数:{{deviceInfo.online}}
</div>
</div>
<div style="width: 50%;height: 50%; float:left; ">
<el-progress :width="100" :stroke-width="10" type="circle" :percentage="Math.floor(channelInfo.online/channelInfo.total*100)" style="margin-top: 20px"></el-progress>
<div class="resourceInfo">
通道总数:{{channelInfo.total}}<br/>
在线数:{{channelInfo.online}}
</div>
</div>
<div style="width: 50%;height: 50%; float:left; ">
<el-progress :width="100" :stroke-width="10" type="circle" :percentage="Math.floor(pushInfo.online/pushInfo.total*100)" style="margin-top: 20px"></el-progress>
<div class="resourceInfo">
推流总数:{{pushInfo.total}}<br/>
在线数:{{pushInfo.online}}
</div>
</div>
<div style="width: 50%;height: 50%; float:left; ">
<el-progress :width="100" :stroke-width="10" type="circle" :percentage="Math.floor(proxyInfo.online/proxyInfo.total*100)" style="margin-top: 20px"></el-progress>
<div class="resourceInfo">
拉流代理总数:{{proxyInfo.total}}<br/>
在线数:{{proxyInfo.online}}
</div>
</div>
</div>
</template>
<script>
export default {
name: 'consoleResource',
data() {
return {
deviceInfo: {
total: 0,
online: 0
},
channelInfo: {
total: 0,
online: 0
},
pushInfo: {
total: 0,
online: 0
},
proxyInfo: {
total: 0,
online: 0
},
};
},
created() {
},
mounted() {
},
destroyed() {
},
methods: {
setData: function(data) {
this.deviceInfo = data.device;
this.channelInfo = data.channel;
this.pushInfo = data.push;
this.proxyInfo = data.proxy;
}
}
};
</script>
<style>
.resourceInfo{
width: 100%;
text-align: center;
font-size: 12px
}
.el-progress__text {
font-size: 18px !important;
}
</style>

View File

@@ -1,714 +0,0 @@
<template>
<div id="app" style="width: 100%">
<div class="page-header">
<div class="page-title">控制台</div>
<div class="page-header-btn">
节点选择:
<el-select size="mini" @change="chooseMediaChange" style="width: 18rem; margin-right: 8rem;"
v-model="mediaServerChoose" placeholder="请选择" default-first-option>
<el-option
v-for="item in mediaServerList"
:key="item.id"
:label="item.id + '( ' + item.streamIp + ' )'"
:value="item.id">
</el-option>
</el-select>
<span>{{ loadCount }}</span>
</div>
<div class="page-header-btn">
<el-popover placement="bottom" width="900" height="300" trigger="click">
<div style="height: 600px; overflow:auto; padding: 20px">
<el-descriptions v-for="(value, key, index) in serverConfig" :key="key" border :column="1"
style="margin-bottom: 1rem">
<template slot="title">
{{ key }}
</template>
<el-descriptions-item v-for="(value1, key1, index1) in serverConfig[key]" :key="key1">
<template slot="label">
{{ getMediaKeyNameFromKey(key1) }}
</template>
{{ value1 }}
</el-descriptions-item>
</el-descriptions>
</div>
<el-button type="primary" slot="reference" size="mini" @click="getServerConfig()">媒体服务器配置</el-button>
</el-popover>
<el-popover placement="bottom" width="900" height="300" trigger="click">
<div style="height: 600px;overflow:auto; padding: 20px">
<el-descriptions title="国标配置" border :column="1">
<template slot="extra">
<el-button style="float: right;" type="primary" size="mini" icon="el-icon-document-copy" title="点击拷贝"
v-clipboard="JSON.stringify(wvpServerConfig.sip)|| ''"
@success="$message({type:'success', message:'成功拷贝到粘贴板'})"></el-button>
</template>
<el-descriptions-item v-for="(value, key, index) in wvpServerConfig.sip" :key="key">
<template slot="label">
{{ getNameFromKey(key) }}
</template>
{{ value }}
</el-descriptions-item>
</el-descriptions>
<div style="margin-top: 1rem">
<el-descriptions title="基础配置" border :column="1">
<template slot="extra">
<el-button style="float: right;" type="primary" size="mini" icon="el-icon-document-copy" title="点击拷贝"
v-clipboard="JSON.stringify(wvpServerConfig.base)|| ''"
@success="$message({type:'success', message:'成功拷贝到粘贴板'})"></el-button>
</template>
<el-descriptions-item v-for="(value, key, index) in wvpServerConfig.base" :key="key">
<template slot="label">
{{ getNameFromKey(key) }}
</template>
<div v-if="key === 'interfaceAuthenticationExcludes'">
<el-dropdown>
<span class="el-dropdown-link">
查看<i class="el-icon-arrow-down el-icon--right"></i>
</span>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item
v-for="(value, key, index) in wvpServerConfig.base.interfaceAuthenticationExcludes"
:key="key">{{ value }}
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</div>
<div v-if="key !== 'interfaceAuthenticationExcludes'">
<div v-if="value === true">
已启用
</div>
<div v-if="value === false">
未启用
</div>
<div v-if="value !== true && value !== false">
{{ value }}
</div>
</div>
</el-descriptions-item>
</el-descriptions>
</div>
<div style="margin-top: 1rem">
<el-descriptions title="版本信息" border :column="1">
<template slot="extra">
<el-button style="float: right;" type="primary" size="mini" icon="el-icon-document-copy" title="点击拷贝"
v-clipboard="JSON.stringify(wvpServerVersion) || ''"
@success="$message({type:'success', message:'成功拷贝到粘贴板'})"></el-button>
</template>
<el-descriptions-item v-for="(value, key, index) in wvpServerVersion" :key="key">
<template slot="label">
{{ getNameFromKey(key) }}
</template>
{{ value }}
</el-descriptions-item>
</el-descriptions>
</div>
</div>
<el-button type="primary" slot="reference" size="mini" @click="getWVPServerConfig()">信令服务器配置</el-button>
</el-popover>
<el-button style="margin-left: 1rem;" type="danger" size="mini" @click="reStartServer()">重启媒体服务器</el-button>
</div>
</div>
<!-- <div style="background-color: #FFFFFF; margin-bottom: 1rem; position: relative; padding: 0.5rem; text-align: left;">-->
<!-- <span style="font-size: 1rem; font-weight: bold;">控制台</span>-->
<!-- <div style="position: absolute; right: 17rem; top: 0.3rem;">-->
<!-- 节点选择:-->
<!-- <el-select size="mini" @change="chooseMediaChange" style="width: 18rem; margin-right: 8rem;"-->
<!-- v-model="mediaServerChoose" placeholder="请选择" default-first-option>-->
<!-- <el-option-->
<!-- v-for="item in mediaServerList"-->
<!-- :key="item.id"-->
<!-- :label="item.id + '( ' + item.streamIp + ' )'"-->
<!-- :value="item.id">-->
<!-- </el-option>-->
<!-- </el-select>-->
<!-- <span>{{ loadCount }}</span>-->
<!-- </div>-->
<!-- <div style="position: absolute; right: 1rem; top: 0.3rem;">-->
<!-- <el-popover placement="bottom" width="900" height="300" trigger="click">-->
<!-- <div style="height: 600px; overflow:auto; padding: 20px">-->
<!-- <el-descriptions v-for="(value, key, index) in serverConfig" :key="key" border :column="1"-->
<!-- style="margin-bottom: 1rem">-->
<!-- <template slot="title">-->
<!-- {{ key }}-->
<!-- </template>-->
<!-- <el-descriptions-item v-for="(value1, key1, index1) in serverConfig[key]" :key="key1">-->
<!-- <template slot="label">-->
<!-- {{ getMediaKeyNameFromKey(key1) }}-->
<!-- </template>-->
<!-- {{ value1 }}-->
<!-- </el-descriptions-item>-->
<!-- </el-descriptions>-->
<!-- </div>-->
<!-- <el-button type="primary" slot="reference" size="mini" @click="getServerConfig()">媒体服务器配置</el-button>-->
<!-- </el-popover>-->
<!-- <el-popover placement="bottom" width="900" height="300" trigger="click">-->
<!-- <div style="height: 600px;overflow:auto; padding: 20px">-->
<!-- <el-descriptions title="国标配置" border :column="1">-->
<!-- <template slot="extra">-->
<!-- <el-button style="float: right;" type="primary" size="mini" icon="el-icon-document-copy" title="点击拷贝"-->
<!-- v-clipboard="JSON.stringify(wvpServerConfig.sip)|| ''"-->
<!-- @success="$message({type:'success', message:'成功拷贝到粘贴板'})"></el-button>-->
<!-- </template>-->
<!-- <el-descriptions-item v-for="(value, key, index) in wvpServerConfig.sip" :key="key">-->
<!-- <template slot="label">-->
<!-- {{ getNameFromKey(key) }}-->
<!-- </template>-->
<!-- {{ value }}-->
<!-- </el-descriptions-item>-->
<!-- </el-descriptions>-->
<!-- <div style="margin-top: 1rem">-->
<!-- <el-descriptions title="基础配置" border :column="1">-->
<!-- <template slot="extra">-->
<!-- <el-button style="float: right;" type="primary" size="mini" icon="el-icon-document-copy" title="点击拷贝"-->
<!-- v-clipboard="JSON.stringify(wvpServerConfig.base)|| ''"-->
<!-- @success="$message({type:'success', message:'成功拷贝到粘贴板'})"></el-button>-->
<!-- </template>-->
<!-- <el-descriptions-item v-for="(value, key, index) in wvpServerConfig.base" :key="key">-->
<!-- <template slot="label">-->
<!-- {{ getNameFromKey(key) }}-->
<!-- </template>-->
<!-- <div v-if="key === 'interfaceAuthenticationExcludes'">-->
<!-- <el-dropdown>-->
<!-- <span class="el-dropdown-link">-->
<!-- 查看<i class="el-icon-arrow-down el-icon&#45;&#45;right"></i>-->
<!-- </span>-->
<!-- <el-dropdown-menu slot="dropdown">-->
<!-- <el-dropdown-item-->
<!-- v-for="(value, key, index) in wvpServerConfig.base.interfaceAuthenticationExcludes"-->
<!-- :key="key">{{ value }}-->
<!-- </el-dropdown-item>-->
<!-- </el-dropdown-menu>-->
<!-- </el-dropdown>-->
<!-- </div>-->
<!-- <div v-if="key !== 'interfaceAuthenticationExcludes'">-->
<!-- <div v-if="value === true">-->
<!-- 已启用-->
<!-- </div>-->
<!-- <div v-if="value === false">-->
<!-- 未启用-->
<!-- </div>-->
<!-- <div v-if="value !== true && value !== false">-->
<!-- {{ value }}-->
<!-- </div>-->
<!-- </div>-->
<!-- </el-descriptions-item>-->
<!-- </el-descriptions>-->
<!-- </div>-->
<!-- <div style="margin-top: 1rem">-->
<!-- <el-descriptions title="版本信息" border :column="1">-->
<!-- <template slot="extra">-->
<!-- <el-button style="float: right;" type="primary" size="mini" icon="el-icon-document-copy" title="点击拷贝"-->
<!-- v-clipboard="JSON.stringify(wvpServerVersion) || ''"-->
<!-- @success="$message({type:'success', message:'成功拷贝到粘贴板'})"></el-button>-->
<!-- </template>-->
<!-- <el-descriptions-item v-for="(value, key, index) in wvpServerVersion" :key="key">-->
<!-- <template slot="label">-->
<!-- {{ getNameFromKey(key) }}-->
<!-- </template>-->
<!-- {{ value }}-->
<!-- </el-descriptions-item>-->
<!-- </el-descriptions>-->
<!-- </div>-->
<!-- </div>-->
<!-- <el-button type="primary" slot="reference" size="mini" @click="getWVPServerConfig()">信令服务器配置</el-button>-->
<!-- </el-popover>-->
<!-- <el-button style="margin-left: 1rem;" type="danger" size="mini" @click="reStartServer()">重启媒体服务器</el-button>-->
<!-- </div>-->
<!-- </div>-->
<el-row style="width: 100%">
<el-col :span="12">
<div class="control-table" id="ThreadsLoad" style="margin-right:10px;">table1</div>
</el-col>
<el-col :span="12">
<div class="control-table" id="WorkThreadsLoad" style="margin-left:10px;">table2</div>
</el-col>
</el-row>
<el-table :data="allSessionData" style="margin-top: 1rem;">
<el-table-column prop="peer_ip" label="远端"></el-table-column>
<el-table-column prop="local_ip" label="本地"></el-table-column>
<el-table-column prop="typeid" label="类型"></el-table-column>
<el-table-column align="right">
<template v-slot:default="scope">
<el-button size="mini" icon="el-icon-refresh-right" circle @click="getAllSession()"></el-button>
<el-button @click.native.prevent="deleteRow(scope.$index, allSessionData)" type="text" size="small">移除
</el-button>
</template>
</el-table-column>
</el-table>
</div>
</template>
<script>
import uiHeader from '../layout/UiHeader.vue'
import MediaServer from './service/MediaServer'
import echarts from 'echarts';
export default {
name: 'app',
components: {
echarts,
uiHeader
},
data() {
return {
tableOption: {
// legend: {},
xAxis: {},
yAxis: {},
label: {},
tooltip: {},
dataZoom: [],
series: []
},
table1Option: {
// legend: {},
xAxis: {},
yAxis: {},
label: {},
tooltip: {},
series: []
},
mChart: null,
mChart1: null,
charZoomStart: 0,
charZoomEnd: 100,
chartInterval: 0, //更新图表统计图定时任务标识
allSessionData: [],
visible: false,
wvpVisible: false,
serverConfig: {},
wvpServerConfig: {},
wvpServerVersion: {},
mediaServer: new MediaServer(),
mediaServerChoose: null,
loadCount: 0,
mediaServerList: []
};
},
mounted() {
this.initTable()
this.chartInterval = setInterval(this.updateData, 3000);
this.mediaServer.getOnlineMediaServerList((data) => {
this.mediaServerList = data.data;
if (this.mediaServerList && this.mediaServerList.length > 0) {
this.mediaServerChoose = this.mediaServerList[0].id
this.loadCount = this.mediaServerList[0].count;
this.updateData();
}
})
},
destroyed() {
clearInterval(this.chartInterval); //释放定时任务
},
methods: {
chooseMediaChange: function (val) {
this.loadCount = 0
this.initTable()
this.updateData();
},
updateData: function () {
this.getThreadsLoad();
this.getLoadCount();
this.getAllSession();
},
/**
* 获取线程状态
*/
getThreadsLoad: function () {
let that = this;
if (!!that.mediaServerChoose) {
this.$axios({
method: 'get',
url: '/zlm/' + that.mediaServerChoose + '/index/api/getThreadsLoad'
}).then(function (res) {
if (res.data.code === 0) {
that.tableOption.xAxis.data.push(new Date().toLocaleTimeString('chinese', {
hour12: false
}));
that.table1Option.xAxis.data.push(new Date().toLocaleTimeString('chinese', {
hour12: false
}));
for (var i = 0; i < res.data.data.length; i++) {
if (that.tableOption.series[i] === undefined) {
let data = {
data: [],
type: 'line'
};
let data1 = {
data: [],
type: 'line'
};
data.data.push(res.data.data[i].delay);
data1.data.push(res.data.data[i].load);
that.tableOption.series.push(data);
that.table1Option.series.push(data1);
} else {
that.tableOption.series[i].data.push(res.data.data[i].delay);
that.table1Option.series[i].data.push(res.data.data[i].load);
}
}
that.tableOption.dataZoom[0].start = that.charZoomStart;
that.tableOption.dataZoom[0].end = that.charZoomEnd;
that.table1Option.dataZoom[0].start = that.charZoomStart;
that.table1Option.dataZoom[0].end = that.charZoomEnd;
//that.myChart = echarts.init(document.getElementById('ThreadsLoad'));
that.myChart.setOption(that.tableOption, true);
// that.myChart1 = echarts.init(document.getElementById('WorkThreadsLoad'));
that.myChart1.setOption(that.table1Option, true);
that.$nextTick(() => {
that.myChart.resize()
that.myChart1.resize()
})
}
});
}
},
getLoadCount: function () {
let that = this;
if (!!that.mediaServerChoose) {
that.mediaServer.getMediaServer(that.mediaServerChoose, (data) => {
if (data.code == 0) {
that.loadCount = data.data.count
}
})
}
},
initTable: function () {
let that = this;
this.tableOption.xAxis = {
type: 'category',
data: [], // x轴数据
name: '时间', // x轴名称
// x轴名称样式
nameTextStyle: {
fontWeight: 300,
fontSize: 15
}
};
this.tableOption.yAxis = {
type: 'value',
name: '延迟率', // y轴名称
boundaryGap: [0, '100%'],
max: 100,
axisLabel: {
show: true,
interval: 'auto',
formatter: '{value} %'
},
// y轴名称样式
nameTextStyle: {
fontWeight: 300,
fontSize: 15
}
};
this.tableOption.dataZoom = [{
show: true,
start: this.charZoomStart,
end: this.charZoomEnd
}];
this.myChart = echarts.init(document.getElementById('ThreadsLoad'));
this.myChart.setOption(this.tableOption);
this.myChart.on('dataZoom', function (event) {
if (event.batch) {
that.charZoomStart = event.batch[0].start;
that.charZoomEnd = event.batch[0].end;
} else {
that.charZoomStart = event.start;
that.charZoomEnd = event.end;
}
});
this.table1Option.xAxis = {
type: 'category',
data: [], // x轴数据
name: '时间', // x轴名称
// x轴名称样式
nameTextStyle: {
fontWeight: 300,
fontSize: 15
}
};
this.table1Option.yAxis = {
type: 'value',
name: '负载率', // y轴名称
boundaryGap: [0, '100%'],
max: 100,
axisLabel: {
show: true,
interval: 'auto',
formatter: '{value} %'
},
// y轴名称样式
nameTextStyle: {
fontWeight: 300,
fontSize: 15
}
};
this.table1Option.dataZoom = [{
show: true,
start: this.charZoomStart,
end: this.charZoomEnd
}];
this.myChart1 = echarts.init(document.getElementById('WorkThreadsLoad'));
this.myChart1.setOption(this.table1Option);
this.myChart1.on('dataZoom', function (event) {
if (event.batch) {
that.charZoomStart = event.batch[0].start;
that.charZoomEnd = event.batch[0].end;
} else {
that.charZoomStart = event.start;
that.charZoomEnd = event.end;
}
});
},
getAllSession: function () {
this.allSessionData = [];
if (!!this.mediaServerChoose) {
this.$axios({
method: 'get',
url: '/zlm/' + this.mediaServerChoose + '/index/api/getAllSession'
}).then((res)=> {
res.data.data.forEach(item => {
let data = {
peer_ip: item.peer_ip,
local_ip: item.local_ip,
typeid: item.typeid,
id: item.id
};
this.allSessionData.push(data);
});
});
}
},
getServerConfig: function () {
if (!!this.mediaServerChoose) {
this.$axios({
method: 'get',
url: '/zlm/' + this.mediaServerChoose + '/index/api/getServerConfig'
}).then((res)=> {
let info = res.data.data[0];
let serverInfo = {}
for (let i = 0; i < Object.keys(info).length; i++) {
let key = Object.keys(info)[i];
let group = key.substring(0, key.indexOf("."))
let itemKey = key.substring(key.indexOf(".") + 1)
if (!serverInfo[group]) serverInfo[group] = {}
serverInfo[group][itemKey] = info[key]
}
this.serverConfig = serverInfo;
this.visible = true;
});
}
},
getWVPServerConfig: function () {
let that = this;
this.$axios({
method: 'get',
url: '/api/server/config'
}).then(function (res) {
console.log(res)
that.wvpServerConfig = res.data.data;
that.wvpVisible = true;
});
this.$axios({
method: 'get',
url: '/api/server/version'
}).then(function (res) {
console.log(res)
that.wvpServerVersion = res.data.data;
that.wvpVisible = true;
});
},
reStartServer: function () {
let that = this;
if (!!!this.mediaServerChoose) {
this.$message({
type: 'info',
message: '未选择节点'
});
return;
}
this.$confirm('此操作将重启媒体服务器, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
let that = this;
this.$axios({
method: 'get',
url: '/zlm/' + that.mediaServerChoose + '/index/api/restartServer'
}).then(function (res) {
that.getAllSession();
if (res.data.code === 0) {
that.$message({
type: 'success',
message: '操作完成'
});
}
});
});
},
deleteRow: function (index, tabledata) {
let that = this;
this.$confirm('此操作将断开该通信链路, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
that.deleteSession(tabledata[index].id);
})
.catch(() => {
console.log('id' + JSON.stringify(tabledata[index]));
this.$message({
type: 'info',
message: '已取消删除'
});
});
console.log(JSON.stringify(tabledata[index]));
},
deleteSession: function (id) {
if (!!this.mediaServerChoose) {
this.$axios({
method: 'get',
url: '/zlm/' + this.mediaServerChoose + '/index/api/kick_session?id=' + id
}).then((res)=>{
this.getAllSession();
this.$message({
type: 'success',
message: '删除成功!'
});
});
}
},
getNameFromKey: function (key) {
let nameData = {
"waitTrack": "等待编码信息",
"interfaceAuthenticationExcludes": "不进行鉴权的接口",
"playTimeout": "点播超时时间",
"autoApplyPlay": "自动点播",
"recordPushLive": "推流录像",
"redisConfig": "自动配置redis",
"thirdPartyGBIdReg": "stream信息正则",
"savePositionHistory": "保存轨迹信息",
"interfaceAuthentication": "接口鉴权",
"serverId": "服务ID",
"logInDatebase": "日志存储进数据库",
"seniorSdp": "扩展SDP",
"password": "密码",
"port": "端口号",
"keepaliveTimeOut": "心跳超时",
"domain": "国标域",
"ip": "IP地址",
"monitorIp": "监听IP",
"alarm": "存储报警信息",
"ptzSpeed": "云台控制速度",
"id": "国标ID",
"registerTimeInterval": "注册间隔",
"artifactId": "模块名称",
"version": "版本",
"project": "工程",
"git_Revision": "GIT修订版本",
"git_BRANCH": "GIT分支",
"git_URL": "GIT地址",
"build_DATE": "构建时间",
"create_By": "作者",
"git_Revision_SHORT": "GIT修订版本",
"build_Jdk": "构建用JDK",
};
console.log(key + ": " + nameData[key])
if (nameData[key]) {
return nameData[key]
} else {
return key;
}
},
getMediaKeyNameFromKey: function (key) {
let nameData = {
"waitTrack": "等待编码信息",
"interfaceAuthenticationExcludes": "不进行鉴权的接口",
"playTimeout": "点播超时时间",
"autoApplyPlay": "自动点播",
"recordPushLive": "推流录像",
"redisConfig": "自动配置redis",
"thirdPartyGBIdReg": "stream信息正则",
"savePositionHistory": "保存轨迹信息",
"interfaceAuthentication": "接口鉴权",
"serverId": "服务ID",
"logInDatebase": "日志存储进数据库",
"seniorSdp": "扩展SDP",
"password": "密码",
"port": "端口号",
"keepaliveTimeOut": "心跳超时",
"domain": "国标域",
"ip": "IP地址",
"monitorIp": "监听IP",
"alarm": "存储报警信息",
"ptzSpeed": "云台控制速度",
"id": "国标ID",
"registerTimeInterval": "注册间隔",
"artifactId": "模块名称",
"version": "版本",
"project": "工程",
"git_Revision": "GIT修订版本",
"git_BRANCH": "GIT分支",
"git_URL": "GIT地址",
"build_DATE": "构建时间",
"create_By": "作者",
"git_Revision_SHORT": "GIT修订版本",
"build_Jdk": "构建用JDK",
};
console.log(key + ": " + nameData[key])
if (nameData[key]) {
return nameData[key]
} else {
return key;
}
}
}
};
</script>
<style>
#app {
height: 100%;
}
.control-table {
background-color: #ffffff;
height: 25rem;
}
.table-c {
border-right: 1px solid #dcdcdc;
border-bottom: 1px solid #dcdcdc;
}
.table-c td {
border-left: 1px solid #dcdcdc;
border-top: 1px solid #dcdcdc;
padding: 0.2rem;
}
.el-table {
width: 99.9% !important;
}
</style>

View File

@@ -89,11 +89,6 @@
-
<el-input v-model="rtpPortRange2" placeholder="终止" @change="portRangeChange" clearable style="width: 100px" prop="rtpPortRange2" :disabled="mediaServerForm.defaultServer"></el-input>
</el-form-item>
<el-form-item label="推流端口" prop="sendRtpPortRange1">
<el-input v-model="sendRtpPortRange1" placeholder="起始" @change="portRangeChange" clearable style="width: 100px" prop="sendRtpPortRange1" :disabled="mediaServerForm.defaultServer"></el-input>
-
<el-input v-model="sendRtpPortRange2" placeholder="终止" @change="portRangeChange" clearable style="width: 100px" prop="sendRtpPortRange2" :disabled="mediaServerForm.defaultServer"></el-input>
</el-form-item>
<el-form-item label="录像管理服务端口" prop="recordAssistPort">
<el-input v-model.number="mediaServerForm.recordAssistPort" :disabled="mediaServerForm.defaultServer">
<!-- <el-button v-if="mediaServerForm.recordAssistPort > 0" slot="append" type="primary" @click="checkRecordServer">测试</el-button>-->
@@ -177,15 +172,12 @@ export default {
rtmpSSlPort: "",
rtpEnable: false,
rtpPortRange: "",
sendRtpPortRange: "",
rtpProxyPort: "",
rtspPort: "",
rtspSSLPort: "",
},
rtpPortRange1:30000,
rtpPortRange2:30500,
sendRtpPortRange1:30000,
sendRtpPortRange2:30500,
rules: {
ip: [{ required: true, validator: isValidIp, message: '请输入有效的IP地址', trigger: 'blur' }],
@@ -196,8 +188,6 @@ export default {
rtmpSSlPort: [{ required: true, validator: isValidPort, message: '请输入有效的端口号', trigger: 'blur' }],
rtpPortRange1: [{ required: true, validator: isValidPort, message: '请输入有效的端口号', trigger: 'blur' }],
rtpPortRange2: [{ required: true, validator: isValidPort, message: '请输入有效的端口号', trigger: 'blur' }],
sendRtpPortRange1: [{ required: true, validator: isValidPort, message: '请输入有效的端口号', trigger: 'blur' }],
sendRtpPortRange2: [{ required: true, validator: isValidPort, message: '请输入有效的端口号', trigger: 'blur' }],
rtpProxyPort: [{ required: true, validator: isValidPort, message: '请输入有效的端口号', trigger: 'blur' }],
rtspPort: [{ required: true, validator: isValidPort, message: '请输入有效的端口号', trigger: 'blur' }],
rtspSSLPort: [{ required: true, validator: isValidPort, message: '请输入有效的端口号', trigger: 'blur' }],
@@ -229,9 +219,6 @@ export default {
this.rtpPortRange2 = rtpPortRange[1]
}
}
let sendRtpPortRange = this.mediaServerForm.sendRtpPortRange.split(",");
this.sendRtpPortRange1 = sendRtpPortRange[0]
this.sendRtpPortRange2 = sendRtpPortRange[1]
}
},
checkServer: function() {
@@ -251,8 +238,6 @@ export default {
that.mediaServerForm = data.data;
that.mediaServerForm.httpPort = httpPort;
that.mediaServerForm.autoConfig = true;
that.sendRtpPortRange1 = 30000
that.sendRtpPortRange2 = 30500
that.rtpPortRange1 = 30000
that.rtpPortRange2 = 30500
that.serverCheck = 1;
@@ -336,13 +321,10 @@ export default {
rtmpSSlPort: "",
rtpEnable: false,
rtpPortRange: "",
sendRtpPortRange: "",
rtpProxyPort: "",
rtspPort: "",
rtspSSLPort: "",
};
this.sendRtpPortRange1 = 30000;
this.sendRtpPortRange2 = 30500;
this.rtpPortRange1 = 30500;
this.rtpPortRange2 = 30500;
this.listChangeCallback = null
@@ -367,9 +349,7 @@ export default {
}
},
portRangeChange: function() {
this.mediaServerForm.sendRtpPortRange = this.sendRtpPortRange1 + "," + this.sendRtpPortRange2
this.mediaServerForm.rtpPortRange = this.rtpPortRange1 + "," + this.rtpPortRange2
console.log(this.mediaServerForm.sendRtpPortRange)
console.log(this.mediaServerForm.rtpPortRange)
}
},

View File

@@ -0,0 +1,59 @@
<template>
<div id="configInfo">
<el-dialog
title="系统信息"
width="=80%"
top="2rem"
:close-on-click-modal="false"
:visible.sync="showDialog"
:destroy-on-close="true"
@close="close()"
>
<div id="shared" style="margin-top: 1rem;margin-right: 100px;">
<el-descriptions title="国标服务信息" v-if="configInfoData.sip" :span="2">
<el-descriptions-item label="编号" >{{configInfoData.sip.id}}</el-descriptions-item>
<el-descriptions-item label="域">{{configInfoData.sip.domain}}</el-descriptions-item>
<el-descriptions-item label="IP">{{configInfoData.sip.ip}}</el-descriptions-item>
<el-descriptions-item label="端口">{{configInfoData.sip.port}}</el-descriptions-item>
<el-descriptions-item label="密码">
<el-tag size="small">{{configInfoData.sip.password}}</el-tag>
</el-descriptions-item>
</el-descriptions>
<el-descriptions title="版本信息"v-if="configInfoData.version">
<el-descriptions-item label="版本">{{configInfoData.version.version}}</el-descriptions-item>
<el-descriptions-item label="编译时间">{{configInfoData.version.BUILD_DATE}}</el-descriptions-item>
<el-descriptions-item label="GIT版本">{{configInfoData.version.GIT_Revision_SHORT}}</el-descriptions-item>
<el-descriptions-item label="GIT最后提交时间">{{configInfoData.version.GIT_DATE}}</el-descriptions-item>
</el-descriptions>
</div>
</el-dialog>
</div>
</template>
<script>
export default {
name: "configInfo",
props: {},
computed: {},
created() {},
data() {
return {
showDialog: false,
configInfoData: {
sip:{},
}
};
},
methods: {
openDialog: function (data) {
console.log(data)
this.showDialog = true;
this.configInfoData = data;
},
close: function () {
this.showDialog = false;
},
},
};
</script>

View File

@@ -11,13 +11,20 @@
>
<div id="shared" style="margin-top: 1rem;margin-right: 100px;">
<el-form ref="form" :rules="rules" :model="form" label-width="200px" >
<el-form-item label="设备编号" >
<el-input v-model="form.deviceId" disabled></el-input>
<el-form-item label="设备编号" prop="deviceId">
<el-input v-if="isEdit" v-model="form.deviceId" disabled></el-input>
<el-input v-if="!isEdit" v-model="form.deviceId" clearable></el-input>
</el-form-item>
<el-form-item label="设备名称" prop="name">
<el-input v-model="form.name" clearable></el-input>
</el-form-item>
<el-form-item label="密码" prop="password">
<el-input type="password" v-model="form.password" clearable></el-input>
</el-form-item>
<el-form-item label="收流IP" prop="sdpIp">
<el-input type="sdpIp" v-model="form.sdpIp" clearable></el-input>
</el-form-item>
<el-form-item label="流媒体ID" prop="mediaServerId">
<el-select v-model="form.mediaServerId" style="float: left; width: 100%" >
<el-option key="auto" label="自动负载最小" value="auto"></el-option>
@@ -51,10 +58,10 @@
<el-option key="GCJ02" label="业务分组" value="BusinessGroup"></el-option>
</el-select>
</el-form-item>
<el-form-item label="目录订阅" title="0为取消订阅" prop="subscribeCycleForCatalog" >
<el-form-item v-if="this.isEdit" label="目录订阅" title="0为取消订阅" prop="subscribeCycleForCatalog" >
<el-input v-model="form.subscribeCycleForCatalog" clearable ></el-input>
</el-form-item>
<el-form-item label="移动位置订阅" title="0为取消订阅" prop="subscribeCycleForCatalog" >
<el-form-item v-if="this.isEdit" label="移动位置订阅" title="0为取消订阅" prop="subscribeCycleForCatalog" >
<el-input v-model="form.subscribeCycleForMobilePosition" clearable ></el-input>
</el-form-item>
<el-form-item v-if="form.subscribeCycleForMobilePosition > 0" label="移动位置报送间隔" prop="subscribeCycleForCatalog" >
@@ -92,8 +99,9 @@ export default {
mediaServerList: [], // 滅体节点列表
mediaServerObj : new MediaServer(),
form: {},
isEdit: false,
rules: {
name: [{ required: true, message: "请输入名称", trigger: "blur" }]
deviceId: [{ required: true, message: "请输入设备编号", trigger: "blur" }]
},
};
},
@@ -101,6 +109,11 @@ export default {
openDialog: function (row, callback) {
console.log(row)
this.showDialog = true;
this.isEdit = false;
if (row) {
this.isEdit = true;
}
this.form = {};
this.listChangeCallback = callback;
if (row != null) {
this.form = row;
@@ -121,7 +134,7 @@ export default {
this.form.mobilePositionSubmissionInterval = this.form.mobilePositionSubmissionInterval||0
this.$axios({
method: 'post',
url:`/api/device/query/device/update/`,
url:`/api/device/query/device/${this.isEdit?'update':'add'}/`,
params: this.form
}).then((res) => {
console.log(res.data)

View File

@@ -2,7 +2,6 @@
<div id="devicePlayer" v-loading="isLoging">
<el-dialog title="视频播放" top="0" :close-on-click-modal="false" :visible.sync="showVideoDialog" @close="close()">
<!-- <LivePlayer v-if="showVideoDialog" ref="videoPlayer" :videoUrl="videoUrl" :error="videoError" :message="videoError" :hasaudio="hasaudio" fluent autoplay live></LivePlayer> -->
<div style="width: 100%; height: 100%">
<el-tabs type="card" :stretch="true" v-model="activePlayer" @tab-click="changePlayer" v-if="Object.keys(this.player).length > 1">
<el-tab-pane label="Jessibuca" name="jessibuca">
@@ -51,93 +50,93 @@
更多地址<i class="el-icon-arrow-down el-icon--right"></i>
</el-button>
<el-dropdown-menu slot="dropdown" >
<el-dropdown-item :command="streamInfo.flv">
<el-dropdown-item :command="streamInfo.flv.url">
<el-tag >FLV:</el-tag>
<span>{{ streamInfo.flv }}</span>
<span>{{ streamInfo.flv.url }}</span>
</el-dropdown-item>
<el-dropdown-item :command="streamInfo.https_flv">
<el-dropdown-item :command="streamInfo.https_flv.url">
<el-tag >FLV(https):</el-tag>
<span>{{ streamInfo.https_flv }}</span>
<span>{{ streamInfo.https_flv.url }}</span>
</el-dropdown-item>
<el-dropdown-item :command="streamInfo.ws_flv">
<el-dropdown-item :command="streamInfo.ws_flv.url">
<el-tag >FLV(ws):</el-tag>
<span >{{ streamInfo.ws_flv }}</span>
<span >{{ streamInfo.ws_flv.url }}</span>
</el-dropdown-item>
<el-dropdown-item :command="streamInfo.wss_flv">
<el-dropdown-item :command="streamInfo.wss_flv.url">
<el-tag >FLV(wss):</el-tag>
<span>{{ streamInfo.wss_flv }}</span>
<span>{{ streamInfo.wss_flv.url }}</span>
</el-dropdown-item>
<el-dropdown-item :command="streamInfo.fmp4">
<el-dropdown-item :command="streamInfo.fmp4.url">
<el-tag >FMP4:</el-tag>
<span>{{ streamInfo.fmp4 }}</span>
<span>{{ streamInfo.fmp4.url }}</span>
</el-dropdown-item>
<el-dropdown-item :command="streamInfo.https_fmp4">
<el-dropdown-item :command="streamInfo.https_fmp4.url">
<el-tag >FMP4(https):</el-tag>
<span>{{ streamInfo.https_fmp4 }}</span>
<span>{{ streamInfo.https_fmp4.url }}</span>
</el-dropdown-item>
<el-dropdown-item :command="streamInfo.ws_fmp4">
<el-dropdown-item :command="streamInfo.ws_fmp4.url">
<el-tag >FMP4(ws):</el-tag>
<span>{{ streamInfo.ws_fmp4 }}</span>
<span>{{ streamInfo.ws_fmp4.url }}</span>
</el-dropdown-item>
<el-dropdown-item :command="streamInfo.wss_fmp4">
<el-dropdown-item :command="streamInfo.wss_fmp4.url">
<el-tag >FMP4(wss):</el-tag>
<span>{{ streamInfo.wss_fmp4 }}</span>
<span>{{ streamInfo.wss_fmp4.url }}</span>
</el-dropdown-item>
<el-dropdown-item :command="streamInfo.hls">
<el-dropdown-item :command="streamInfo.hls.url">
<el-tag>HLS:</el-tag>
<span>{{ streamInfo.hls }}</span>
<span>{{ streamInfo.hls.url }}</span>
</el-dropdown-item>
<el-dropdown-item :command="streamInfo.https_hls">
<el-dropdown-item :command="streamInfo.https_hls.url">
<el-tag >HLS(https):</el-tag>
<span>{{ streamInfo.https_hls }}</span>
<span>{{ streamInfo.https_hls.url }}</span>
</el-dropdown-item>
<el-dropdown-item :command="streamInfo.ws_hls">
<el-dropdown-item :command="streamInfo.ws_hls.url">
<el-tag >HLS(ws):</el-tag>
<span>{{ streamInfo.ws_hls }}</span>
<span>{{ streamInfo.ws_hls.url }}</span>
</el-dropdown-item>
<el-dropdown-item :command="streamInfo.wss_hls">
<el-dropdown-item :command="streamInfo.wss_hls.url">
<el-tag >HLS(wss):</el-tag>
<span>{{ streamInfo.wss_hls }}</span>
<span>{{ streamInfo.wss_hls.url }}</span>
</el-dropdown-item>
<el-dropdown-item :command="streamInfo.ts">
<el-dropdown-item :command="streamInfo.ts.url">
<el-tag>TS:</el-tag>
<span>{{ streamInfo.ts }}</span>
<span>{{ streamInfo.ts.url }}</span>
</el-dropdown-item>
<el-dropdown-item :command="streamInfo.https_ts">
<el-dropdown-item :command="streamInfo.https_ts.url">
<el-tag>TS(https):</el-tag>
<span>{{ streamInfo.https_ts }}</span>
<span>{{ streamInfo.https_ts.url }}</span>
</el-dropdown-item>
<el-dropdown-item :command="streamInfo.ws_ts">
<el-dropdown-item :command="streamInfo.ws_ts.url">
<el-tag>TS(ws):</el-tag>
<span>{{ streamInfo.ws_ts }}</span>
<span>{{ streamInfo.ws_ts.url }}</span>
</el-dropdown-item>
<el-dropdown-item :command="streamInfo.wss_ts">
<el-dropdown-item :command="streamInfo.wss_ts.url">
<el-tag>TS(wss):</el-tag>
<span>{{ streamInfo.wss_ts }}</span>
<span>{{ streamInfo.wss_ts.url }}</span>
</el-dropdown-item>
<el-dropdown-item :command="streamInfo.rtc">
<el-dropdown-item :command="streamInfo.rtc.url">
<el-tag >RTC:</el-tag>
<span>{{ streamInfo.rtc }}</span>
<span>{{ streamInfo.rtc.url }}</span>
</el-dropdown-item>
<el-dropdown-item :command="streamInfo.rtcs">
<el-dropdown-item :command="streamInfo.rtcs.url">
<el-tag >RTCS:</el-tag>
<span>{{ streamInfo.rtcs }}</span>
</el-dropdown-item>
<el-dropdown-item :command="streamInfo.rtmp">
<el-dropdown-item :command="streamInfo.rtmp.url">
<el-tag >RTMP:</el-tag>
<span>{{ streamInfo.rtmp }}</span>
<span>{{ streamInfo.rtmp.url }}</span>
</el-dropdown-item>
<el-dropdown-item :command="streamInfo.rtmps">
<el-dropdown-item :command="streamInfo.rtmps.url">
<el-tag >RTMPS:</el-tag>
<span>{{ streamInfo.rtmps }}</span>
<span>{{ streamInfo.rtmps.url }}</span>
</el-dropdown-item>
<el-dropdown-item :command="streamInfo.rtsp">
<el-dropdown-item :command="streamInfo.rtsp.url">
<el-tag >RTSP:</el-tag>
<span>{{ streamInfo.rtsp }}</span>
<span>{{ streamInfo.rtsp.url }}</span>
</el-dropdown-item>
<el-dropdown-item :command="streamInfo.rtsps">
<el-dropdown-item :command="streamInfo.rtsps.url">
<el-tag >RTSPS:</el-tag>
<span>{{ streamInfo.rtsps }}</span>
<span>{{ streamInfo.rtsps.url }}</span>
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
@@ -311,7 +310,7 @@ export default {
name: 'devicePlayer',
props: {},
components: {
jessibucaPlayer, rtcPlayer, recordDownload,
LivePlayer, jessibucaPlayer, rtcPlayer, recordDownload,
},
computed: {
getPlayerShared: function () {
@@ -411,7 +410,7 @@ export default {
changePlayer: function (tab) {
console.log(this.player[tab.name][0])
this.activePlayer = tab.name;
this.videoUrl = this.streamInfo[this.player[tab.name][0]]
this.videoUrl = this.getUrlByStreamInfo()
console.log(this.videoUrl)
},
openDialog: function (tab, deviceId, channelId, param) {
@@ -464,9 +463,9 @@ export default {
getUrlByStreamInfo(){
console.log(this.streamInfo)
if (location.protocol === "https:") {
this.videoUrl = this.streamInfo[this.player[this.activePlayer][1]]
this.videoUrl = this.streamInfo[this.player[this.activePlayer][1]].url
}else {
this.videoUrl = this.streamInfo[this.player[this.activePlayer][0]]
this.videoUrl = this.streamInfo[this.player[this.activePlayer][0]].url
}
return this.videoUrl;

View File

@@ -51,7 +51,7 @@ export default {
});
webrtcPlayer.on(ZLMRTCClient.Events.WEBRTC_ON_REMOTE_STREAMS,(e)=>{//获取到了远端流,可以播放
console.error('播放成功',e.streams)
console.log('播放成功',e.streams)
this.eventcallbacK("playing", "播放成功")
});
@@ -59,7 +59,7 @@ export default {
console.error('offer anwser 交换失败',e)
this.eventcallbacK("OFFER ANSWER ERROR ", "offer anwser 交换失败")
if (e.code ==-400 && e.msg=="流不存在"){
console.log("111111")
console.log("流不存在")
this.timer = setTimeout(()=>{
this.webrtcPlayer.close();
this.play(url)

View File

@@ -138,8 +138,14 @@ export default {
url: '/api/play/start/' + deviceId + '/' + channelId
}).then(function (res) {
if (res.data.code === 0 && res.data.data) {
itemData.playUrl = res.data.data.httpsFlv
that.setPlayUrl(res.data.data.ws_flv, idxTmp)
let videoUrl;
if (location.protocol === "https:") {
videoUrl = res.data.data.wss_flv.url;
} else {
videoUrl = res.data.data.ws_flv.url;
}
itemData.playUrl = videoUrl;
that.setPlayUrl(videoUrl, idxTmp);
} else {
that.$message.error(res.data.msg);
}