| | |
| | | <artifactId>springfox-boot-starter</artifactId> |
| | | <version>3.0.0</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.github.xiaoymin</groupId> |
| | | <artifactId>knife4j-spring-boot-starter</artifactId> |
| | | <version>3.0.2</version> |
| | | </dependency> |
| | | |
| | | |
| | | <!--参数校验 --> |
| | | <dependency> |
| | |
| | | </dependencies> |
| | | |
| | | <build> |
| | | <finalName>wvp-2.5.8</finalName> |
| | | <finalName>wvp-2.0</finalName> |
| | | <plugins> |
| | | <plugin> |
| | | <groupId>org.springframework.boot</groupId> |
| | |
| | | return new ApiInfoBuilder() |
| | | .title("WVP-PRO 接口文档") |
| | | .description("更多请咨询服务开发者(18010473990@@163.com)。") |
| | | .contact(new Contact("Ray。", "http://www.ruiyeclub.cn", "ruiyeclub@foxmail.com")) |
| | | .version("1.0") |
| | | .contact(new Contact("panlinlin", "http://www.ruiyeclub.cn", "ruiyeclub@foxmail.com")) |
| | | .version("2.0") |
| | | .build(); |
| | | } |
| | | } |
| | |
| | | } else { |
| | | String streamId = streamInfo.getStreamId(); |
| | | JSONObject rtpInfo = zlmresTfulUtils.getRtpInfo(streamId); |
| | | if (rtpInfo.getBoolean("exist")) { |
| | | if (rtpInfo != null && rtpInfo.getBoolean("exist")) { |
| | | RequestMessage msg = new RequestMessage(); |
| | | msg.setId(DeferredResultHolder.CALLBACK_CMD_PlAY + uuid); |
| | | msg.setData(JSON.toJSONString(streamInfo)); |
| | |
| | | public boolean stop(String app, String stream) { |
| | | boolean result = false; |
| | | StreamProxyItem streamProxyDto = videoManagerStorager.queryStreamProxy(app, stream); |
| | | if (streamProxyDto.isEnable() && streamProxyDto != null) { |
| | | if (streamProxyDto != null && streamProxyDto.isEnable()) { |
| | | JSONObject jsonObject = removeStreamProxyFromZlm(streamProxyDto); |
| | | if (jsonObject.getInteger("code") == 0) { |
| | | result = true; |
| | | streamProxyDto.setEnable(false); |
| | | videoManagerStorager.updateStreamProxy(streamProxyDto); |
| | | result = videoManagerStorager.updateStreamProxy(streamProxyDto); |
| | | } |
| | | } |
| | | return result; |
| | |
| | | "name=#{name}," + |
| | | "streamType=#{streamType}," + |
| | | "longitude=#{longitude}, " + |
| | | "latitude=#{latitude} " + |
| | | "latitude=#{latitude}," + |
| | | "status=${status} " + |
| | | "WHERE app=#{app} AND stream=#{stream} AND gbId=#{gbId}") |
| | | int update(GbStream gbStream); |
| | |
| | | dataSourceTransactionManager.commit(transactionStatus); //手动提交 |
| | | result = true; |
| | | }catch (Exception e) { |
| | | e.printStackTrace(); |
| | | dataSourceTransactionManager.rollback(transactionStatus); |
| | | } |
| | | return result; |
| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.web.bind.annotation.CrossOrigin; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.servlet.mvc.method.annotation.SseEmitter; |
| | |
| | | @Autowired |
| | | AlarmEventListener alarmEventListener; |
| | | |
| | | @ApiOperation("设置响应") |
| | | @ApiOperation("浏览器推送") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "browserId", value = "浏览器ID", dataTypeClass = String.class), |
| | | }) |
| | | @RequestMapping("/emit") |
| | | @PostMapping("/emit") |
| | | public SseEmitter emit(@RequestParam String browserId) { |
| | | final SseEmitter sseEmitter = new SseEmitter(0L); |
| | | try { |
| | |
| | | @ApiImplicitParam(name = "app", value = "应用名", dataTypeClass = String.class), |
| | | @ApiImplicitParam(name = "stream", value = "流id", dataTypeClass = String.class), |
| | | }) |
| | | @RequestMapping(value = "/getStreamInfoByAppAndStream") |
| | | @GetMapping(value = "/stream_info_by_app_and_stream") |
| | | @ResponseBody |
| | | public StreamInfo getStreamInfoByAppAndStream(String app, String stream){ |
| | | return mediaService.getStreamInfoByAppAndStreamWithCheck(app, stream); |
| | |
| | | @ApiImplicitParam(name = "page", value = "当前页", dataTypeClass = Integer.class), |
| | | @ApiImplicitParam(name = "count", value = "每页条数", dataTypeClass = Integer.class), |
| | | }) |
| | | @RequestMapping(value = "/list") |
| | | @GetMapping(value = "/list") |
| | | @ResponseBody |
| | | public PageInfo<GbStream> list(@RequestParam(required = false)Integer page, |
| | | @RequestParam(required = false)Integer count){ |
| | |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "streamId", value = "视频流ID", dataTypeClass = String.class), |
| | | }) |
| | | @PostMapping("/stop/{streamId}") |
| | | @GetMapping("/stop/{streamId}") |
| | | public DeferredResult<ResponseEntity<String>> playStop(@PathVariable String streamId) { |
| | | |
| | | logger.debug(String.format("设备预览/回放停止API调用,streamId:%s", streamId)); |
| | |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "ssrc", value = "视频流标识", dataTypeClass = String.class), |
| | | }) |
| | | @RequestMapping("/stop/{ssrc}") |
| | | @GetMapping("/stop/{ssrc}") |
| | | public ResponseEntity<String> playStop(@PathVariable String ssrc) { |
| | | |
| | | cmder.streamByeCmd(ssrc); |
| | |
| | | |
| | | |
| | | @ApiOperation("重启服务") |
| | | @RequestMapping(value = "/restart") |
| | | @GetMapping(value = "/restart") |
| | | @ResponseBody |
| | | public Object restart(){ |
| | | Thread restartThread = new Thread(new Runnable() { |
| | |
| | | @ApiImplicitParam(name="query", value = "查询内容", dataTypeClass = String.class), |
| | | @ApiImplicitParam(name="online", value = "是否在线", dataTypeClass = Boolean.class), |
| | | }) |
| | | @RequestMapping(value = "/list") |
| | | @GetMapping(value = "/list") |
| | | @ResponseBody |
| | | public PageInfo<StreamProxyItem> list(@RequestParam(required = false)Integer page, |
| | | @RequestParam(required = false)Integer count, |
| | |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "param", value = "代理参数", dataTypeClass = StreamProxyItem.class), |
| | | }) |
| | | @RequestMapping(value = "/save") |
| | | @PostMapping(value = "/save") |
| | | @ResponseBody |
| | | public Object save(@RequestBody StreamProxyItem param){ |
| | | logger.info("添加代理: " + JSONObject.toJSONString(param)); |
| | |
| | | @ApiImplicitParam(name = "app", value = "应用名", dataTypeClass = String.class), |
| | | @ApiImplicitParam(name = "stream", value = "流ID", dataTypeClass = String.class), |
| | | }) |
| | | @RequestMapping(value = "/del") |
| | | @DeleteMapping(value = "/del") |
| | | @ResponseBody |
| | | public Object del(String app, String stream){ |
| | | logger.info("移除代理: " + app + "/" + stream); |
| | |
| | | @ApiImplicitParam(name = "app", value = "应用名", dataTypeClass = String.class), |
| | | @ApiImplicitParam(name = "stream", value = "流ID", dataTypeClass = String.class), |
| | | }) |
| | | @RequestMapping(value = "/start") |
| | | @GetMapping(value = "/start") |
| | | @ResponseBody |
| | | public Object start(String app, String stream){ |
| | | logger.info("启用代理: " + app + "/" + stream); |
| | |
| | | @ApiImplicitParam(name = "app", value = "应用名", dataTypeClass = String.class), |
| | | @ApiImplicitParam(name = "stream", value = "流ID", dataTypeClass = String.class), |
| | | }) |
| | | @RequestMapping(value = "/stop") |
| | | @GetMapping(value = "/stop") |
| | | @ResponseBody |
| | | public Object stop(String app, String stream){ |
| | | logger.info("停用代理: " + app + "/" + stream); |
| | | boolean result = streamProxyService.stop(app, stream); |
| | | return "success"; |
| | | return result?"success":"fail"; |
| | | } |
| | | } |
| | |
| | | @ApiImplicitParam(name="query", value = "查询内容", dataTypeClass = String.class), |
| | | @ApiImplicitParam(name="online", value = "是否在线", dataTypeClass = Boolean.class), |
| | | }) |
| | | @RequestMapping(value = "/list") |
| | | @GetMapping(value = "/list") |
| | | @ResponseBody |
| | | public PageInfo<StreamPushItem> list(@RequestParam(required = false)Integer page, |
| | | @RequestParam(required = false)Integer count, |
| | |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "stream", value = "直播流关联国标平台", dataTypeClass = GbStream.class), |
| | | }) |
| | | @RequestMapping(value = "/save_to_gb") |
| | | @PostMapping(value = "/save_to_gb") |
| | | @ResponseBody |
| | | public Object saveToGB(@RequestBody GbStream stream){ |
| | | if (streamPushService.saveToGB(stream)){ |
| | |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "stream", value = "直播流关联国标平台", dataTypeClass = GbStream.class), |
| | | }) |
| | | @RequestMapping(value = "/remove_form_gb") |
| | | @DeleteMapping(value = "/remove_form_gb") |
| | | @ResponseBody |
| | | public Object removeFormGB(@RequestBody GbStream stream){ |
| | | if (streamPushService.removeFromGB(stream)){ |
| | |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.util.StringUtils; |
| | | import org.springframework.web.bind.annotation.CrossOrigin; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | |
| | | @ApiImplicitParam(name = "username", value = "用户名", dataTypeClass = String.class), |
| | | @ApiImplicitParam(name = "password", value = "密码(32未md5加密)", dataTypeClass = String.class), |
| | | }) |
| | | @RequestMapping("/login") |
| | | @GetMapping("/login") |
| | | public String login(String username, String password){ |
| | | if (!StringUtils.isEmpty(username) && username.equals(usernameConfig) |
| | | && !StringUtils.isEmpty(password) && password.equals(passwordConfig)) { |
| | |
| | | getDeviceList: function() { |
| | | let that = this; |
| | | this.getDeviceListLoading = true; |
| | | this.$axios.get(`/api/device/query/devices`,{ |
| | | this.$axios({ |
| | | method: 'get', |
| | | url:`/api/device/query/devices`, |
| | | params: { |
| | | page: that.currentPage, |
| | | count: that.count |
| | | } |
| | | } ) |
| | | .then(function (res) { |
| | | }).then(function (res) { |
| | | console.log(res); |
| | | console.log(res.data.list); |
| | | that.total = res.data.total; |
| | | that.deviceList = res.data.list; |
| | | that.getDeviceListLoading = false; |
| | | }) |
| | | .catch(function (error) { |
| | | }).catch(function (error) { |
| | | console.log(error); |
| | | that.getDeviceListLoading = false; |
| | | }); |
| | |
| | | //设置在登录状态 |
| | | this.isLoging = true; |
| | | |
| | | this.$axios.get("/api/user/login",{ |
| | | params: loginParam |
| | | } ) |
| | | .then(function (res) { |
| | | this.$axios({ |
| | | method: 'get', |
| | | url:"/api/user/login", |
| | | params: loginParam |
| | | }).then(function (res) { |
| | | console.log(JSON.stringify(res)); |
| | | if (res.data == "success") { |
| | | that.$cookies.set("session", {"username": that.username}) ; |
| | |
| | | type: 'error' |
| | | }); |
| | | } |
| | | }) |
| | | .catch(function (error) { |
| | | }).catch(function (error) { |
| | | that.$message.error(error.response.statusText); |
| | | that.isLoging = false; |
| | | }); |
| | |
| | | }, |
| | | deletePlatformCommit: function(platform) { |
| | | var that = this; |
| | | that.$axios.delete(`/api/platform/delete/${platform.serverGBId}`) |
| | | .then(function (res) { |
| | | if (res.data == "success") { |
| | | that.$message({ |
| | | showClose: true, |
| | | message: '删除成功', |
| | | type: 'success' |
| | | }); |
| | | that.initData() |
| | | } |
| | | }) |
| | | .catch(function (error) { |
| | | console.log(error); |
| | | }); |
| | | that.$axios({ |
| | | method: 'delete', |
| | | url:`/api/platform/delete/${platform.serverGBId}` |
| | | }).then(function (res) { |
| | | if (res.data == "success") { |
| | | that.$message({ |
| | | showClose: true, |
| | | message: '删除成功', |
| | | type: 'success' |
| | | }); |
| | | that.initData() |
| | | } |
| | | }).catch(function (error) { |
| | | console.log(error); |
| | | }); |
| | | }, |
| | | chooseChannel: function(platform) { |
| | | this.$refs.chooseChannelDialog.openDialog(platform.serverGBId, ()=>{ |
| | |
| | | getPlatformList: function() { |
| | | let that = this; |
| | | |
| | | this.$axios.get(`/api/platform/query/${that.count}/${that.currentPage}`) |
| | | .then(function (res) { |
| | | that.total = res.data.total; |
| | | that.platformList = res.data.list; |
| | | }) |
| | | .catch(function (error) { |
| | | console.log(error); |
| | | }); |
| | | this.$axios({ |
| | | method: 'get', |
| | | url:`/api/platform/query/${that.count}/${that.currentPage}` |
| | | }).then(function (res) { |
| | | that.total = res.data.total; |
| | | that.platformList = res.data.list; |
| | | }).catch(function (error) { |
| | | console.log(error); |
| | | }); |
| | | |
| | | } |
| | | |
| | |
| | | getPushList: function() { |
| | | let that = this; |
| | | this.getDeviceListLoading = true; |
| | | this.$axios.get(`/api/push/list`,{ |
| | | this.$axios({ |
| | | method: 'get', |
| | | url:`/api/push/list`, |
| | | params: { |
| | | page: that.currentPage, |
| | | count: that.count |
| | | } |
| | | } ) |
| | | .then(function (res) { |
| | | }).then(function (res) { |
| | | console.log(res); |
| | | console.log(res.data.list); |
| | | that.total = res.data.total; |
| | | that.pushList = res.data.list; |
| | | that.getDeviceListLoading = false; |
| | | }) |
| | | .catch(function (error) { |
| | | }).catch(function (error) { |
| | | console.log(error); |
| | | that.getDeviceListLoading = false; |
| | | }); |
| | |
| | | playPuhsh: function(row){ |
| | | let that = this; |
| | | this.getListLoading = true; |
| | | this.$axios.get(`/api/media/getStreamInfoByAppAndStream`,{ |
| | | this.$axios({ |
| | | method: 'get', |
| | | url:`/api/media/stream_info_by_app_and_stream`, |
| | | params: { |
| | | app: row.app, |
| | | stream: row.stream |
| | | } |
| | | }) |
| | | .then(function (res) { |
| | | }).then(function (res) { |
| | | that.getListLoading = false; |
| | | that.$refs.devicePlayer.openDialog("streamPlay", null, null, { |
| | | streamInfo: res.data, |
| | | hasAudio: true |
| | | }); |
| | | }) |
| | | .catch(function (error) { |
| | | }).catch(function (error) { |
| | | console.log(error); |
| | | that.getListLoading = false; |
| | | }); |
| | |
| | | }, |
| | | removeFromGB: function(row){ |
| | | var that = this; |
| | | that.$axios.post(`/api/push/remove_form_gb`, row) |
| | | .then(function (res) { |
| | | console.log(res); |
| | | console.log(res.data == "success"); |
| | | if (res.data == "success") { |
| | | that.$axios({ |
| | | method:"delete", |
| | | url:"/api/push/remove_form_gb", |
| | | data:row |
| | | }).then((res)=>{ |
| | | if (res.data == "success") { |
| | | that.initData() |
| | | } |
| | | }) |
| | | .catch(function (error) { |
| | | console.log(error); |
| | | }); |
| | | }).catch(function (error) { |
| | | console.log(error); |
| | | }); |
| | | }, |
| | | dateFormat: function(/** timestamp=0 **/) { |
| | | var ts = arguments[0] || 0; |
| | |
| | | <el-button-group> |
| | | <el-button size="mini" icon="el-icon-video-play" v-if="scope.row.enable" @click="play(scope.row)">播放</el-button> |
| | | <el-button size="mini" icon="el-icon-close" type="success" v-if="scope.row.enable" @click="stop(scope.row)">停用</el-button> |
| | | <el-button size="mini" icon="el-icon-check" type="primary" v-if="!scope.row.enable" @click="start(scope.row)">启用</el-button> |
| | | <el-button size="mini" icon="el-icon-check" type="primary" :loading="startBtnLaoding" v-if="!scope.row.enable" @click="start(scope.row)">启用</el-button> |
| | | <el-button size="mini" icon="el-icon-delete" type="danger" @click="deleteStreamProxy(scope.row)">删除</el-button> |
| | | </el-button-group> |
| | | </template> |
| | |
| | | currentPage:1, |
| | | count:15, |
| | | total:0, |
| | | getListLoading: false |
| | | getListLoading: false, |
| | | startBtnLaoding: false |
| | | }; |
| | | }, |
| | | computed: { |
| | |
| | | getStreamProxyList: function() { |
| | | let that = this; |
| | | this.getListLoading = true; |
| | | this.$axios.get(`/api/proxy/list`,{ |
| | | this.$axios({ |
| | | method: 'get', |
| | | url:`/api/proxy/list`, |
| | | params: { |
| | | page: that.currentPage, |
| | | count: that.count |
| | | } |
| | | } ) |
| | | .then(function (res) { |
| | | }).then(function (res) { |
| | | console.log(res); |
| | | console.log(res.data.list); |
| | | that.total = res.data.total; |
| | | that.streamProxyList = res.data.list; |
| | | that.getListLoading = false; |
| | | }) |
| | | .catch(function (error) { |
| | | }).catch(function (error) { |
| | | console.log(error); |
| | | that.getListLoading = false; |
| | | }); |
| | |
| | | play: function(row){ |
| | | let that = this; |
| | | this.getListLoading = true; |
| | | this.$axios.get(`/api/media/getStreamInfoByAppAndStream`,{ |
| | | this.$axios({ |
| | | method: 'get', |
| | | url:`/api/media/stream_info_by_app_and_stream`, |
| | | params: { |
| | | app: row.app, |
| | | stream: row.stream |
| | | } |
| | | }) |
| | | .then(function (res) { |
| | | }).then(function (res) { |
| | | that.getListLoading = false; |
| | | that.$refs.devicePlayer.openDialog("streamPlay", null, null, { |
| | | streamInfo: res.data, |
| | | hasAudio: true |
| | | }); |
| | | }) |
| | | .catch(function (error) { |
| | | }).catch(function (error) { |
| | | console.log(error); |
| | | that.getListLoading = false; |
| | | }); |
| | |
| | | console.log(1111) |
| | | let that = this; |
| | | this.getListLoading = true; |
| | | this.$axios.get(`/api/proxy/del`,{ |
| | | params: { |
| | | that.$axios({ |
| | | method:"delete", |
| | | url:"/api/proxy/del", |
| | | params:{ |
| | | app: row.app, |
| | | stream: row.stream |
| | | } |
| | | }) |
| | | .then(function (res) { |
| | | that.getListLoading = false; |
| | | }).then((res)=>{ |
| | | that.getListLoading = false; |
| | | that.initData() |
| | | }) |
| | | .catch(function (error) { |
| | | console.log(error); |
| | | }).catch(function (error) { |
| | | console.log(error); |
| | | that.getListLoading = false; |
| | | }); |
| | | }); |
| | | }, |
| | | start: function(row){ |
| | | let that = this; |
| | | this.getListLoading = true; |
| | | this.$axios.get(`/api/proxy/start`,{ |
| | | this.startBtnLaoding = true; |
| | | this.$axios({ |
| | | method: 'get', |
| | | url:`/api/proxy/start`, |
| | | params: { |
| | | app: row.app, |
| | | stream: row.stream |
| | | } |
| | | }) |
| | | .then(function (res) { |
| | | }).then(function (res) { |
| | | that.getListLoading = false; |
| | | that.startBtnLaoding = false; |
| | | that.initData() |
| | | }) |
| | | .catch(function (error) { |
| | | }).catch(function (error) { |
| | | console.log(error); |
| | | that.getListLoading = false; |
| | | that.startBtnLaoding = false; |
| | | }); |
| | | }, |
| | | stop: function(row){ |
| | | let that = this; |
| | | this.getListLoading = true; |
| | | this.$axios.get(`/api/proxy/stop`,{ |
| | | this.$axios({ |
| | | method: 'get', |
| | | url:`/api/proxy/stop`, |
| | | params: { |
| | | app: row.app, |
| | | stream: row.stream |
| | | } |
| | | }) |
| | | .then(function (res) { |
| | | }).then(function (res) { |
| | | that.getListLoading = false; |
| | | that.initData() |
| | | }) |
| | | .catch(function (error) { |
| | | }).catch(function (error) { |
| | | console.log(error); |
| | | that.getListLoading = false; |
| | | }); |
| | |
| | | }, |
| | | getDeviceChannelList: function () { |
| | | let that = this; |
| | | |
| | | this.$axios.get(`/api/device/query/devices/${this.$route.params.deviceId}/channels`, { |
| | | params: { |
| | | page: that.currentPage, |
| | | this.$axios({ |
| | | method: 'get', |
| | | url: `/api/device/query/devices/${this.$route.params.deviceId}/channels`, |
| | | params:{ |
| | | page: that.currentPage, |
| | | count: that.count, |
| | | query: that.searchSrt, |
| | | online: that.online, |
| | | channelType: that.channelType |
| | | } |
| | | }) |
| | | .then(function (res) { |
| | | } |
| | | }).then(function (res) { |
| | | console.log(res); |
| | | that.total = res.data.total; |
| | | that.deviceChannelList = res.data.list; |
| | |
| | | that.$nextTick(() => { |
| | | that.$refs.channelListTable.doLayout(); |
| | | }) |
| | | }) |
| | | .catch(function (error) { |
| | | console.log(error); |
| | | }); |
| | | }).catch(function (error) { |
| | | console.log(error); |
| | | }); |
| | | |
| | | |
| | | }, |
| | | |
| | |
| | | console.log(itemData) |
| | | var that = this; |
| | | this.$axios({ |
| | | method: 'post', |
| | | method: 'get', |
| | | url: '/api/play/stop/' + itemData.streamId |
| | | }).then(function (res) { |
| | | console.log(JSON.stringify(res)); |
| | |
| | | showSubchannels: function (channelId) { |
| | | let that = this; |
| | | |
| | | this.$axios.get(`/api/device/query/sub_channels/${this.deviceId}/${this.parentChannelId}/channels`, { |
| | | params: { |
| | | page: that.currentPage, |
| | | count: that.count, |
| | | query: that.searchSrt, |
| | | online: that.online, |
| | | channelType: that.channelType |
| | | } |
| | | this.$axios({ |
| | | method: 'get', |
| | | url:`/api/device/query/sub_channels/${this.deviceId}/${this.parentChannelId}/channels`, |
| | | params: { |
| | | page: that.currentPage, |
| | | count: that.count, |
| | | query: that.searchSrt, |
| | | online: that.online, |
| | | channelType: that.channelType |
| | | } |
| | | }).then(function (res) { |
| | | that.total = res.data.total; |
| | | that.deviceChannelList = res.data.list; |
| | | // 防止出现表格错位 |
| | | that.$nextTick(() => { |
| | | that.$refs.channelListTable.doLayout(); |
| | | }) |
| | | .then(function (res) { |
| | | that.total = res.data.total; |
| | | that.deviceChannelList = res.data.list; |
| | | // 防止出现表格错位 |
| | | that.$nextTick(() => { |
| | | that.$refs.channelListTable.doLayout(); |
| | | }) |
| | | }) |
| | | .catch(function (error) { |
| | | console.log(error); |
| | | }); |
| | | }).catch(function (error) { |
| | | console.log(error); |
| | | }); |
| | | }, |
| | | search: function () { |
| | | console.log(this.searchSrt) |
| | |
| | | this.endTime = null; |
| | | } |
| | | let self = this; |
| | | this.$axios.get(`/api/position/history/${this.deviceId}`, { |
| | | this.$axios({ |
| | | method: 'get', |
| | | url:`/api/position/history/${this.deviceId}`, |
| | | params: { |
| | | start: self.startTime, |
| | | end: self.endTime, |
| | | }, |
| | | }) |
| | | .then(function (res) { |
| | | }).then(function (res) { |
| | | self.total = res.data.length; |
| | | self.mobilePositionList = res.data; |
| | | console.log(self.mobilePositionList); |
| | |
| | | self.showMarkPoints(self); |
| | | }); |
| | | } |
| | | }) |
| | | .catch(function (error) { |
| | | }).catch(function (error) { |
| | | console.log(error); |
| | | }); |
| | | }, |
| | |
| | | this.mapPointList = []; |
| | | this.mobilePositionList = []; |
| | | let self = this; |
| | | this.$axios.get(`/api/position/latest/${this.deviceId}`) |
| | | .then(function (res) { |
| | | this.$axios({ |
| | | method: 'get', |
| | | url:`/api/position/latest/${this.deviceId}` |
| | | }).then(function (res) { |
| | | console.log(res.data); |
| | | self.total = res.data.length; |
| | | self.mobilePositionList.push(res.data); |
| | |
| | | self.showMarkPoints(self); |
| | | }); |
| | | } |
| | | }) |
| | | .catch(function (error) { |
| | | }).catch(function (error) { |
| | | console.log(error); |
| | | }); |
| | | }, |
| | | subscribeMobilePosition: function() { |
| | | let self = this; |
| | | this.$axios.get(`/api/position/subscribe/${this.deviceId}`, { |
| | | params: { |
| | | expires: self.expired, |
| | | interval: self.interval, |
| | | }, |
| | | }) |
| | | .then(function (res) { |
| | | this.$axios({ |
| | | method: 'get', |
| | | url:`/api/position/subscribe/${this.deviceId}`, |
| | | params: { |
| | | expires: self.expired, |
| | | interval: self.interval, |
| | | }, |
| | | }).then(function (res) { |
| | | console.log(res.data); |
| | | }) |
| | | .catch(function (error) { |
| | |
| | | }, |
| | | unSubscribeMobilePosition: function() { |
| | | let self = this; |
| | | this.$axios.get(`/api/position/subscribe/${this.deviceId}`, { |
| | | params: { |
| | | expires: 0, |
| | | interval: self.interval, |
| | | }, |
| | | this.$axios({ |
| | | method: 'get', |
| | | url:`/api/position/subscribe/${this.deviceId}`, |
| | | params: { |
| | | expires: 0, |
| | | interval: self.interval, |
| | | }, |
| | | }) |
| | | .then(function (res) { |
| | | console.log(res.data); |
| | | }) |
| | | .catch(function (error) { |
| | | }).catch(function (error) { |
| | | console.log(error); |
| | | }); |
| | | }, |
| | |
| | | onSubmit: function () { |
| | | console.log("onSubmit"); |
| | | var that = this; |
| | | that.$axios |
| | | .post(`/api/proxy/save`, that.proxyParam) |
| | | .then(function (res) { |
| | | that.$axios({ |
| | | method: 'post', |
| | | url:`/api/proxy/save`, |
| | | data: that.proxyParam |
| | | }).then(function (res) { |
| | | console.log(res); |
| | | console.log(res.data == "success"); |
| | | if (res.data == "success") { |
| | |
| | | that.listChangeCallback(); |
| | | } |
| | | } |
| | | }) |
| | | .catch(function (error) { |
| | | }).catch(function (error) { |
| | | console.log(error); |
| | | }); |
| | | }, |
| | |
| | | deviceGBIdExit: async function (deviceGbId) { |
| | | var result = false; |
| | | var that = this; |
| | | await that.$axios |
| | | .post(`/api/platform/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() { |
| | |
| | | onSubmit: function () { |
| | | console.log("onSubmit"); |
| | | var that = this; |
| | | that.$axios |
| | | .post(`/api/push/save_to_gb`, that.proxyParam) |
| | | .then(function (res) { |
| | | console.log(res); |
| | | console.log(res.data == "success"); |
| | | that.$axios({ |
| | | method:"post", |
| | | url:`/api/push/save_to_gb`, |
| | | data: that.proxyParam |
| | | }).then(function (res) { |
| | | if (res.data == "success") { |
| | | that.$message({ |
| | | showClose: true, |
| | |
| | | that.listChangeCallback(); |
| | | } |
| | | } |
| | | }) |
| | | .catch(function (error) { |
| | | }).catch(function (error) { |
| | | console.log(error); |
| | | }); |
| | | }); |
| | | }, |
| | | close: function () { |
| | | console.log("关闭加入GB"); |
| | |
| | | deviceGBIdExit: async function (deviceGbId) { |
| | | var result = false; |
| | | var that = this; |
| | | await that.$axios |
| | | .post(`/api/platform/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() { |
| | |
| | | getChannelList: function () { |
| | | let that = this; |
| | | |
| | | this.$axios.get(`/api/platform/channel_list`, { |
| | | this.$axios({ |
| | | method:"get", |
| | | url:`/api/platform/channel_list`, |
| | | params: { |
| | | page: that.currentPage, |
| | | count: that.count, |
| | |
| | | getChannelList: function () { |
| | | let that = this; |
| | | |
| | | this.$axios.get(`/api/gbStream/list`, { |
| | | params: { |
| | | page: that.currentPage, |
| | | count: that.count, |
| | | query: that.searchSrt, |
| | | online: that.online, |
| | | choosed: that.choosed, |
| | | platformId: that.platformId, |
| | | channelType: that.channelType |
| | | } |
| | | this.$axios({ |
| | | method: 'get', |
| | | url:`/api/gbStream/list`, |
| | | params: { |
| | | page: that.currentPage, |
| | | count: that.count, |
| | | query: that.searchSrt, |
| | | online: that.online, |
| | | choosed: that.choosed, |
| | | platformId: that.platformId, |
| | | channelType: that.channelType |
| | | } |
| | | }) |
| | | .then(function (res) { |
| | | that.total = res.data.total; |
| | |
| | | methods: { |
| | | openDialog: function (platform, callback) { |
| | | var that = this; |
| | | this.$axios |
| | | .get(`/api/platform/server_config`) |
| | | .then(function (res) { |
| | | this.$axios({ |
| | | method: 'get', |
| | | url:`/api/platform/server_config` |
| | | }).then(function (res) { |
| | | console.log(res); |
| | | that.platform.deviceGBId = res.data.username; |
| | | that.platform.deviceIp = res.data.deviceIp; |
| | | that.platform.devicePort = res.data.devicePort; |
| | | that.platform.username = res.data.username; |
| | | that.platform.password = res.data.password; |
| | | }) |
| | | .catch(function (error) { |
| | | }).catch(function (error) { |
| | | console.log(error); |
| | | }); |
| | | this.showDialog = true; |
| | |
| | | onSubmit: function () { |
| | | console.log("onSubmit"); |
| | | var that = this; |
| | | that.$axios |
| | | .post(`/api/platform/save`, that.platform) |
| | | .then(function (res) { |
| | | console.log(res); |
| | | console.log(res.data == "success"); |
| | | that.$axios({ |
| | | method: 'post', |
| | | url:`/api/platform/save`, |
| | | data: that.platform |
| | | }).then(function (res) { |
| | | if (res.data == "success") { |
| | | that.$message({ |
| | | showClose: true, |
| | |
| | | that.listChangeCallback(); |
| | | } |
| | | } |
| | | }) |
| | | .catch(function (error) { |
| | | }).catch(function (error) { |
| | | console.log(error); |
| | | }); |
| | | }, |
| | |
| | | deviceGBIdExit: async function (deviceGbId) { |
| | | var result = false; |
| | | var that = this; |
| | | await that.$axios |
| | | .post(`/api/platform/exit/${deviceGbId}`) |
| | | await that.$axios({ |
| | | method: 'post', |
| | | url:`/api/platform/exit/${deviceGbId}`}) |
| | | .then(function (res) { |
| | | result = res.data; |
| | | }) |
| | |
| | | name: 'rtcPlayer', |
| | | data() { |
| | | return { |
| | | webrtcPlayer: null |
| | | webrtcPlayer: null, |
| | | timer: null |
| | | }; |
| | | }, |
| | | props: ['videoUrl', 'error', 'hasaudio'], |
| | |
| | | this.eventcallbacK("OFFER ANSWER ERROR ", "offer anwser 交换失败") |
| | | if (e.code ==-400 && e.msg=="流不存在"){ |
| | | console.log("111111") |
| | | setTimeout(()=>{ |
| | | this.timer = setTimeout(()=>{ |
| | | this.webrtcPlayer.close(); |
| | | this.play(url) |
| | | }, 100) |
| | |
| | | console.log(message) |
| | | } |
| | | }, |
| | | destroyed() { |
| | | clearTimeout(this.timer); |
| | | }, |
| | | } |
| | | </script> |
| | | |