Commit d7afcab6016f46fa5f40962a079d003ebdf9172b
1 parent
8d5764b9
优化媒体服务器配置展示界面
Showing
1 changed file
with
71 additions
and
13 deletions
web_src/src/components/control.vue
| ... | ... | @@ -19,25 +19,30 @@ |
| 19 | 19 | <span >{{loadCount}}</span> |
| 20 | 20 | </div> |
| 21 | 21 | <div style="position: absolute; right: 1rem; top: 0.3rem;"> |
| 22 | - <el-popover placement="bottom" width="750" height="300" trigger="click"> | |
| 23 | - <div style="height: 600px;overflow:auto;"> | |
| 24 | - <table class="table-c" cellspacing="0"> | |
| 25 | - <tr v-for="(value, key, index) in serverConfig"> | |
| 26 | - <td style="width: 18rem; text-align: right;">{{ key }}</td> | |
| 27 | - <td style="width: 33rem; text-align:left">{{ value }}</td> | |
| 28 | - </tr> | |
| 29 | - </table> | |
| 22 | + <el-popover placement="bottom" width="900" height="300" trigger="click"> | |
| 23 | + <div style="height: 600px; overflow:auto; padding: 20px"> | |
| 24 | + <el-descriptions v-for="(value, key, index) in serverConfig" border column="1" style="margin-bottom: 1rem"> | |
| 25 | + <template slot="title"> | |
| 26 | + {{key}} | |
| 27 | + </template> | |
| 28 | + <el-descriptions-item v-for="(value1, key1, index1) in serverConfig[key]"> | |
| 29 | + <template slot="label" > | |
| 30 | + {{ getMediaKeyNameFromKey(key1) }} | |
| 31 | + </template> | |
| 32 | + {{ value1 }} | |
| 33 | + </el-descriptions-item> | |
| 34 | + </el-descriptions> | |
| 30 | 35 | </div> |
| 31 | 36 | <el-button type="primary" slot="reference" size="mini" @click="getServerConfig()">媒体服务器配置</el-button> |
| 32 | 37 | </el-popover> |
| 33 | 38 | <el-popover placement="bottom" width="900" height="300" trigger="click"> |
| 34 | 39 | <div style="height: 600px;overflow:auto; padding: 20px"> |
| 35 | 40 | |
| 36 | - <el-descriptions title="基础配置" border> | |
| 41 | + <el-descriptions title="基础配置" border column="1"> | |
| 37 | 42 | <template slot="extra"> |
| 38 | 43 | <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> |
| 39 | 44 | </template> |
| 40 | - <el-descriptions-item v-for="(value, key, index) in wvpServerConfig.base"> | |
| 45 | + <el-descriptions-item v-for="(value, key, index) in wvpServerConfig.base" > | |
| 41 | 46 | <template slot="label" > |
| 42 | 47 | {{ getNameFromKey(key) }} |
| 43 | 48 | </template> |
| ... | ... | @@ -66,7 +71,7 @@ |
| 66 | 71 | </el-descriptions-item> |
| 67 | 72 | </el-descriptions> |
| 68 | 73 | <div style="margin-top: 1rem"> |
| 69 | - <el-descriptions title="国标配置" border> | |
| 74 | + <el-descriptions title="国标配置" border column="1"> | |
| 70 | 75 | <template slot="extra"> |
| 71 | 76 | <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> |
| 72 | 77 | </template> |
| ... | ... | @@ -79,7 +84,7 @@ |
| 79 | 84 | </el-descriptions> |
| 80 | 85 | </div> |
| 81 | 86 | <div style="margin-top: 1rem"> |
| 82 | - <el-descriptions title="版本信息" border> | |
| 87 | + <el-descriptions title="版本信息" border column="1"> | |
| 83 | 88 | <template slot="extra"> |
| 84 | 89 | <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> |
| 85 | 90 | </template> |
| ... | ... | @@ -375,7 +380,17 @@ export default { |
| 375 | 380 | method: 'get', |
| 376 | 381 | url: '/zlm/' + that.mediaServerChoose +'/index/api/getServerConfig' |
| 377 | 382 | }).then(function (res) { |
| 378 | - that.serverConfig = res.data.data[0]; | |
| 383 | + let info = res.data.data[0]; | |
| 384 | + let serverInfo = {} | |
| 385 | + for (let i = 0; i < Object.keys(info).length; i++) { | |
| 386 | + let key = Object.keys(info)[i]; | |
| 387 | + let group = key.substring(0, key.indexOf(".")) | |
| 388 | + let itemKey = key.substring(key.indexOf(".") + 1) | |
| 389 | + if (!serverInfo[group]) serverInfo[group] = {} | |
| 390 | + serverInfo[group][itemKey] = info[key] | |
| 391 | + } | |
| 392 | + | |
| 393 | + that.serverConfig = serverInfo; | |
| 379 | 394 | that.visible = true; |
| 380 | 395 | }); |
| 381 | 396 | }, |
| ... | ... | @@ -494,6 +509,49 @@ export default { |
| 494 | 509 | }else { |
| 495 | 510 | return key; |
| 496 | 511 | } |
| 512 | + }, | |
| 513 | + getMediaKeyNameFromKey: function(key) { | |
| 514 | + let nameData = { | |
| 515 | + "waitTrack": "等待编码信息", | |
| 516 | + "interfaceAuthenticationExcludes": "不进行鉴权的接口", | |
| 517 | + "playTimeout": "点播超时时间", | |
| 518 | + "autoApplyPlay": "自动点播", | |
| 519 | + "recordPushLive": "推流录像", | |
| 520 | + "redisConfig": "自动配置redis", | |
| 521 | + "thirdPartyGBIdReg": "stream信息正则", | |
| 522 | + "savePositionHistory": "保存轨迹信息", | |
| 523 | + "interfaceAuthentication": "接口鉴权", | |
| 524 | + "serverId": "服务ID", | |
| 525 | + "logInDatebase": "日志存储进数据库", | |
| 526 | + "seniorSdp": "扩展SDP", | |
| 527 | + "password": "密码", | |
| 528 | + "port": "端口号", | |
| 529 | + "keepaliveTimeOut": "心跳超时", | |
| 530 | + "domain": "国标域", | |
| 531 | + "ip": "IP地址", | |
| 532 | + "monitorIp": "监听IP", | |
| 533 | + "alarm": "存储报警信息", | |
| 534 | + "ptzSpeed": "云台控制速度", | |
| 535 | + "id": "国标ID", | |
| 536 | + "registerTimeInterval": "注册间隔", | |
| 537 | + "artifactId": "模块名称", | |
| 538 | + "version": "版本", | |
| 539 | + "project": "工程", | |
| 540 | + "git_Revision": "GIT修订版本", | |
| 541 | + "git_BRANCH": "GIT分支", | |
| 542 | + "git_URL": "GIT地址", | |
| 543 | + "build_DATE": "构建时间", | |
| 544 | + "create_By": "作者", | |
| 545 | + "git_Revision_SHORT": "GIT修订版本(短)", | |
| 546 | + "build_Jdk": "构建用JDK", | |
| 547 | + }; | |
| 548 | + console.log(key + ": " + nameData[key]) | |
| 549 | + | |
| 550 | + if (nameData[key]) { | |
| 551 | + return nameData[key] | |
| 552 | + }else { | |
| 553 | + return key; | |
| 554 | + } | |
| 497 | 555 | } |
| 498 | 556 | } |
| 499 | 557 | }; | ... | ... |