| | |
| | | style="width: 100%" |
| | | placeholder="请选择拉流节点" |
| | | > |
| | | <el-option label="自动选择" value="auto"></el-option> |
| | | <el-option |
| | | v-for="item in mediaServerList" |
| | | :key="item.id" |
| | |
| | | <el-checkbox label="启用" v-model="proxyParam.enable" ></el-checkbox> |
| | | <el-checkbox label="转HLS" v-model="proxyParam.enable_hls" ></el-checkbox> |
| | | <el-checkbox label="MP4录制" v-model="proxyParam.enable_mp4" ></el-checkbox> |
| | | <el-checkbox label="无人观看自动删除" v-model="proxyParam.enable_remove_none_reader" ></el-checkbox> |
| | | </div> |
| | | |
| | | </el-form-item> |
| | |
| | | computed: {}, |
| | | created() {}, |
| | | data() { |
| | | // var deviceGBIdRules = async (rule, value, callback) => { |
| | | // console.log(value); |
| | | // if (value === "") { |
| | | // callback(new Error("请输入设备国标编号")); |
| | | // } else { |
| | | // var exit = await this.deviceGBIdExit(value); |
| | | // console.log(exit); |
| | | // console.log(exit == "true"); |
| | | // console.log(exit === "true"); |
| | | // if (exit) { |
| | | // callback(new Error("设备国标编号已存在")); |
| | | // } else { |
| | | // callback(); |
| | | // } |
| | | // } |
| | | // }; |
| | | return { |
| | | listChangeCallback: null, |
| | | showDialog: false, |
| | |
| | | type: "default", |
| | | app: null, |
| | | stream: null, |
| | | url: "rtmp://58.200.131.2/livetv/cctv5hd", |
| | | url: "", |
| | | src_url: null, |
| | | timeout_ms: null, |
| | | ffmpeg_cmd_key: null, |
| | |
| | | enable: true, |
| | | enable_hls: true, |
| | | enable_mp4: false, |
| | | enable_remove_none_reader: false, |
| | | platformGbId: null, |
| | | mediaServerId: "auto", |
| | | mediaServerId: null, |
| | | }, |
| | | mediaServerList:{}, |
| | | ffmpegCmdList:{}, |
| | |
| | | timeout_ms: [{ required: true, message: "请输入FFmpeg推流成功超时时间", trigger: "blur" }], |
| | | ffmpeg_cmd_key: [{ required: false, message: "请输入FFmpeg命令参数模板(可选)", trigger: "blur" }], |
| | | }, |
| | | isUpdate: false, |
| | | }; |
| | | }, |
| | | methods: { |
| | |
| | | this.showDialog = true; |
| | | this.listChangeCallback = callback; |
| | | if (proxyParam != null) { |
| | | this.isUpdate=true |
| | | this.proxyParam = proxyParam; |
| | | } |
| | | |
| | | let that = this; |
| | | this.$axios({ |
| | | method: 'get', |
| | | url:`/api/platform/query/10000/0` |
| | | url:`/api/platform/query/10000/1` |
| | | }).then(function (res) { |
| | | that.platformList = res.data.list; |
| | | }).catch(function (error) { |
| | | console.log(error); |
| | | }); |
| | | this.mediaServer.getMediaServerList((data)=>{ |
| | | this.mediaServerList = data; |
| | | this.mediaServer.getOnlineMediaServerList((data)=>{ |
| | | this.mediaServerList = data.data; |
| | | this.proxyParam.mediaServerId = this.mediaServerList[0].id |
| | | }) |
| | | }, |
| | | mediaServerIdChange:function (){ |
| | |
| | | onSubmit: function () { |
| | | this.dialogLoading = true; |
| | | var that = this; |
| | | that.$axios({ |
| | | method: 'post', |
| | | url:`/api/proxy/save`, |
| | | data: that.proxyParam |
| | | }).then(function (res) { |
| | | that.dialogLoading = false; |
| | | if (typeof (res.data.code) != "undefined" && res.data.code === 0) { |
| | | that.$message({ |
| | | showClose: true, |
| | | message: res.data.msg, |
| | | type: "success", |
| | | }); |
| | | that.showDialog = false; |
| | | if (that.listChangeCallback != null) { |
| | | that.listChangeCallback(); |
| | | that.dialogLoading = false; |
| | | if(this.isUpdate){ |
| | | that.$axios({ |
| | | method: 'post', |
| | | url:`/api/proxy/update`, |
| | | data: that.proxyParam |
| | | }).then(function (res) { |
| | | that.dialogLoading = false; |
| | | if (typeof (res.data.code) != "undefined" && res.data.code === 0) { |
| | | that.$message({ |
| | | showClose: true, |
| | | message: res.data.msg, |
| | | type: "success", |
| | | }); |
| | | that.showDialog = false; |
| | | if (that.listChangeCallback != null) { |
| | | that.listChangeCallback(); |
| | | that.dialogLoading = false; |
| | | } |
| | | } |
| | | } |
| | | }).catch(function (error) { |
| | | console.log(error); |
| | | this.dialogLoading = false; |
| | | }); |
| | | }).catch(function (error) { |
| | | console.log(error); |
| | | this.dialogLoading = false; |
| | | }); |
| | | }else{ |
| | | that.$axios({ |
| | | method: 'post', |
| | | url:`/api/proxy/save`, |
| | | data: that.proxyParam |
| | | }).then(function (res) { |
| | | that.dialogLoading = false; |
| | | if (typeof (res.data.code) != "undefined" && res.data.code === 0) { |
| | | that.$message({ |
| | | showClose: true, |
| | | message: res.data.msg, |
| | | type: "success", |
| | | }); |
| | | that.showDialog = false; |
| | | if (that.listChangeCallback != null) { |
| | | that.listChangeCallback(); |
| | | that.dialogLoading = false; |
| | | } |
| | | } |
| | | }).catch(function (error) { |
| | | console.log(error); |
| | | this.dialogLoading = false; |
| | | }); |
| | | } |
| | | |
| | | }, |
| | | close: function () { |
| | | this.showDialog = false; |