Merge branch 'wvp-28181-2.0'

# Conflicts:
#	sql/update.sql
#	src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/InviteRequestProcessor.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/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
This commit is contained in:
648540858
2022-08-09 14:41:21 +08:00
204 changed files with 4646 additions and 1896 deletions

View File

@@ -63,34 +63,39 @@ export default {
}
if (res.data.data != null) {
if (res.data.data.total == 0) {
if (res.data.data.errorMsg !== null ){
this.msg = res.data.data.errorMsg;
this.syncStatus = "exception"
}else {
this.msg = `等待同步中`;
this.timmer = setTimeout(this.getProgress, 300)
}
}else {
if (res.data.data.total == res.data.data.current) {
this.syncStatus = "success"
this.percentage = 100;
this.msg = '同步成功';
}else {
if (res.data.syncIng) {
if (res.data.data.total == 0) {
if (res.data.data.errorMsg !== null ){
this.msg = res.data.data.errorMsg;
this.syncStatus = "exception"
}else {
this.total = res.data.data.total;
this.current = res.data.data.current;
this.percentage = Math.floor(Number(res.data.data.current)/Number(res.data.data.total)* 10000)/100;
this.msg = `同步中...[${res.data.data.current}/${res.data.data.total}]`;
this.msg = `等待同步中`;
this.timmer = setTimeout(this.getProgress, 300)
}
}else {
if (res.data.data.total == res.data.data.current) {
this.syncStatus = "success"
this.percentage = 100;
this.msg = '同步成功';
}else {
if (res.data.data.errorMsg !== null ){
this.msg = res.data.data.errorMsg;
this.syncStatus = "exception"
}else {
this.total = res.data.data.total;
this.current = res.data.data.current;
this.percentage = Math.floor(Number(res.data.data.current)/Number(res.data.data.total)* 10000)/100;
this.msg = `同步中...[${res.data.data.current}/${res.data.data.total}]`;
this.timmer = setTimeout(this.getProgress, 300)
}
}
}
}else {
this.syncStatus = "success"
this.percentage = 100;
this.msg = '同步成功';
}
}
}else {
if (this.syncFlag) {
this.syncStatus = "success"

View File

@@ -0,0 +1,159 @@
<template>
<div id="addUser" v-loading="isLoging">
<el-dialog
title="添加用户"
width="40%"
top="2rem"
:close-on-click-modal="false"
:visible.sync="showDialog"
:destroy-on-close="true"
@close="close()"
>
<div id="shared" style="margin-right: 20px;">
<el-form ref="passwordForm" :rules="rules" status-icon label-width="80px">
<el-form-item label="用户名" prop="username">
<el-input v-model="username" autocomplete="off"></el-input>
</el-form-item>
<el-form-item label="用户类型" prop="roleId" >
<el-select v-model="roleId" placeholder="请选择" style="width: 100%">
<el-option
v-for="item in options"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="密码" prop="password">
<el-input v-model="password" autocomplete="off"></el-input>
</el-form-item>
<el-form-item label="确认密码" prop="confirmPassword">
<el-input v-model="confirmPassword" autocomplete="off"></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-dialog>
</div>
</template>
<script>
export default {
name: "addUser",
props: {},
computed: {},
created() {
this.getAllRole();
},
data() {
let validatePass1 = (rule, value, callback) => {
if (value === '') {
callback(new Error('请输入新密码'));
} else {
if (this.confirmPassword !== '') {
this.$refs.passwordForm.validateField('confirmPassword');
}
callback();
}
};
let validatePass2 = (rule, value, callback) => {
if (this.confirmPassword === '') {
callback(new Error('请再次输入密码'));
} else if (this.confirmPassword !== this.password) {
callback(new Error('两次输入密码不一致!'));
} else {
callback();
}
};
return {
value:"",
options: [],
loading: false,
username: null,
password: null,
roleId: null,
confirmPassword: null,
listChangeCallback: null,
showDialog: false,
isLoging: false,
rules: {
newPassword: [{required: true, validator: validatePass1, trigger: "blur"}, {
pattern: /^(?=.*[a-zA-Z])(?=.*\d)(?=.*[~!@#$%^&*()_+`\-={}:";'<>?,.\/]).{8,20}$/,
message: "密码长度在8-20位之间,由字母+数字+特殊字符组成",
},],
confirmPassword: [{required: true, validator: validatePass2, trigger: "blur"}],
},
};
},
methods: {
openDialog: function (callback) {
this.listChangeCallback = callback;
this.showDialog = true;
},
onSubmit: function () {
this.$axios({
method: 'post',
url: "/api/user/add",
params: {
username: this.username,
password: this.password,
roleId: this.roleId
}
}).then((res) => {
if (res.data.code === 0) {
this.$message({
showClose: true,
message: '添加成功',
type: 'success',
});
this.showDialog = false;
this.listChangeCallback()
} else {
this.$message({
showClose: true,
message: res.data.msg,
type: 'error'
});
}
}).catch((error) => {
console.error(error)
});
},
close: function () {
this.showDialog = false;
this.password = null;
this.confirmPassword = null;
this.username = null;
this.roleId = null;
},
getAllRole:function () {
this.$axios({
method: 'get',
url: "/api/role/all"
}).then((res) => {
this.loading = true;
console.info(res)
res.data
console.info(res.data.code)
if (res.data.code === 0) {
console.info(res.data.data)
this.options=res.data.data
}
}).catch((error) => {
console.error(error)
});
}
},
};
</script>

View File

@@ -49,11 +49,42 @@ export default {
props: ['platformId'],
created() {},
data() {
let checkId = (rule, value, callback) => {
console.log("checkId")
console.log(this.treeType)
console.log(rule)
console.log(value)
console.log(value.length)
console.log(this.level)
if (!value) {
return callback(new Error('编号不能为空'));
}
if (this.treeType === "BusinessGroup" && value.length !== 20) {
return callback(new Error('编号必须由20位数字组成'));
}
if (this.treeType === "CivilCode" && value.length <= 8 && value.length%2 !== 0) {
return callback(new Error('行政区划必须是八位以下的偶数个数字组成'));
}
if (this.treeType === "BusinessGroup") {
let catalogType = value.substring(10, 13);
console.log(catalogType)
// 216 为虚拟组织 215 为业务分组;目录第一级必须为业务分组, 业务分组下为虚拟组织,虚拟组织下可以有其他虚拟组织
if (this.level === 1 && catalogType !== "215") {
return callback(new Error('业务分组模式下第一层目录的编号11到13位必须为215'));
}
if (this.level > 1 && catalogType !== "216") {
return callback(new Error('业务分组模式下第一层以下目录的编号11到13位必须为216'));
}
}
callback();
}
return {
submitCallback: null,
showDialog: false,
isLoging: false,
isEdit: false,
treeType: null,
level: 0,
form: {
id: null,
name: null,
@@ -62,12 +93,12 @@ export default {
},
rules: {
name: [{ required: true, message: "请输入名称", trigger: "blur" }],
id: [{ required: true, message: "请输入ID", trigger: "blur" }]
id: [{ required: true, trigger: "blur",validator: checkId }]
},
};
},
methods: {
openDialog: function (isEdit, id, name, parentId, callback) {
openDialog: function (isEdit, id, name, parentId, treeType, level, callback) {
console.log("parentId: " + parentId)
console.log(this.form)
this.isEdit = isEdit;
@@ -77,6 +108,8 @@ export default {
this.form.parentId = parentId;
this.showDialog = true;
this.submitCallback = callback;
this.treeType = treeType;
this.level = level;
},
onSubmit: function () {
console.log("onSubmit");

View File

@@ -0,0 +1,121 @@
<template>
<div id="changePassword" v-loading="isLoging">
<el-dialog
title="修改密码"
width="40%"
top="2rem"
:close-on-click-modal="false"
:visible.sync="showDialog"
:destroy-on-close="true"
@close="close()"
>
<div id="shared" style="margin-right: 20px;">
<el-form ref="passwordForm" :rules="rules" status-icon label-width="80px">
<el-form-item label="新密码" prop="newPassword" >
<el-input v-model="newPassword" autocomplete="off"></el-input>
</el-form-item>
<el-form-item label="确认密码" prop="confirmPassword">
<el-input v-model="confirmPassword" autocomplete="off"></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-dialog>
</div>
</template>
<script>
export default {
name: "changePasswordForAdmin",
props: {},
computed: {},
created() {},
data() {
let validatePass1 = (rule, value, callback) => {
if (value === '') {
callback(new Error('请输入新密码'));
} else {
if (this.confirmPassword !== '') {
this.$refs.passwordForm.validateField('confirmPassword');
}
callback();
}
};
let validatePass2 = (rule, value, callback) => {
if (this.confirmPassword === '') {
callback(new Error('请再次输入密码'));
} else if (this.confirmPassword !== this.newPassword) {
callback(new Error('两次输入密码不一致!'));
} else {
callback();
}
};
return {
newPassword: null,
confirmPassword: null,
userId: null,
showDialog: false,
isLoging: false,
listChangeCallback: null,
form: {},
rules: {
newPassword: [{ required: true, validator: validatePass1, trigger: "blur" }, {
pattern: /^(?=.*[a-zA-Z])(?=.*\d)(?=.*[~!@#$%^&*()_+`\-={}:";'<>?,.\/]).{8,20}$/,
message: "密码长度在8-20位之间,由字母+数字+特殊字符组成",
},],
confirmPassword: [{ required: true, validator: validatePass2, trigger: "blur" }],
},
};
},
methods: {
openDialog: function (row, callback) {
console.log(row)
this.showDialog = true;
this.listChangeCallback = callback;
if (row != null) {
this.form = row;
}
},
onSubmit: function () {
this.$axios({
method: 'post',
url:"/api/user/changePasswordForAdmin",
params: {
password: this.newPassword,
userId: this.form.id,
}
}).then((res)=> {
if (res.data === "success"){
this.$message({
showClose: true,
message: '修改成功',
type: 'success'
});
this.showDialog = false;
}else {
this.$message({
showClose: true,
message: '修改密码失败,是否已登录(接口鉴权关闭无法修改密码)',
type: 'error'
});
}
}).catch((error)=> {
console.error(error)
});
},
close: function () {
this.showDialog = false;
this.newPassword = null;
this.confirmPassword = null;
this.userId=null;
this.adminId=null;
},
},
};
</script>

View File

@@ -0,0 +1,102 @@
<template>
<div id="changepushKey" v-loading="isLoging">
<el-dialog
title="修改pushKey"
width="42%"
top="2rem"
:close-on-click-modal="false"
:visible.sync="showDialog"
:destroy-on-close="true"
@close="close()"
>
<div id="shared" style="margin-right: 18px;">
<el-form ref="pushKeyForm" :rules="rules" status-icon label-width="86px">
<el-form-item label="新pushKey" prop="newPushKey" >
<el-input v-model="newPushKey" autocomplete="off"></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-dialog>
</div>
</template>
<script>
export default {
name: "changePushKey",
props: {},
computed: {},
created() {},
data() {
let validatePass1 = (rule, value, callback) => {
if (value === '') {
callback(new Error('请输入新pushKey'));
} else {
callback();
}
};
return {
newPushKey: null,
confirmpushKey: null,
userId: null,
showDialog: false,
isLoging: false,
listChangeCallback: null,
form: {},
rules: {
newpushKey: [{ required: true, validator: validatePass1, trigger: "blur" }],
},
};
},
methods: {
openDialog: function (row, callback) {
console.log(row)
this.showDialog = true;
this.listChangeCallback = callback;
if (row != null) {
this.form = row;
}
},
onSubmit: function () {
this.$axios({
method: 'post',
url:"/api/user/changePushKey",
params: {
pushKey: this.newPushKey,
userId: this.form.id,
}
}).then((res)=> {
console.log(res.data)
if (res.data.msg === "success"){
this.$message({
showClose: true,
message: '修改成功',
type: 'success'
});
this.showDialog = false;
this.listChangeCallback();
}else {
this.$message({
showClose: true,
message: '修改pushKey失败是否已登录接口鉴权关闭无法修改pushKey',
type: 'error'
});
}
}).catch((error)=> {
console.error(error)
});
},
close: function () {
this.showDialog = false;
this.newpushKey = null;
this.userId=null;
this.adminId=null;
},
},
};
</script>

View File

@@ -8,7 +8,7 @@
<el-tab-pane label="目录结构" name="catalog">
<el-container>
<el-main v-bind:style="{backgroundColor: '#FFF', maxHeight: winHeight + 'px'}">
<chooseChannelForCatalog ref="chooseChannelForCatalog" :platformId=platformId :platformName=platformName :defaultCatalogId=defaultCatalogId :catalogIdChange="catalogIdChange" ></chooseChannelForCatalog>
<chooseChannelForCatalog ref="chooseChannelForCatalog" :platformId=platformId :platformName=platformName :defaultCatalogId=defaultCatalogId :catalogIdChange="catalogIdChange" :treeType=treeType ></chooseChannelForCatalog>
</el-main>
</el-container>
</el-tab-pane>
@@ -66,18 +66,20 @@ export default {
platformName: "",
defaultCatalogId: "",
showDialog: false,
treeType: null,
chooseData: {},
winHeight: window.innerHeight - 250,
};
},
methods: {
openDialog(platformId, platformName, defaultCatalogId, closeCallback) {
openDialog(platformId, platformName, defaultCatalogId, treeType, closeCallback) {
this.platformId = platformId
this.platformName = platformName
this.defaultCatalogId = defaultCatalogId
this.showDialog = true
this.closeCallback = closeCallback
this.treeType = treeType
},
tabClick (tab, event){

View File

@@ -38,7 +38,7 @@
import catalogEdit from './catalogEdit.vue'
export default {
name: 'chooseChannelForCatalog',
props: ['platformId', 'platformName', 'defaultCatalogId', 'catalogIdChange'],
props: ['platformId', 'platformName', 'defaultCatalogId', 'catalogIdChange', 'treeType'],
created() {
this.chooseId = this.defaultCatalogId;
this.defaultCatalogIdSign = this.defaultCatalogId;
@@ -102,8 +102,9 @@ export default {
},
addCatalog: function (parentId, node){
let that = this;
console.log(this.treeType)
// 打开添加弹窗
that.$refs.catalogEdit.openDialog(false, null, null, parentId, ()=>{
that.$refs.catalogEdit.openDialog(false, null, null, parentId, this.treeType, node.level, ()=>{
node.loaded = false
node.expand();
});

View File

@@ -174,7 +174,6 @@ export default {
page: that.currentPage,
count: that.count,
query: that.searchSrt,
pushing: that.pushing,
platformId: that.platformId,
catalogId: that.catalogId,
mediaServerId: that.mediaServerId

View File

@@ -388,7 +388,7 @@ export default {
url: '/zlm/' +this.mediaServerId+ '/index/api/getMediaInfo?vhost=__defaultVhost__&schema=rtmp&app='+ this.app +'&stream='+ this.streamId
}).then(function (res) {
that.tracksLoading = false;
if (res.data.code == 0 && res.data.online) {
if (res.data.code == 0 && res.data.tracks) {
that.tracks = res.data.tracks;
}else{
that.tracksNotLoaded = true;

View File

@@ -78,6 +78,12 @@
<el-option label="8" value="8"></el-option>
</el-select>
</el-form-item>
<el-form-item label="目录结构" prop="treeType" >
<el-select v-model="platform.treeType" style="width: 100%" >
<el-option key="WGS84" label="行政区划" value="CivilCode"></el-option>
<el-option key="GCJ02" label="业务分组" value="BusinessGroup"></el-option>
</el-select>
</el-form-item>
<el-form-item label="字符集" prop="characterSet">
<el-select
v-model="platform.characterSet"
@@ -91,7 +97,6 @@
<el-form-item label="其他选项">
<el-checkbox label="启用" v-model="platform.enable" @change="checkExpires"></el-checkbox>
<el-checkbox label="云台控制" v-model="platform.ptz"></el-checkbox>
<el-checkbox label="共享所有直播流" v-model="platform.shareAllLiveStream"></el-checkbox>
<el-checkbox label="拉起离线推流" v-model="platform.startOfflinePush"></el-checkbox>
</el-form-item>
<el-form-item>
@@ -153,10 +158,10 @@ export default {
keepTimeout: 60,
transport: "UDP",
characterSet: "GB2312",
shareAllLiveStream: false,
startOfflinePush: false,
catalogGroup: 1,
administrativeDivision: null,
treeType: "BusinessGroup",
},
rules: {
name: [{ required: true, message: "请输入平台名称", trigger: "blur" }],
@@ -194,6 +199,7 @@ export default {
that.platform.devicePort = res.data.devicePort;
that.platform.username = res.data.username;
that.platform.password = res.data.password;
that.platform.treeType = "BusinessGroup";
that.platform.administrativeDivision = res.data.username.substr(0, 6);
}).catch(function (error) {
console.log(error);
@@ -217,11 +223,11 @@ export default {
this.platform.keepTimeout = platform.keepTimeout;
this.platform.transport = platform.transport;
this.platform.characterSet = platform.characterSet;
this.platform.shareAllLiveStream = platform.shareAllLiveStream;
this.platform.catalogId = platform.catalogId;
this.platform.startOfflinePush = platform.startOfflinePush;
this.platform.catalogGroup = platform.catalogGroup;
this.platform.administrativeDivision = platform.administrativeDivision;
this.platform.treeType = platform.treeType;
this.onSubmit_text = "保存";
this.saveUrl = "/api/platform/save";
}
@@ -242,32 +248,49 @@ export default {
},
onSubmit: function () {
if (this.onSubmit_text === "保存") {
this.$confirm("修改目录结构会导致关联目录与通道数据被清空", '提示', {
dangerouslyUseHTMLString: true,
confirmButtonText: '确定',
cancelButtonText: '取消',
center: true,
type: 'warning'
}).then(() => {
this.saveForm()
}).catch(() => {
});
}else {
this.saveForm()
}
},
saveForm: function (){
var that = this;
that.$axios({
method: 'post',
url: this.saveUrl,
data: that.platform
}).then(function (res) {
if (res.data.code === 0) {
that.$message({
showClose: true,
message: "保存成功",
type: "success",
});
that.showDialog = false;
if (that.listChangeCallback != null) {
that.listChangeCallback();
}
}else {
that.$message({
showClose: true,
message: res.data.msg,
type: "error",
});
if (res.data.code === 0) {
that.$message({
showClose: true,
message: "保存成功",
type: "success",
});
that.showDialog = false;
if (that.listChangeCallback != null) {
that.listChangeCallback();
}
}).catch(function (error) {
console.log(error);
});
}else {
that.$message({
showClose: true,
message: res.data.msg,
type: "error",
});
}
}).catch(function (error) {
console.log(error);
});
},
close: function () {
this.showDialog = false;
@@ -293,7 +316,7 @@ export default {
keepTimeout: 60,
transport: "UDP",
characterSet: "GB2312",
shareAllLiveStream: false,
treeType: "BusinessGroup",
startOfflinePush: false,
catalogGroup: 1,
}

View File

@@ -15,20 +15,25 @@
<el-input v-model="proxyParam.name" clearable></el-input>
</el-form-item>
<el-form-item label="流应用名" prop="app">
<el-input v-model="proxyParam.app" clearable :disabled="true"></el-input>
<el-input v-model="proxyParam.app" clearable :disabled="edit"></el-input>
</el-form-item>
<el-form-item label="流ID" prop="stream">
<el-input v-model="proxyParam.stream" clearable :disabled="true"></el-input>
<el-input v-model="proxyParam.stream" clearable :disabled="edit"></el-input>
</el-form-item>
<el-form-item label="国标编码" prop="gbId">
<el-input v-model="proxyParam.gbId" placeholder="设置国标编码可推送到国标" clearable></el-input>
</el-form-item>
<el-form-item label="经度" prop="longitude" v-if="proxyParam.gbId">
<el-input v-model="proxyParam.longitude" placeholder="经度" clearable></el-input>
</el-form-item>
<el-form-item label="纬度" prop="latitude" v-if="proxyParam.gbId">
<el-input v-model="proxyParam.latitude" placeholder="经度" clearable></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>
@@ -38,7 +43,7 @@
<script>
export default {
name: "streamProxyEdit",
name: "pushStreamEdit",
props: {},
computed: {},
created() {},
@@ -63,13 +68,15 @@ export default {
listChangeCallback: null,
showDialog: false,
isLoging: false,
edit: false,
proxyParam: {
name: null,
app: null,
stream: null,
gbId: null,
longitude: null,
latitude: null,
},
rules: {
name: [{ required: true, message: "请输入名称", trigger: "blur" }],
app: [{ required: true, message: "请输入应用名", trigger: "blur" }],
@@ -84,30 +91,63 @@ export default {
this.listChangeCallback = callback;
if (proxyParam != null) {
this.proxyParam = proxyParam;
}
this.edit = true
}else{
this.proxyParam= {
name: null,
app: null,
stream: null,
gbId: null,
longitude: null,
latitude: null,
}
this.edit = false
}
},
onSubmit: function () {
console.log("onSubmit");
var that = this;
that.$axios({
method:"post",
url:`/api/push/save_to_gb`,
data: that.proxyParam
}).then(function (res) {
if (this.edit) {
this.$axios({
method:"post",
url:`/api/push/save_to_gb`,
data: this.proxyParam
}).then( (res) => {
if (res.data == "success") {
that.$message({
this.$message({
showClose: true,
message: "保存成功",
type: "success",
});
that.showDialog = false;
if (that.listChangeCallback != null) {
that.listChangeCallback();
this.showDialog = false;
if (this.listChangeCallback != null) {
this.listChangeCallback();
}
}
}).catch(function (error) {
}).catch((error)=> {
console.log(error);
});
});
}else {
this.$axios({
method:"post",
url:`/api/push/add`,
data: this.proxyParam
}).then( (res) => {
if (res.data.code === 0) {
this.$message({
showClose: true,
message: "保存成功",
type: "success",
});
this.showDialog = false;
if (this.listChangeCallback != null) {
this.listChangeCallback();
}
}
}).catch((error)=> {
console.log(error);
});
}
},
close: function () {
console.log("关闭加入GB");
@@ -131,6 +171,9 @@ export default {
if (this.platform.enable && this.platform.expires == "0") {
this.platform.expires = "300";
}
},
handleNodeClick: function (node){
}
},
};