Browse Source

添加系统设置界面,未完成

pull/93/head
panlinlin 4 years ago
parent
commit
428c045aab
  1. 8
      src/main/java/com/genersoft/iot/vmp/gb28181/transmit/request/impl/RegisterRequestProcessor.java
  2. 6
      web_src/src/components/UiHeader.vue
  3. 121
      web_src/src/components/setting/Media.vue
  4. 83
      web_src/src/components/setting/Sip.vue
  5. 83
      web_src/src/components/setting/Web.vue
  6. 20
      web_src/src/router/index.js

8
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/request/impl/RegisterRequestProcessor.java

@ -105,12 +105,11 @@ public class RegisterRequestProcessor extends SIPRequestAbstractProcessor {
// 添加Expires头
response.addHeader(request.getExpires());
// 1.获取到通信地址等信息,保存到Redis
// 获取到通信地址等信息
FromHeader fromHeader = (FromHeader) request.getHeader(FromHeader.NAME);
ViaHeader viaHeader = (ViaHeader) request.getHeader(ViaHeader.NAME);
String received = viaHeader.getReceived();
int rPort = viaHeader.getRPort();
// 本地模拟设备 received 为空 rPort 为 -1
// 解析本地地址替代
if (StringUtils.isEmpty(received) || rPort == -1) {
received = viaHeader.getHost();
@ -152,15 +151,12 @@ public class RegisterRequestProcessor extends SIPRequestAbstractProcessor {
// 下发catelog查询目录
if (registerFlag == 1 ) {
logger.info("[{}] 注册成功! deviceId:" + device.getDeviceId(), requestAddress);
// boolean exists = storager.exists(device.getDeviceId());
device.setRegisterTimeMillis(System.currentTimeMillis());
storager.updateDevice(device);
publisher.onlineEventPublish(device.getDeviceId(), VideoManagerConstants.EVENT_ONLINE_REGISTER);
// 重新注册更新设备和通道,以免设备替换或更新后信息无法更新
//if (!exists) {
handler.onRegister(device);
//}
handler.onRegister(device);
} else if (registerFlag == 2) {
logger.info("[{}] 注销成功! deviceId:" + device.getDeviceId(), requestAddress);
publisher.outlineEventPublish(device.getDeviceId(), VideoManagerConstants.EVENT_OUTLINE_UNREGISTER);

6
web_src/src/components/UiHeader.vue

@ -7,6 +7,12 @@
<el-menu-item index="/streamProxyList">拉流代理</el-menu-item>
<el-menu-item index="/parentPlatformList/15/1">国标级联</el-menu-item>
<el-menu-item @click="openDoc">在线文档</el-menu-item>
<!-- <el-submenu index="/setting">-->
<!-- <template slot="title">系统设置</template>-->
<!-- <el-menu-item index="/setting/web">WEB服务</el-menu-item>-->
<!-- <el-menu-item index="/setting/sip">国标服务</el-menu-item>-->
<!-- <el-menu-item index="/setting/media">媒体服务</el-menu-item>-->
<!-- </el-submenu>-->
<el-switch v-model="alarmNotify" active-text="报警信息推送" style="display: block float: right" @change="sseControl"></el-switch>
<!-- <el-menu-item style="float: right;" @click="loginout">退出</el-menu-item>-->
<el-submenu index="" style="float: right;" >

121
web_src/src/components/setting/Media.vue

@ -0,0 +1,121 @@
<template>
<div id="SettingForMedia">
<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>
<div style="width: 60%; margin:0 auto; background-color: #FFFFFF; position: relative; padding: 5rem 6.5rem; text-align: left;font-size: 14px; max-width: 400px">
<el-form ref="form" :rules="rules" :model="form" label-width="140px">
<el-form-item label="IP" prop="IP">
<el-input v-model="form.IP" clearable></el-input>
</el-form-item>
<el-form-item label="公网IP" prop="wanIp">
<el-input v-model="form.wanIp" clearable></el-input>
</el-form-item>
<el-form-item label="HOOK IP" prop="hookIp">
<el-input v-model="form.hookIp" clearable></el-input>
</el-form-item>
<el-form-item label="HTTP端口" >
<el-input v-model.number="form.httpPort" clearable></el-input>
</el-form-item>
<el-form-item label="HTTP SSL端口" >
<el-input v-model.number="form.httpSSlPort" clearable></el-input>
</el-form-item>
<el-form-item label="RTMP端口" >
<el-input v-model.number="form.rtmpPort" clearable></el-input>
</el-form-item>
<el-form-item label="RTMP SSL端口" >
<el-input v-model.number="form.rtmpSSlPort" clearable></el-input>
</el-form-item>
<el-form-item label="RTSP端口" >
<el-input v-model.number="form.rtspPort" clearable></el-input>
</el-form-item>
<el-form-item label="RTSP SSL端口" >
<el-input v-model.number="form.rtspSSLPort" clearable></el-input>
</el-form-item>
<el-form-item label="RTP端口" >
<el-input v-model.number="form.rtpProxyPort" clearable></el-input>
</el-form-item>
<el-form-item label="自动点播" >
<el-switch v-model="form.autoApplyPlay"></el-switch>
</el-form-item>
<el-form-item label="接口密钥" prop="secret">
<el-input v-model="form.secret" clearable></el-input>
</el-form-item>
<el-form-item label="无人观看触发时长" >
<el-input v-model.number="form.streamNoneReaderDelayMS" clearable></el-input>
</el-form-item>
<el-form-item label="自动配置" >
<el-switch v-model="form.autoConfig"></el-switch>
</el-form-item>
<el-form-item label="使用多端口" >
<el-switch v-model="form.rtp.enable"></el-switch>
</el-form-item>
<el-form-item label="端口范围" >
<el-input v-model.number="form.rtp.portRange" clearable></el-input>
</el-form-item>
<el-form-item label="DOCKER智能识别">
<el-input type="textarea" v-model="dockerStr"></el-input>
</el-form-item>
<el-form-item>
<div style="float: right;">
<el-button type="primary" @click="onSubmit">保存</el-button>
<!-- <el-button @click="close">取消</el-button>-->
</div>
</el-form-item>
</el-form>
</div>
</el-main>
</el-container>
</div>
</template>
<script>
import uiHeader from '../UiHeader.vue'
export default {
name: "SettingForMedia",
components: {
uiHeader
},
data() {
return {
dockerStr: null,
form: {
ip: null,
wanIp: null,
hookIp: null,
httpPort: null,
httpSSlPort: null,
rtmpPort: null,
rtpProxyPort: null,
rtspPort: null,
rtspSSLPort: null,
autoConfig: true,
secret: "035c73f7-bb6b-4889-a715-d9eb2d1925cc",
rtp: {
enable: false,
portRange: null
},
},
rules: {
IP: [{ required: true, message: "请输入名称", trigger: "blur" }],
wanIp: [{ required: false, message: "请输入应用名", trigger: "blur" }],
hookIp: [{ required: false, message: "请输入流ID", trigger: "blur" }],
},
}
}
}
</script>
<style scoped>
</style>

83
web_src/src/components/setting/Sip.vue

@ -0,0 +1,83 @@
<template>
<div id="SettingForSip">
<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>
<div style="width: 60%; margin:0 auto; background-color: #FFFFFF; position: relative; padding: 5rem 6.5rem; text-align: left;font-size: 14px; max-width: 400px">
<el-form ref="form" :rules="rules" :model="form" label-width="140px">
<el-form-item label="HTTP端口" prop="port">
<el-input v-model.number="form.port" clearable></el-input>
</el-form-item>
<el-form-item label="点播超时" >
<el-input v-model.number="form.playTimeout" clearable></el-input>
</el-form-item>
<el-form-item label="自动点播" >
<el-switch v-model="form.autoApplyPlay"></el-switch>
</el-form-item>
<el-form-item label="扩展SDP" >
<el-switch v-model="form.seniorSdp"></el-switch>
</el-form-item>
<el-form-item label="保存轨迹" >
<el-switch v-model="form.savePositionHistory"></el-switch>
</el-form-item>
<el-form-item label="等待音视频编码信息">
<el-switch v-model="form.waitTrack"></el-switch>
</el-form-item>
<el-form-item label="开启接口鉴权">
<el-switch v-model="form.interfaceAuthentication"></el-switch>
</el-form-item>
<el-form-item>
<div style="float: right;">
<el-button type="primary" @click="onSubmit">保存</el-button>
<!-- <el-button @click="close">取消</el-button>-->
</div>
</el-form-item>
</el-form>
</div>
</el-main>
</el-container>
</div>
</template>
<script>
import uiHeader from '../UiHeader.vue'
export default {
name: "SettingForSip",
components: {
uiHeader
},
data() {
return {
form: {
port: null,
autoApplyPlay: null,
seniorSdp: null,
savePositionHistory: null,
playTimeout: null,
waitTrack: null,
interfaceAuthentication: null,
},
rules: {
name: [{ required: true, message: "请输入名称", trigger: "blur" }],
app: [{ required: true, message: "请输入应用名", trigger: "blur" }],
stream: [{ required: true, message: "请输入流ID", trigger: "blur" }],
gbId: [{ required: true, message: "请输入国标编码", trigger: "blur" }],
},
}
}
}
</script>
<style scoped>
</style>

83
web_src/src/components/setting/Web.vue

@ -0,0 +1,83 @@
<template>
<div id="SettingForWeb">
<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;">WEB服务</span>
</div>
<div style="width: 60%; margin:0 auto; background-color: #FFFFFF; position: relative; padding: 5rem 6.5rem; text-align: left;font-size: 14px; max-width: 400px">
<el-form ref="form" :rules="rules" :model="form" label-width="140px">
<el-form-item label="HTTP端口" prop="port">
<el-input v-model.number="form.port" clearable></el-input>
</el-form-item>
<el-form-item label="点播超时" >
<el-input v-model.number="form.playTimeout" clearable></el-input>
</el-form-item>
<el-form-item label="自动点播" >
<el-switch v-model="form.autoApplyPlay"></el-switch>
</el-form-item>
<el-form-item label="扩展SDP" >
<el-switch v-model="form.seniorSdp"></el-switch>
</el-form-item>
<el-form-item label="保存轨迹" >
<el-switch v-model="form.savePositionHistory"></el-switch>
</el-form-item>
<el-form-item label="等待音视频编码信息">
<el-switch v-model="form.waitTrack"></el-switch>
</el-form-item>
<el-form-item label="开启接口鉴权">
<el-switch v-model="form.interfaceAuthentication"></el-switch>
</el-form-item>
<el-form-item>
<div style="float: right;">
<el-button type="primary" @click="onSubmit">保存</el-button>
<!-- <el-button @click="close">取消</el-button>-->
</div>
</el-form-item>
</el-form>
</div>
</el-main>
</el-container>
</div>
</template>
<script>
import uiHeader from '../UiHeader.vue'
export default {
name: "SettingForWeb",
components: {
uiHeader
},
data() {
return {
form: {
port: null,
autoApplyPlay: null,
seniorSdp: null,
savePositionHistory: null,
playTimeout: null,
waitTrack: null,
interfaceAuthentication: null,
},
rules: {
name: [{ required: true, message: "请输入名称", trigger: "blur" }],
app: [{ required: true, message: "请输入应用名", trigger: "blur" }],
stream: [{ required: true, message: "请输入流ID", trigger: "blur" }],
gbId: [{ required: true, message: "请输入国标编码", trigger: "blur" }],
},
}
}
}
</script>
<style scoped>
</style>

20
web_src/src/router/index.js

@ -10,6 +10,9 @@ import devicePosition from '../components/devicePosition.vue'
import login from '../components/Login.vue'
import parentPlatformList from '../components/ParentPlatformList.vue'
import test from '../components/test.vue'
import web from '../components/setting/Web.vue'
import sip from '../components/setting/Sip.vue'
import media from '../components/setting/Media.vue'
const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(location) {
@ -57,7 +60,22 @@ export default new VueRouter({
path: '/devicePosition/:deviceId/:parentChannelId/:count/:page',
name: 'devicePosition',
component: devicePosition,
},,
},
{
path: '/setting/web',
name: 'web',
component: web,
},
{
path: '/setting/sip',
name: 'sip',
component: sip,
},
{
path: '/setting/media',
name: 'media',
component: media,
},
{
path: '/test',
name: 'test',

Loading…
Cancel
Save