| | |
| | | @close="close()" |
| | | > |
| | | <div id="shared" style="margin-top: 1rem;margin-right: 100px;"> |
| | | <el-form ref="streamProxy" :rules="rules" :model="proxyParam" label-width="140px"> |
| | | <el-form ref="streamProxy" :rules="rules" :model="proxyParam" label-width="140px" > |
| | | <el-form-item label="类型" prop="type"> |
| | | <el-select |
| | | v-model="proxyParam.type" |
| | |
| | | <el-checkbox label="转HLS" v-model="proxyParam.enable_hls" ></el-checkbox> |
| | | <el-checkbox label="MP4录制" v-model="proxyParam.enable_mp4" ></el-checkbox> |
| | | </div> |
| | | |
| | | |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <div style="float: right;"> |
| | | <el-button type="primary" @click="onSubmit">{{onSubmit_text}}</el-button> |
| | | <el-button type="primary" @click="onSubmit" :loading="dialogLoading" >{{onSubmit_text}}</el-button> |
| | | <el-button @click="close">取消</el-button> |
| | | </div> |
| | | |
| | | |
| | | </el-form-item> |
| | | </el-form> |
| | | </div> |
| | |
| | | listChangeCallback: null, |
| | | showDialog: false, |
| | | isLoging: false, |
| | | dialogLoading: false, |
| | | onSubmit_text: "立即创建", |
| | | proxyParam: { |
| | | name: null, |
| | | type: "default", |
| | | app: null, |
| | | stream: null, |
| | | url: "rtmp://58.200.131.2:1935/livetv/hunantv", |
| | | url: "rtmp://58.200.131.2/livetv/cctv5hd", |
| | | src_url: null, |
| | | timeout_ms: null, |
| | | ffmpeg_cmd_key: null, |
| | |
| | | enable_hls: true, |
| | | enable_mp4: false, |
| | | }, |
| | | |
| | | |
| | | rules: { |
| | | name: [{ required: true, message: "请输入名称", trigger: "blur" }], |
| | | app: [{ required: true, message: "请输入应用名", trigger: "blur" }], |
| | |
| | | this.listChangeCallback = callback; |
| | | if (proxyParam != null) { |
| | | this.proxyParam = proxyParam; |
| | | this.onSubmit_text = "保存"; |
| | | } else { |
| | | this.onSubmit_text = "立即创建"; |
| | | } |
| | | }, |
| | | onSubmit: function () { |
| | | console.log("onSubmit"); |
| | | this.dialogLoading = true; |
| | | var that = this; |
| | | that.$axios |
| | | .post(`/api/proxy/save`, that.proxyParam) |
| | | .then(function (res) { |
| | | console.log(res); |
| | | console.log(res.data == "success"); |
| | | if (res.data == "success") { |
| | | that.$message({ |
| | | showClose: true, |
| | | message: "保存成功", |
| | | type: "success", |
| | | }); |
| | | that.showDialog = false; |
| | | if (that.listChangeCallback != null) { |
| | | that.listChangeCallback(); |
| | | } |
| | | 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); |
| | | }); |
| | | } |
| | | }).catch(function (error) { |
| | | console.log(error); |
| | | this.dialogLoading = false; |
| | | }); |
| | | }, |
| | | close: function () { |
| | | console.log("关闭添加视频平台"); |
| | | this.showDialog = false; |
| | | this.dialogLoading = false; |
| | | this.$refs.streamProxy.resetFields(); |
| | | }, |
| | | deviceGBIdExit: async function (deviceGbId) { |
| | | var result = false; |
| | | var that = this; |
| | | await that.$axios |
| | | .post(`/api/platforms/exit/${deviceGbId}`) |
| | | .then(function (res) { |
| | | result = res.data; |
| | | }) |
| | | .catch(function (error) { |
| | | console.log(error); |
| | | }); |
| | | await that.$axios({ |
| | | method: 'post', |
| | | url:`/api/platform/exit/${deviceGbId}` |
| | | }).then(function (res) { |
| | | result = res.data; |
| | | }).catch(function (error) { |
| | | console.log(error); |
| | | }); |
| | | return result; |
| | | }, |
| | | checkExpires: function() { |