From 2e9b4b4e5e86c84088c45563cd61d18d8c7e5fea Mon Sep 17 00:00:00 2001
From: 648540858 <648540858@qq.com>
Date: 星期一, 09 十一月 2020 19:38:54 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master' into master
---
web_src/src/components/control.vue | 643 +++++++++++++++++++++++++------------------------
web_src/src/components/gb28181/devicePlayer.vue | 4
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/request/impl/MessageRequestProcessor.java | 121 ++++----
src/main/java/com/genersoft/iot/vmp/storager/redis/VideoManagerRedisStoragerImpl.java | 4
4 files changed, 391 insertions(+), 381 deletions(-)
diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/request/impl/MessageRequestProcessor.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/request/impl/MessageRequestProcessor.java
index e0b3211..ee142d7 100644
--- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/request/impl/MessageRequestProcessor.java
+++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/request/impl/MessageRequestProcessor.java
@@ -310,73 +310,76 @@
recordInfo.setSumNum(Integer.parseInt(XmlUtil.getText(rootElement, "SumNum")));
String sn = XmlUtil.getText(rootElement, "SN");
Element recordListElement = rootElement.element("RecordList");
- if (recordListElement == null) {
+ if (recordListElement == null || recordInfo.getSumNum() == 0) {
logger.info("鏃犲綍鍍忔暟鎹�");
// responseAck(evt);
- return;
- }
-
- Iterator<Element> recordListIterator = recordListElement.elementIterator();
- List<RecordItem> recordList = new ArrayList<RecordItem>();
- if (recordListIterator != null) {
- RecordItem record = new RecordItem();
- logger.info("澶勭悊褰曞儚鍒楄〃鏁版嵁...");
- // 閬嶅巻DeviceList
- while (recordListIterator.hasNext()) {
- Element itemRecord = recordListIterator.next();
- Element recordElement = itemRecord.element("DeviceID");
- if (recordElement == null) {
- logger.info("璁板綍涓虹┖锛屼笅涓�涓�...");
- continue;
+ // return;
+ } else {
+ Iterator<Element> recordListIterator = recordListElement.elementIterator();
+ List<RecordItem> recordList = new ArrayList<RecordItem>();
+ if (recordListIterator != null) {
+ RecordItem record = new RecordItem();
+ logger.info("澶勭悊褰曞儚鍒楄〃鏁版嵁...");
+ // 閬嶅巻DeviceList
+ while (recordListIterator.hasNext()) {
+ Element itemRecord = recordListIterator.next();
+ Element recordElement = itemRecord.element("DeviceID");
+ if (recordElement == null) {
+ logger.info("璁板綍涓虹┖锛屼笅涓�涓�...");
+ continue;
+ }
+ record = new RecordItem();
+ record.setDeviceId(XmlUtil.getText(itemRecord, "DeviceID"));
+ record.setName(XmlUtil.getText(itemRecord, "Name"));
+ record.setFilePath(XmlUtil.getText(itemRecord, "FilePath"));
+ record.setAddress(XmlUtil.getText(itemRecord, "Address"));
+ record.setStartTime(
+ DateUtil.ISO8601Toyyyy_MM_dd_HH_mm_ss(XmlUtil.getText(itemRecord, "StartTime")));
+ record.setEndTime(
+ DateUtil.ISO8601Toyyyy_MM_dd_HH_mm_ss(XmlUtil.getText(itemRecord, "EndTime")));
+ record.setSecrecy(itemRecord.element("Secrecy") == null ? 0
+ : Integer.parseInt(XmlUtil.getText(itemRecord, "Secrecy")));
+ record.setType(XmlUtil.getText(itemRecord, "Type"));
+ record.setRecorderId(XmlUtil.getText(itemRecord, "RecorderID"));
+ recordList.add(record);
}
- record = new RecordItem();
- record.setDeviceId(XmlUtil.getText(itemRecord, "DeviceID"));
- record.setName(XmlUtil.getText(itemRecord, "Name"));
- record.setFilePath(XmlUtil.getText(itemRecord, "FilePath"));
- record.setAddress(XmlUtil.getText(itemRecord, "Address"));
- record.setStartTime(
- DateUtil.ISO8601Toyyyy_MM_dd_HH_mm_ss(XmlUtil.getText(itemRecord, "StartTime")));
- record.setEndTime(DateUtil.ISO8601Toyyyy_MM_dd_HH_mm_ss(XmlUtil.getText(itemRecord, "EndTime")));
- record.setSecrecy(itemRecord.element("Secrecy") == null ? 0
- : Integer.parseInt(XmlUtil.getText(itemRecord, "Secrecy")));
- record.setType(XmlUtil.getText(itemRecord, "Type"));
- record.setRecorderId(XmlUtil.getText(itemRecord, "RecorderID"));
- recordList.add(record);
+ // recordList.sort(Comparator.naturalOrder());
+ recordInfo.setRecordList(recordList);
}
- // recordList.sort(Comparator.naturalOrder());
- recordInfo.setRecordList(recordList);
- }
- // 瀛樺湪褰曞儚涓斿鏋滃綋鍓嶅綍鍍忔槑缁嗕釜鏁板皬浜庢�绘潯鏁帮紝璇存槑鎷嗗寘杩斿洖锛岄渶瑕佺粍瑁咃紝鏆備笉杩斿洖
- if (recordInfo.getSumNum() > 0 && recordList.size() > 0 && recordList.size() < recordInfo.getSumNum()) {
- // 涓洪槻姝㈣繛缁姹傝璁惧鐨勫綍鍍忔暟鎹紝杩斿洖鏁版嵁閿欎贡锛岀壒澧炲姞sn杩涜鍖哄垎
- String cacheKey = CACHE_RECORDINFO_KEY + deviceId + sn;
- // TODO 鏆傛椂鐩存帴鎿嶄綔redis瀛樺偍锛屽悗缁皝瑁呬笓鐢ㄧ紦瀛樻帴鍙o紝鏀逛负鏈湴鍐呭瓨缂撳瓨
- if (redis.hasKey(cacheKey)) {
- List<RecordItem> previousList = (List<RecordItem>) redis.get(cacheKey);
- if (previousList != null && previousList.size() > 0) {
- recordList.addAll(previousList);
- }
- // 鏈垎鏀〃绀哄綍鍍忓垪琛ㄨ鎷嗗寘锛屼笖鍔犱笂涔嬪墠鐨勬暟鎹繕鏄笉澶�,淇濆瓨缂撳瓨杩斿洖锛岀瓑寰呬笅涓寘鍐嶅鐞�
- if (recordList.size() < recordInfo.getSumNum()) {
+ // 瀛樺湪褰曞儚涓斿鏋滃綋鍓嶅綍鍍忔槑缁嗕釜鏁板皬浜庢�绘潯鏁帮紝璇存槑鎷嗗寘杩斿洖锛岄渶瑕佺粍瑁咃紝鏆備笉杩斿洖
+ if (recordInfo.getSumNum() > 0 && recordList.size() > 0 && recordList.size() < recordInfo.getSumNum()) {
+ // 涓洪槻姝㈣繛缁姹傝璁惧鐨勫綍鍍忔暟鎹紝杩斿洖鏁版嵁閿欎贡锛岀壒澧炲姞sn杩涜鍖哄垎
+ String cacheKey = CACHE_RECORDINFO_KEY + deviceId + sn;
+ // TODO 鏆傛椂鐩存帴鎿嶄綔redis瀛樺偍锛屽悗缁皝瑁呬笓鐢ㄧ紦瀛樻帴鍙o紝鏀逛负鏈湴鍐呭瓨缂撳瓨
+ if (redis.hasKey(cacheKey)) {
+ List<RecordItem> previousList = (List<RecordItem>) redis.get(cacheKey);
+ if (previousList != null && previousList.size() > 0) {
+ recordList.addAll(previousList);
+ }
+ // 鏈垎鏀〃绀哄綍鍍忓垪琛ㄨ鎷嗗寘锛屼笖鍔犱笂涔嬪墠鐨勬暟鎹繕鏄笉澶�,淇濆瓨缂撳瓨杩斿洖锛岀瓑寰呬笅涓寘鍐嶅鐞�
+ if (recordList.size() < recordInfo.getSumNum()) {
+ logger.info("宸茶幏鍙�" + recordList.size() + "椤瑰綍鍍忔暟鎹紝鍏�" + recordInfo.getSumNum() + "椤�");
+ redis.set(cacheKey, recordList, 90);
+ return;
+ } else {
+ // 鏈垎鏀〃绀哄綍鍍忚鎷嗗寘锛屼絾鍔犱笂涔嬪墠鐨勬暟鎹瓒冲锛岃繑鍥炲搷搴�
+ // 鍥犺澶囧績璺虫湁鐩戝惉redis杩囨湡鏈哄埗锛屼负鎻愰珮鎬ц兘锛屾澶勬墜鍔ㄥ垹闄�
+ logger.info("褰曞儚鏁版嵁宸插叏閮ㄨ幏鍙�");
+ redis.del(cacheKey);
+ }
+ } else {
+ // 鏈垎鏀湁涓ょ鍙兘锛�1銆佸綍鍍忓垪琛ㄨ鎷嗗寘锛屼笖鏄涓�涓寘,鐩存帴淇濆瓨缂撳瓨杩斿洖锛岀瓑寰呬笅涓寘鍐嶅鐞�
+ // 2銆佷箣鍓嶆湁鍖咃紝浣嗚秴鏃舵竻绌轰簡锛岄偅涔堣繖娆n鎵规鐨勫搷搴旀暟鎹凡缁忎笉瀹屾暣锛岀瓑寰呰繃鏈熸椂闂村悗redis鑷姩娓呯┖鏁版嵁
logger.info("宸茶幏鍙�" + recordList.size() + "椤瑰綍鍍忔暟鎹紝鍏�" + recordInfo.getSumNum() + "椤�");
+ logger.info("绛夊緟鍚庣画鐨勫寘...");
+
redis.set(cacheKey, recordList, 90);
return;
- } else {
- // 鏈垎鏀〃绀哄綍鍍忚鎷嗗寘锛屼絾鍔犱笂涔嬪墠鐨勬暟鎹瓒冲锛岃繑鍥炲搷搴�
- // 鍥犺澶囧績璺虫湁鐩戝惉redis杩囨湡鏈哄埗锛屼负鎻愰珮鎬ц兘锛屾澶勬墜鍔ㄥ垹闄�
- logger.info("褰曞儚鏁版嵁宸插叏閮ㄨ幏鍙�");
- redis.del(cacheKey);
}
- } else {
- // 鏈垎鏀湁涓ょ鍙兘锛�1銆佸綍鍍忓垪琛ㄨ鎷嗗寘锛屼笖鏄涓�涓寘,鐩存帴淇濆瓨缂撳瓨杩斿洖锛岀瓑寰呬笅涓寘鍐嶅鐞�
- // 2銆佷箣鍓嶆湁鍖咃紝浣嗚秴鏃舵竻绌轰簡锛岄偅涔堣繖娆n鎵规鐨勫搷搴旀暟鎹凡缁忎笉瀹屾暣锛岀瓑寰呰繃鏈熸椂闂村悗redis鑷姩娓呯┖鏁版嵁
- logger.info("绛夊緟鍚庣画鐨勫寘...");
-
- redis.set(cacheKey, recordList, 90);
- return;
}
-
+ // 鑷劧椤哄簭鎺掑簭, 鍏冪礌杩涜鍗囧簭鎺掑垪
+ recordInfo.getRecordList().sort(Comparator.naturalOrder());
}
// 璧板埌杩欓噷锛屾湁浠ヤ笅鍙兘锛�1銆佹病鏈夊綍鍍忎俊鎭�,绗竴娆℃敹鍒皉ecordinfo鐨勬秷鎭嵆杩斿洖鍝嶅簲鏁版嵁锛屾棤redis鎿嶄綔
// 2銆佹湁褰曞儚鏁版嵁锛屼笖绗竴娆″嵆鏀跺埌瀹屾暣鏁版嵁锛岃繑鍥炲搷搴旀暟鎹紝鏃爎edis鎿嶄綔
@@ -386,8 +389,8 @@
RequestMessage msg = new RequestMessage();
msg.setDeviceId(deviceId);
msg.setType(DeferredResultHolder.CALLBACK_CMD_RECORDINFO);
- // 鑷劧椤哄簭鎺掑簭, 鍏冪礌杩涜鍗囧簭鎺掑垪
- recordInfo.getRecordList().sort(Comparator.naturalOrder());
+ // // 鑷劧椤哄簭鎺掑簭, 鍏冪礌杩涜鍗囧簭鎺掑垪
+ // recordInfo.getRecordList().sort(Comparator.naturalOrder());
msg.setData(recordInfo);
deferredResultHolder.invokeResult(msg);
logger.info("澶勭悊瀹屾垚锛岃繑鍥炵粨鏋�");
diff --git a/src/main/java/com/genersoft/iot/vmp/storager/redis/VideoManagerRedisStoragerImpl.java b/src/main/java/com/genersoft/iot/vmp/storager/redis/VideoManagerRedisStoragerImpl.java
index 765dc82..b013c60 100644
--- a/src/main/java/com/genersoft/iot/vmp/storager/redis/VideoManagerRedisStoragerImpl.java
+++ b/src/main/java/com/genersoft/iot/vmp/storager/redis/VideoManagerRedisStoragerImpl.java
@@ -288,7 +288,7 @@
// devices.add((Device)redis.get((String)deviceIdList.get(i)));
device =(Device)redis.get((String)deviceIdList.get(i));
if (redis.scan(VideoManagerConstants.KEEPLIVEKEY_PREFIX+device.getDeviceId()).size() == 0){
- outline(device.getDeviceId());
+ // outline(device.getDeviceId());
}
devices.add(device);
}
@@ -297,7 +297,7 @@
// devices.add((Device)redis.get(VideoManagerConstants.DEVICE_PREFIX+deviceIds[i]));
device = (Device)redis.get(VideoManagerConstants.DEVICE_PREFIX+deviceIds[i]);
if (redis.scan(VideoManagerConstants.KEEPLIVEKEY_PREFIX+device.getDeviceId()).size() == 0){
- outline(device.getDeviceId());
+ // outline(device.getDeviceId());
}
devices.add(device);
}
diff --git a/web_src/src/components/control.vue b/web_src/src/components/control.vue
index 316db30..51bcb0a 100644
--- a/web_src/src/components/control.vue
+++ b/web_src/src/components/control.vue
@@ -1,346 +1,353 @@
<template>
- <div id="app">
- <el-container>
- <el-header>
- <uiHeader></uiHeader>
- </el-header>
- <el-main>
- <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: 1rem; top: 0.3rem;">
- <el-popover placement="bottom" width="750" height="300" trigger="click">
- <div style="height: 600px;overflow:auto;">
- <table class="table-c" cellspacing="0">
- <tr v-for="(value, key, index) in serverConfig">
- <td style="width: 18rem; text-align: right;">{{ key }}</td>
- <td style="width: 33rem; text-align:left">{{ value }}</td>
- </tr>
- </table>
- </div>
- <el-button type="primary" slot="reference" size="mini" @click="getServerConfig()">鏌ョ湅鏈嶅姟鍣ㄩ厤缃�</el-button>
- </el-popover>
- <el-button style="margin-left: 1rem;" type="danger" size="mini" @click="reStartServer()">閲嶅惎鏈嶅姟鍣�</el-button>
- </div>
- </div>
- <el-row :gutter="30">
- <el-col :span="12"><div class="control-table" id="ThreadsLoad">table1</div></el-col>
- <el-col :span="12"><div class="control-table" id="WorkThreadsLoad">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 slot="header" slot-scope="scope">
- <el-button icon="el-icon-refresh-right" circle @click="getAllSession()"></el-button>
- </template>
- <template slot-scope="scope">
- <el-button @click.native.prevent="deleteRow(scope.$index, allSessionData)" type="text" size="small">绉婚櫎</el-button>
- </template>
- </el-table-column>
- </el-table>
+<div id="app">
+ <el-container>
+ <el-header>
+ <uiHeader></uiHeader>
+ </el-header>
+ <el-main>
+ <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: 1rem; top: 0.3rem;">
+ <el-popover placement="bottom" width="750" height="300" trigger="click">
+ <div style="height: 600px;overflow:auto;">
+ <table class="table-c" cellspacing="0">
+ <tr v-for="(value, key, index) in serverConfig">
+ <td style="width: 18rem; text-align: right;">{{ key }}</td>
+ <td style="width: 33rem; text-align:left">{{ value }}</td>
+ </tr>
+ </table>
+ </div>
+ <el-button type="primary" slot="reference" size="mini" @click="getServerConfig()">鏌ョ湅鏈嶅姟鍣ㄩ厤缃�</el-button>
+ </el-popover>
+ <el-button style="margin-left: 1rem;" type="danger" size="mini" @click="reStartServer()">閲嶅惎鏈嶅姟鍣�</el-button>
+ </div>
+ </div>
+ <el-row :gutter="30">
+ <el-col :span="12">
+ <div class="control-table" id="ThreadsLoad">table1</div>
+ </el-col>
+ <el-col :span="12">
+ <div class="control-table" id="WorkThreadsLoad">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 slot="header" slot-scope="scope">
+ <el-button icon="el-icon-refresh-right" circle @click="getAllSession()"></el-button>
+ </template>
+ <template slot-scope="scope">
+ <el-button @click.native.prevent="deleteRow(scope.$index, allSessionData)" type="text" size="small">绉婚櫎</el-button>
+ </template>
+ </el-table-column>
+ </el-table>
- </el-main>
- <!-- <el-footer style="position: absolute; bottom: 0; width: 100%;">ZLMediaKit-VUE_UI v1</el-footer> -->
- </el-container>
+ </el-main>
+ <!-- <el-footer style="position: absolute; bottom: 0; width: 100%;">ZLMediaKit-VUE_UI v1</el-footer> -->
+ </el-container>
- </div>
+</div>
</template>
<script>
-
import uiHeader from './UiHeader.vue'
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,
- serverConfig: {}
- };
- },
- mounted() {
- this.getAllSession();
- this.initTable();
- this.updateData();
- this.chartInterval = setInterval(this.updateData, 3000);
- },
- destroyed() {
- clearInterval(this.chartInterval); //閲婃斁瀹氭椂浠诲姟
- },
- methods: {
- updateData: function() {
- this.getThreadsLoad();
- },
- /**
- * 鑾峰彇绾跨▼鐘舵��
- */
- getThreadsLoad: function() {
- let that = this;
- this.$axios({
- method: 'get',
- url: '/zlm/index/api/getThreadsLoad'
- }).then(function(res) {
- if (res.data.code == 0) {
- that.tableOption.xAxis.data.push(new Date().toLocaleTimeString());
- that.table1Option.xAxis.data.push(new Date().toLocaleTimeString());
+ 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,
+ serverConfig: {}
+ };
+ },
+ mounted() {
+ this.getAllSession();
+ this.initTable();
+ this.updateData();
+ this.chartInterval = setInterval(this.updateData, 3000);
+ },
+ destroyed() {
+ clearInterval(this.chartInterval); //閲婃斁瀹氭椂浠诲姟
+ },
+ methods: {
+ updateData: function () {
+ this.getThreadsLoad();
+ },
+ /**
+ * 鑾峰彇绾跨▼鐘舵��
+ */
+ getThreadsLoad: function () {
+ let that = this;
+ this.$axios({
+ method: 'get',
+ url: '/zlm/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);
- }
- });
- },
- 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;
- }
- });
+ 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);
+ }
+ });
+ },
+ 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;
- }
- });
- },
+ 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() {
- let that = this;
- that.allSessionData = [];
- console.log("鍦板潃锛�"+'/zlm/index/api/getAllSession');
- this.$axios({
- method: 'get',
- url: '/zlm/index/api/getAllSession'
- }).then(function(res) {
- res.data.data.forEach(item => {
- let data = {
- peer_ip: item.peer_ip,
- local_ip: item.local_ip,
- typeid: item.typeid,
- id: item.id
- };
- that.allSessionData.push(data);
- });
- });
- },
- getServerConfig: function() {
- let that = this;
- this.$axios({
- method: 'get',
- url: '/zlm/index/api/getServerConfig'
- }).then(function(res) {
- that.serverConfig = res.data.data[0];
- that.visible = true;
- });
- },
- reStartServer: function() {
- let that = this;
- this.$confirm('姝ゆ搷浣滃皢閲嶅惎濯掍綋鏈嶅姟鍣�, 鏄惁缁х画?', '鎻愮ず', {
- confirmButtonText: '纭畾',
- cancelButtonText: '鍙栨秷',
- type: 'warning'
- }).then(() => {
- let that = this;
- this.$axios({
- method: 'get',
- url: '/zlm/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) {
- let that = this;
- this.$axios({
- method: 'get',
- url: '/zlm/index/api/kick_session&id=' + id
- }).then(function(res) {
- that.getAllSession();
- that.$message({
- type: 'success',
- message: '鍒犻櫎鎴愬姛!'
- });
- });
- }
- }
+ getAllSession: function () {
+ let that = this;
+ that.allSessionData = [];
+ console.log("鍦板潃锛�" + '/zlm/index/api/getAllSession');
+ this.$axios({
+ method: 'get',
+ url: '/zlm/index/api/getAllSession'
+ }).then(function (res) {
+ res.data.data.forEach(item => {
+ let data = {
+ peer_ip: item.peer_ip,
+ local_ip: item.local_ip,
+ typeid: item.typeid,
+ id: item.id
+ };
+ that.allSessionData.push(data);
+ });
+ });
+ },
+ getServerConfig: function () {
+ let that = this;
+ this.$axios({
+ method: 'get',
+ url: '/zlm/index/api/getServerConfig'
+ }).then(function (res) {
+ that.serverConfig = res.data.data[0];
+ that.visible = true;
+ });
+ },
+ reStartServer: function () {
+ let that = this;
+ this.$confirm('姝ゆ搷浣滃皢閲嶅惎濯掍綋鏈嶅姟鍣�, 鏄惁缁х画?', '鎻愮ず', {
+ confirmButtonText: '纭畾',
+ cancelButtonText: '鍙栨秷',
+ type: 'warning'
+ }).then(() => {
+ let that = this;
+ this.$axios({
+ method: 'get',
+ url: '/zlm/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) {
+ let that = this;
+ this.$axios({
+ method: 'get',
+ url: '/zlm/index/api/kick_session&id=' + id
+ }).then(function (res) {
+ that.getAllSession();
+ that.$message({
+ type: 'success',
+ message: '鍒犻櫎鎴愬姛!'
+ });
+ });
+ }
+ }
};
</script>
<style>
#app {
- height: 100%;
+ height: 100%;
}
+
.control-table {
- background-color: #ffffff;
- height: 25rem;
+ background-color: #ffffff;
+ height: 25rem;
}
+
.table-c {
- border-right: 1px solid #dcdcdc;
- border-bottom: 1px solid #dcdcdc;
+ 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;
+ border-left: 1px solid #dcdcdc;
+ border-top: 1px solid #dcdcdc;
+ padding: 0.2rem;
}
+
.el-table {
- width: 99.9% !important;
+ width: 99.9% !important;
}
</style>
diff --git a/web_src/src/components/gb28181/devicePlayer.vue b/web_src/src/components/gb28181/devicePlayer.vue
index b8e45ba..780d03e 100644
--- a/web_src/src/components/gb28181/devicePlayer.vue
+++ b/web_src/src/components/gb28181/devicePlayer.vue
@@ -223,15 +223,15 @@
play: function (streamInfo, hasAudio) {
this.hasaudio = hasAudio;
// 鏍规嵁濯掍綋娴佷俊鎭簩娆″垽鏂�
+ var realHasAudio = false;
if (!!streamInfo.tracks && streamInfo.tracks.length > 0 && hasAudio) {
- var realHasAudio = false;
for (let i = 0; i < streamInfo.tracks.length; i++) {
if (streamInfo.tracks[i].codec_type == 1 && streamInfo.tracks[i].codec_id_name == "CodecAAC") { // 鍒ゆ柇涓篈AC闊抽
realHasAudio = true;
}
}
- this.hasaudio = realHasAudio && this.hasaudio;
}
+ this.hasaudio = realHasAudio && this.hasaudio;
this.ssrc = streamInfo.ssrc;
// this.$refs.videoPlayer.hasaudio = hasAudio;
// this.videoUrl = streamInfo.flv + "?" + new Date().getTime();
--
Gitblit v1.8.0