control.vue 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719
  1. <template>
  2. <div id="app" style="width: 100%">
  3. <div class="page-header">
  4. <div class="page-title">控制台</div>
  5. <div class="page-header-btn">
  6. 节点选择:
  7. <el-select size="mini" @change="chooseMediaChange" style="width: 18rem; margin-right: 8rem;"
  8. v-model="mediaServerChoose" placeholder="请选择" default-first-option>
  9. <el-option
  10. v-for="item in mediaServerList"
  11. :key="item.id"
  12. :label="item.id + '( ' + item.streamIp + ' )'"
  13. :value="item.id">
  14. </el-option>
  15. </el-select>
  16. <span>{{ loadCount }}</span>
  17. </div>
  18. <div class="page-header-btn">
  19. <el-popover placement="bottom" width="900" height="300" trigger="click">
  20. <div style="height: 600px; overflow:auto; padding: 20px">
  21. <el-descriptions v-for="(value, key, index) in serverConfig" :key="key" border :column="1"
  22. style="margin-bottom: 1rem">
  23. <template slot="title">
  24. {{ key }}
  25. </template>
  26. <el-descriptions-item v-for="(value1, key1, index1) in serverConfig[key]" :key="key1">
  27. <template slot="label">
  28. {{ getMediaKeyNameFromKey(key1) }}
  29. </template>
  30. {{ value1 }}
  31. </el-descriptions-item>
  32. </el-descriptions>
  33. </div>
  34. <el-button type="primary" slot="reference" size="mini" @click="getServerConfig()">媒体服务器配置</el-button>
  35. </el-popover>
  36. <el-popover placement="bottom" width="900" height="300" trigger="click">
  37. <div style="height: 600px;overflow:auto; padding: 20px">
  38. <el-descriptions title="国标配置" border :column="1">
  39. <template slot="extra">
  40. <el-button style="float: right;" type="primary" size="mini" icon="el-icon-document-copy" title="点击拷贝"
  41. v-clipboard="JSON.stringify(wvpServerConfig.sip)|| ''"
  42. @success="$message({type:'success', message:'成功拷贝到粘贴板'})"></el-button>
  43. </template>
  44. <el-descriptions-item v-for="(value, key, index) in wvpServerConfig.sip" :key="key">
  45. <template slot="label">
  46. {{ getNameFromKey(key) }}
  47. </template>
  48. {{ value }}
  49. </el-descriptions-item>
  50. </el-descriptions>
  51. <div style="margin-top: 1rem">
  52. <el-descriptions title="基础配置" border :column="1">
  53. <template slot="extra">
  54. <el-button style="float: right;" type="primary" size="mini" icon="el-icon-document-copy" title="点击拷贝"
  55. v-clipboard="JSON.stringify(wvpServerConfig.base)|| ''"
  56. @success="$message({type:'success', message:'成功拷贝到粘贴板'})"></el-button>
  57. </template>
  58. <el-descriptions-item v-for="(value, key, index) in wvpServerConfig.base" :key="key">
  59. <template slot="label">
  60. {{ getNameFromKey(key) }}
  61. </template>
  62. <div v-if="key === 'interfaceAuthenticationExcludes'">
  63. <el-dropdown>
  64. <span class="el-dropdown-link">
  65. 查看<i class="el-icon-arrow-down el-icon--right"></i>
  66. </span>
  67. <el-dropdown-menu slot="dropdown">
  68. <el-dropdown-item
  69. v-for="(value, key, index) in wvpServerConfig.base.interfaceAuthenticationExcludes"
  70. :key="key">{{ value }}
  71. </el-dropdown-item>
  72. </el-dropdown-menu>
  73. </el-dropdown>
  74. </div>
  75. <div v-if="key !== 'interfaceAuthenticationExcludes'">
  76. <div v-if="value === true">
  77. 已启用
  78. </div>
  79. <div v-if="value === false">
  80. 未启用
  81. </div>
  82. <div v-if="value !== true && value !== false">
  83. {{ value }}
  84. </div>
  85. </div>
  86. </el-descriptions-item>
  87. </el-descriptions>
  88. </div>
  89. <div style="margin-top: 1rem">
  90. <el-descriptions title="版本信息" border :column="1">
  91. <template slot="extra">
  92. <el-button style="float: right;" type="primary" size="mini" icon="el-icon-document-copy" title="点击拷贝"
  93. v-clipboard="JSON.stringify(wvpServerVersion) || ''"
  94. @success="$message({type:'success', message:'成功拷贝到粘贴板'})"></el-button>
  95. </template>
  96. <el-descriptions-item v-for="(value, key, index) in wvpServerVersion" :key="key">
  97. <template slot="label">
  98. {{ getNameFromKey(key) }}
  99. </template>
  100. {{ value }}
  101. </el-descriptions-item>
  102. </el-descriptions>
  103. </div>
  104. </div>
  105. <el-button type="primary" slot="reference" size="mini" @click="getWVPServerConfig()">信令服务器配置</el-button>
  106. </el-popover>
  107. <el-button style="margin-left: 1rem;" type="danger" size="mini" @click="reStartServer()">重启媒体服务器</el-button>
  108. </div>
  109. </div>
  110. <!-- <div style="background-color: #FFFFFF; margin-bottom: 1rem; position: relative; padding: 0.5rem; text-align: left;">-->
  111. <!-- <span style="font-size: 1rem; font-weight: bold;">控制台</span>-->
  112. <!-- <div style="position: absolute; right: 17rem; top: 0.3rem;">-->
  113. <!-- 节点选择:-->
  114. <!-- <el-select size="mini" @change="chooseMediaChange" style="width: 18rem; margin-right: 8rem;"-->
  115. <!-- v-model="mediaServerChoose" placeholder="请选择" default-first-option>-->
  116. <!-- <el-option-->
  117. <!-- v-for="item in mediaServerList"-->
  118. <!-- :key="item.id"-->
  119. <!-- :label="item.id + '( ' + item.streamIp + ' )'"-->
  120. <!-- :value="item.id">-->
  121. <!-- </el-option>-->
  122. <!-- </el-select>-->
  123. <!-- <span>{{ loadCount }}</span>-->
  124. <!-- </div>-->
  125. <!-- <div style="position: absolute; right: 1rem; top: 0.3rem;">-->
  126. <!-- <el-popover placement="bottom" width="900" height="300" trigger="click">-->
  127. <!-- <div style="height: 600px; overflow:auto; padding: 20px">-->
  128. <!-- <el-descriptions v-for="(value, key, index) in serverConfig" :key="key" border :column="1"-->
  129. <!-- style="margin-bottom: 1rem">-->
  130. <!-- <template slot="title">-->
  131. <!-- {{ key }}-->
  132. <!-- </template>-->
  133. <!-- <el-descriptions-item v-for="(value1, key1, index1) in serverConfig[key]" :key="key1">-->
  134. <!-- <template slot="label">-->
  135. <!-- {{ getMediaKeyNameFromKey(key1) }}-->
  136. <!-- </template>-->
  137. <!-- {{ value1 }}-->
  138. <!-- </el-descriptions-item>-->
  139. <!-- </el-descriptions>-->
  140. <!-- </div>-->
  141. <!-- <el-button type="primary" slot="reference" size="mini" @click="getServerConfig()">媒体服务器配置</el-button>-->
  142. <!-- </el-popover>-->
  143. <!-- <el-popover placement="bottom" width="900" height="300" trigger="click">-->
  144. <!-- <div style="height: 600px;overflow:auto; padding: 20px">-->
  145. <!-- <el-descriptions title="国标配置" border :column="1">-->
  146. <!-- <template slot="extra">-->
  147. <!-- <el-button style="float: right;" type="primary" size="mini" icon="el-icon-document-copy" title="点击拷贝"-->
  148. <!-- v-clipboard="JSON.stringify(wvpServerConfig.sip)|| ''"-->
  149. <!-- @success="$message({type:'success', message:'成功拷贝到粘贴板'})"></el-button>-->
  150. <!-- </template>-->
  151. <!-- <el-descriptions-item v-for="(value, key, index) in wvpServerConfig.sip" :key="key">-->
  152. <!-- <template slot="label">-->
  153. <!-- {{ getNameFromKey(key) }}-->
  154. <!-- </template>-->
  155. <!-- {{ value }}-->
  156. <!-- </el-descriptions-item>-->
  157. <!-- </el-descriptions>-->
  158. <!-- <div style="margin-top: 1rem">-->
  159. <!-- <el-descriptions title="基础配置" border :column="1">-->
  160. <!-- <template slot="extra">-->
  161. <!-- <el-button style="float: right;" type="primary" size="mini" icon="el-icon-document-copy" title="点击拷贝"-->
  162. <!-- v-clipboard="JSON.stringify(wvpServerConfig.base)|| ''"-->
  163. <!-- @success="$message({type:'success', message:'成功拷贝到粘贴板'})"></el-button>-->
  164. <!-- </template>-->
  165. <!-- <el-descriptions-item v-for="(value, key, index) in wvpServerConfig.base" :key="key">-->
  166. <!-- <template slot="label">-->
  167. <!-- {{ getNameFromKey(key) }}-->
  168. <!-- </template>-->
  169. <!-- <div v-if="key === 'interfaceAuthenticationExcludes'">-->
  170. <!-- <el-dropdown>-->
  171. <!-- <span class="el-dropdown-link">-->
  172. <!-- 查看<i class="el-icon-arrow-down el-icon&#45;&#45;right"></i>-->
  173. <!-- </span>-->
  174. <!-- <el-dropdown-menu slot="dropdown">-->
  175. <!-- <el-dropdown-item-->
  176. <!-- v-for="(value, key, index) in wvpServerConfig.base.interfaceAuthenticationExcludes"-->
  177. <!-- :key="key">{{ value }}-->
  178. <!-- </el-dropdown-item>-->
  179. <!-- </el-dropdown-menu>-->
  180. <!-- </el-dropdown>-->
  181. <!-- </div>-->
  182. <!-- <div v-if="key !== 'interfaceAuthenticationExcludes'">-->
  183. <!-- <div v-if="value === true">-->
  184. <!-- 已启用-->
  185. <!-- </div>-->
  186. <!-- <div v-if="value === false">-->
  187. <!-- 未启用-->
  188. <!-- </div>-->
  189. <!-- <div v-if="value !== true && value !== false">-->
  190. <!-- {{ value }}-->
  191. <!-- </div>-->
  192. <!-- </div>-->
  193. <!-- </el-descriptions-item>-->
  194. <!-- </el-descriptions>-->
  195. <!-- </div>-->
  196. <!-- <div style="margin-top: 1rem">-->
  197. <!-- <el-descriptions title="版本信息" border :column="1">-->
  198. <!-- <template slot="extra">-->
  199. <!-- <el-button style="float: right;" type="primary" size="mini" icon="el-icon-document-copy" title="点击拷贝"-->
  200. <!-- v-clipboard="JSON.stringify(wvpServerVersion) || ''"-->
  201. <!-- @success="$message({type:'success', message:'成功拷贝到粘贴板'})"></el-button>-->
  202. <!-- </template>-->
  203. <!-- <el-descriptions-item v-for="(value, key, index) in wvpServerVersion" :key="key">-->
  204. <!-- <template slot="label">-->
  205. <!-- {{ getNameFromKey(key) }}-->
  206. <!-- </template>-->
  207. <!-- {{ value }}-->
  208. <!-- </el-descriptions-item>-->
  209. <!-- </el-descriptions>-->
  210. <!-- </div>-->
  211. <!-- </div>-->
  212. <!-- <el-button type="primary" slot="reference" size="mini" @click="getWVPServerConfig()">信令服务器配置</el-button>-->
  213. <!-- </el-popover>-->
  214. <!-- <el-button style="margin-left: 1rem;" type="danger" size="mini" @click="reStartServer()">重启媒体服务器</el-button>-->
  215. <!-- </div>-->
  216. <!-- </div>-->
  217. <el-row style="width: 100%">
  218. <el-col :span="12">
  219. <div class="control-table" id="ThreadsLoad" style="margin-right:10px;">table1</div>
  220. </el-col>
  221. <el-col :span="12">
  222. <div class="control-table" id="WorkThreadsLoad" style="margin-left:10px;">table2</div>
  223. </el-col>
  224. </el-row>
  225. <el-table :data="allSessionData" style="margin-top: 1rem;">
  226. <el-table-column prop="peer_ip" label="远端"></el-table-column>
  227. <el-table-column prop="local_ip" label="本地"></el-table-column>
  228. <el-table-column prop="typeid" label="类型"></el-table-column>
  229. <el-table-column align="right">
  230. <template v-slot:default="scope">
  231. <el-button size="mini" icon="el-icon-refresh-right" circle @click="getAllSession()"></el-button>
  232. <el-button @click.native.prevent="deleteRow(scope.$index, allSessionData)" type="text" size="small">移除
  233. </el-button>
  234. </template>
  235. </el-table-column>
  236. </el-table>
  237. </div>
  238. </template>
  239. <script>
  240. import uiHeader from '../layout/UiHeader.vue'
  241. import MediaServer from './service/MediaServer'
  242. import echarts from 'echarts';
  243. import handle from "@/until/handle";
  244. export default {
  245. name: 'app',
  246. components: {
  247. echarts,
  248. uiHeader
  249. },
  250. data() {
  251. return {
  252. tableOption: {
  253. // legend: {},
  254. xAxis: {},
  255. yAxis: {},
  256. label: {},
  257. tooltip: {},
  258. dataZoom: [],
  259. series: []
  260. },
  261. table1Option: {
  262. // legend: {},
  263. xAxis: {},
  264. yAxis: {},
  265. label: {},
  266. tooltip: {},
  267. series: []
  268. },
  269. mChart: null,
  270. mChart1: null,
  271. charZoomStart: 0,
  272. charZoomEnd: 100,
  273. chartInterval: 0, //更新图表统计图定时任务标识
  274. allSessionData: [],
  275. visible: false,
  276. wvpVisible: false,
  277. serverConfig: {},
  278. wvpServerConfig: {},
  279. wvpServerVersion: {},
  280. mediaServer: new MediaServer(),
  281. mediaServerChoose: null,
  282. loadCount: 0,
  283. mediaServerList: []
  284. };
  285. },
  286. beforeMount() {
  287. },
  288. mounted() {
  289. this.initTable()
  290. this.chartInterval = setInterval(this.updateData, 3000);
  291. this.mediaServer.getOnlineMediaServerList((data) => {
  292. this.mediaServerList = data.data;
  293. if (this.mediaServerList && this.mediaServerList.length > 0) {
  294. this.mediaServerChoose = this.mediaServerList[0].id
  295. this.loadCount = this.mediaServerList[0].count;
  296. this.updateData();
  297. }
  298. })
  299. },
  300. destroyed() {
  301. clearInterval(this.chartInterval); //释放定时任务
  302. },
  303. methods: {
  304. chooseMediaChange: function (val) {
  305. this.loadCount = 0
  306. this.initTable()
  307. this.updateData();
  308. },
  309. updateData: function () {
  310. this.getThreadsLoad();
  311. this.getLoadCount();
  312. this.getAllSession();
  313. },
  314. /**
  315. * 获取线程状态
  316. */
  317. getThreadsLoad: function () {
  318. let that = this;
  319. if (!!that.mediaServerChoose) {
  320. this.$axios.axios({
  321. method: 'get',
  322. url: '/zlm/' + that.mediaServerChoose + '/index/api/getThreadsLoad'
  323. }).then(function (res) {
  324. if (res.data.code === 0) {
  325. that.tableOption.xAxis.data.push(new Date().toLocaleTimeString('chinese', {
  326. hour12: false
  327. }));
  328. that.table1Option.xAxis.data.push(new Date().toLocaleTimeString('chinese', {
  329. hour12: false
  330. }));
  331. for (var i = 0; i < res.data.data.length; i++) {
  332. if (that.tableOption.series[i] === undefined) {
  333. let data = {
  334. data: [],
  335. type: 'line'
  336. };
  337. let data1 = {
  338. data: [],
  339. type: 'line'
  340. };
  341. data.data.push(res.data.data[i].delay);
  342. data1.data.push(res.data.data[i].load);
  343. that.tableOption.series.push(data);
  344. that.table1Option.series.push(data1);
  345. } else {
  346. that.tableOption.series[i].data.push(res.data.data[i].delay);
  347. that.table1Option.series[i].data.push(res.data.data[i].load);
  348. }
  349. }
  350. that.tableOption.dataZoom[0].start = that.charZoomStart;
  351. that.tableOption.dataZoom[0].end = that.charZoomEnd;
  352. that.table1Option.dataZoom[0].start = that.charZoomStart;
  353. that.table1Option.dataZoom[0].end = that.charZoomEnd;
  354. //that.myChart = echarts.init(document.getElementById('ThreadsLoad'));
  355. that.myChart.setOption(that.tableOption, true);
  356. // that.myChart1 = echarts.init(document.getElementById('WorkThreadsLoad'));
  357. that.myChart1.setOption(that.table1Option, true);
  358. that.$nextTick(() => {
  359. that.myChart.resize()
  360. that.myChart1.resize()
  361. })
  362. }
  363. });
  364. }
  365. },
  366. getLoadCount: function () {
  367. let that = this;
  368. if (!!that.mediaServerChoose) {
  369. that.mediaServer.getMediaServer(that.mediaServerChoose, (data) => {
  370. if (data.code == 0) {
  371. that.loadCount = data.data.count
  372. }
  373. })
  374. }
  375. },
  376. initTable: function () {
  377. let that = this;
  378. this.tableOption.xAxis = {
  379. type: 'category',
  380. data: [], // x轴数据
  381. name: '时间', // x轴名称
  382. // x轴名称样式
  383. nameTextStyle: {
  384. fontWeight: 300,
  385. fontSize: 15
  386. }
  387. };
  388. this.tableOption.yAxis = {
  389. type: 'value',
  390. name: '延迟率', // y轴名称
  391. boundaryGap: [0, '100%'],
  392. max: 100,
  393. axisLabel: {
  394. show: true,
  395. interval: 'auto',
  396. formatter: '{value} %'
  397. },
  398. // y轴名称样式
  399. nameTextStyle: {
  400. fontWeight: 300,
  401. fontSize: 15
  402. }
  403. };
  404. this.tableOption.dataZoom = [{
  405. show: true,
  406. start: this.charZoomStart,
  407. end: this.charZoomEnd
  408. }];
  409. this.myChart = echarts.init(document.getElementById('ThreadsLoad'));
  410. this.myChart.setOption(this.tableOption);
  411. this.myChart.on('dataZoom', function (event) {
  412. if (event.batch) {
  413. that.charZoomStart = event.batch[0].start;
  414. that.charZoomEnd = event.batch[0].end;
  415. } else {
  416. that.charZoomStart = event.start;
  417. that.charZoomEnd = event.end;
  418. }
  419. });
  420. this.table1Option.xAxis = {
  421. type: 'category',
  422. data: [], // x轴数据
  423. name: '时间', // x轴名称
  424. // x轴名称样式
  425. nameTextStyle: {
  426. fontWeight: 300,
  427. fontSize: 15
  428. }
  429. };
  430. this.table1Option.yAxis = {
  431. type: 'value',
  432. name: '负载率', // y轴名称
  433. boundaryGap: [0, '100%'],
  434. max: 100,
  435. axisLabel: {
  436. show: true,
  437. interval: 'auto',
  438. formatter: '{value} %'
  439. },
  440. // y轴名称样式
  441. nameTextStyle: {
  442. fontWeight: 300,
  443. fontSize: 15
  444. }
  445. };
  446. this.table1Option.dataZoom = [{
  447. show: true,
  448. start: this.charZoomStart,
  449. end: this.charZoomEnd
  450. }];
  451. this.myChart1 = echarts.init(document.getElementById('WorkThreadsLoad'));
  452. this.myChart1.setOption(this.table1Option);
  453. this.myChart1.on('dataZoom', function (event) {
  454. if (event.batch) {
  455. that.charZoomStart = event.batch[0].start;
  456. that.charZoomEnd = event.batch[0].end;
  457. } else {
  458. that.charZoomStart = event.start;
  459. that.charZoomEnd = event.end;
  460. }
  461. });
  462. },
  463. getAllSession: function () {
  464. this.allSessionData = [];
  465. if (!!this.mediaServerChoose) {
  466. this.$axios.axios({
  467. method: 'get',
  468. url: '/zlm/' + this.mediaServerChoose + '/index/api/getAllSession'
  469. }).then((res)=> {
  470. res.data.data.forEach(item => {
  471. let data = {
  472. peer_ip: item.peer_ip,
  473. local_ip: item.local_ip,
  474. typeid: item.typeid,
  475. id: item.id
  476. };
  477. this.allSessionData.push(data);
  478. });
  479. });
  480. }
  481. },
  482. getServerConfig: function () {
  483. if (!!this.mediaServerChoose) {
  484. this.$axios.axios({
  485. method: 'get',
  486. url: '/zlm/' + this.mediaServerChoose + '/index/api/getServerConfig'
  487. }).then((res)=> {
  488. let info = res.data.data[0];
  489. let serverInfo = {}
  490. for (let i = 0; i < Object.keys(info).length; i++) {
  491. let key = Object.keys(info)[i];
  492. let group = key.substring(0, key.indexOf("."))
  493. let itemKey = key.substring(key.indexOf(".") + 1)
  494. if (!serverInfo[group]) serverInfo[group] = {}
  495. serverInfo[group][itemKey] = info[key]
  496. }
  497. this.serverConfig = serverInfo;
  498. this.visible = true;
  499. });
  500. }
  501. },
  502. getWVPServerConfig: function () {
  503. let that = this;
  504. this.$axios.axios({
  505. method: 'get',
  506. url: '/api/server/config'
  507. }).then(function (res) {
  508. console.log(res)
  509. that.wvpServerConfig = res.data.data;
  510. that.wvpVisible = true;
  511. });
  512. this.$axios.axios({
  513. method: 'get',
  514. url: '/api/server/version'
  515. }).then(function (res) {
  516. console.log(res)
  517. that.wvpServerVersion = res.data.data;
  518. that.wvpVisible = true;
  519. });
  520. },
  521. reStartServer: function () {
  522. let that = this;
  523. if (!!!this.mediaServerChoose) {
  524. this.$message({
  525. type: 'info',
  526. message: '未选择节点'
  527. });
  528. return;
  529. }
  530. this.$confirm('此操作将重启媒体服务器, 是否继续?', '提示', {
  531. confirmButtonText: '确定',
  532. cancelButtonText: '取消',
  533. type: 'warning'
  534. }).then(() => {
  535. let that = this;
  536. this.$axios.axios({
  537. method: 'get',
  538. url: '/zlm/' + that.mediaServerChoose + '/index/api/restartServer'
  539. }).then(function (res) {
  540. that.getAllSession();
  541. if (res.data.code === 0) {
  542. that.$message({
  543. type: 'success',
  544. message: '操作完成'
  545. });
  546. }
  547. });
  548. });
  549. },
  550. deleteRow: function (index, tabledata) {
  551. let that = this;
  552. this.$confirm('此操作将断开该通信链路, 是否继续?', '提示', {
  553. confirmButtonText: '确定',
  554. cancelButtonText: '取消',
  555. type: 'warning'
  556. })
  557. .then(() => {
  558. that.deleteSession(tabledata[index].id);
  559. })
  560. .catch(() => {
  561. console.log('id:' + JSON.stringify(tabledata[index]));
  562. this.$message({
  563. type: 'info',
  564. message: '已取消删除'
  565. });
  566. });
  567. console.log(JSON.stringify(tabledata[index]));
  568. },
  569. deleteSession: function (id) {
  570. if (!!this.mediaServerChoose) {
  571. this.$axios.axios({
  572. method: 'get',
  573. url: '/zlm/' + this.mediaServerChoose + '/index/api/kick_session?id=' + id
  574. }).then((res)=>{
  575. this.getAllSession();
  576. this.$message({
  577. type: 'success',
  578. message: '删除成功!'
  579. });
  580. });
  581. }
  582. },
  583. getNameFromKey: function (key) {
  584. let nameData = {
  585. "waitTrack": "等待编码信息",
  586. "interfaceAuthenticationExcludes": "不进行鉴权的接口",
  587. "playTimeout": "点播超时时间",
  588. "autoApplyPlay": "自动点播",
  589. "recordPushLive": "推流录像",
  590. "redisConfig": "自动配置redis",
  591. "thirdPartyGBIdReg": "stream信息正则",
  592. "savePositionHistory": "保存轨迹信息",
  593. "interfaceAuthentication": "接口鉴权",
  594. "serverId": "服务ID",
  595. "logInDatebase": "日志存储进数据库",
  596. "seniorSdp": "扩展SDP",
  597. "password": "密码",
  598. "port": "端口号",
  599. "keepaliveTimeOut": "心跳超时",
  600. "domain": "国标域",
  601. "ip": "IP地址",
  602. "monitorIp": "监听IP",
  603. "alarm": "存储报警信息",
  604. "ptzSpeed": "云台控制速度",
  605. "id": "国标ID",
  606. "registerTimeInterval": "注册间隔",
  607. "artifactId": "模块名称",
  608. "version": "版本",
  609. "project": "工程",
  610. "git_Revision": "GIT修订版本",
  611. "git_BRANCH": "GIT分支",
  612. "git_URL": "GIT地址",
  613. "build_DATE": "构建时间",
  614. "create_By": "作者",
  615. "git_Revision_SHORT": "GIT修订版本(短)",
  616. "build_Jdk": "构建用JDK",
  617. };
  618. console.log(key + ": " + nameData[key])
  619. if (nameData[key]) {
  620. return nameData[key]
  621. } else {
  622. return key;
  623. }
  624. },
  625. getMediaKeyNameFromKey: function (key) {
  626. let nameData = {
  627. "waitTrack": "等待编码信息",
  628. "interfaceAuthenticationExcludes": "不进行鉴权的接口",
  629. "playTimeout": "点播超时时间",
  630. "autoApplyPlay": "自动点播",
  631. "recordPushLive": "推流录像",
  632. "redisConfig": "自动配置redis",
  633. "thirdPartyGBIdReg": "stream信息正则",
  634. "savePositionHistory": "保存轨迹信息",
  635. "interfaceAuthentication": "接口鉴权",
  636. "serverId": "服务ID",
  637. "logInDatebase": "日志存储进数据库",
  638. "seniorSdp": "扩展SDP",
  639. "password": "密码",
  640. "port": "端口号",
  641. "keepaliveTimeOut": "心跳超时",
  642. "domain": "国标域",
  643. "ip": "IP地址",
  644. "monitorIp": "监听IP",
  645. "alarm": "存储报警信息",
  646. "ptzSpeed": "云台控制速度",
  647. "id": "国标ID",
  648. "registerTimeInterval": "注册间隔",
  649. "artifactId": "模块名称",
  650. "version": "版本",
  651. "project": "工程",
  652. "git_Revision": "GIT修订版本",
  653. "git_BRANCH": "GIT分支",
  654. "git_URL": "GIT地址",
  655. "build_DATE": "构建时间",
  656. "create_By": "作者",
  657. "git_Revision_SHORT": "GIT修订版本(短)",
  658. "build_Jdk": "构建用JDK",
  659. };
  660. console.log(key + ": " + nameData[key])
  661. if (nameData[key]) {
  662. return nameData[key]
  663. } else {
  664. return key;
  665. }
  666. }
  667. }
  668. };
  669. </script>
  670. <style>
  671. #app {
  672. height: 100%;
  673. }
  674. .control-table {
  675. background-color: #ffffff;
  676. height: 25rem;
  677. }
  678. .table-c {
  679. border-right: 1px solid #dcdcdc;
  680. border-bottom: 1px solid #dcdcdc;
  681. }
  682. .table-c td {
  683. border-left: 1px solid #dcdcdc;
  684. border-top: 1px solid #dcdcdc;
  685. padding: 0.2rem;
  686. }
  687. .el-table {
  688. width: 99.9% !important;
  689. }
  690. </style>