临时提交
parent
2f4d983f9f
commit
c96c29776d
|
@ -192,10 +192,9 @@ public class StreamProxyController {
|
||||||
@GetMapping(value = "/stop")
|
@GetMapping(value = "/stop")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
@Operation(summary = "停用代理", security = @SecurityRequirement(name = JwtUtils.HEADER))
|
@Operation(summary = "停用代理", security = @SecurityRequirement(name = JwtUtils.HEADER))
|
||||||
@Parameter(name = "app", description = "应用名", required = true)
|
@Parameter(name = "id", description = "代理Id", required = true)
|
||||||
@Parameter(name = "stream", description = "流id", required = true)
|
public void stop(int id){
|
||||||
public void stop(String app, String stream){
|
log.info("停用代理: {}", id);
|
||||||
log.info("停用代理: " + app + "/" + stream);
|
streamProxyService.stop(id);
|
||||||
streamProxyService.stopByAppAndStream(app, stream);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -94,4 +94,6 @@ public interface IStreamProxyService {
|
||||||
void delete(int id);
|
void delete(int id);
|
||||||
|
|
||||||
StreamInfo start(int id);
|
StreamInfo start(int id);
|
||||||
|
|
||||||
|
void stop(int id);
|
||||||
}
|
}
|
||||||
|
|
|
@ -474,8 +474,14 @@ public class StreamProxyServiceImpl implements IStreamProxyService {
|
||||||
return streamProxyMapper.select(id);
|
return streamProxyMapper.select(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void stop(int id) {
|
||||||
|
StreamProxy streamProxy = streamProxyMapper.select(id);
|
||||||
|
if (streamProxy == null) {
|
||||||
|
throw new ControllerException(ErrorCode.ERROR404.getCode(), "代理信息未找到");
|
||||||
|
}
|
||||||
|
stopProxy(streamProxy);
|
||||||
|
}
|
||||||
|
|
||||||
// @Scheduled(cron = "* 0/10 * * * ?")
|
// @Scheduled(cron = "* 0/10 * * * ?")
|
||||||
// public void asyncCheckStreamProxyStatus() {
|
// public void asyncCheckStreamProxyStatus() {
|
||||||
|
|
|
@ -74,8 +74,10 @@
|
||||||
<el-table-column prop="createTime" label="创建时间" min-width="150" show-overflow-tooltip/>
|
<el-table-column prop="createTime" label="创建时间" min-width="150" show-overflow-tooltip/>
|
||||||
<el-table-column label="操作" width="360" fixed="right">
|
<el-table-column label="操作" width="360" fixed="right">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button size="medium" icon="el-icon-video-play" type="text" v-if="scope.row.enable" @click="play(scope.row)">播放</el-button>
|
<el-button size="medium" icon="el-icon-video-play" type="text" @click="play(scope.row)">播放</el-button>
|
||||||
<el-divider direction="vertical"></el-divider>
|
<el-divider direction="vertical"></el-divider>
|
||||||
|
<el-button size="medium" icon="el-icon-switch-button" style="color: #f56c6c" type="text" v-if="scope.row.pulling" @click="stopPlay(scope.row)">停止</el-button>
|
||||||
|
<el-divider direction="vertical" v-if="scope.row.pulling" ></el-divider>
|
||||||
<el-button size="medium" icon="el-icon-edit" type="text" @click="edit(scope.row)">
|
<el-button size="medium" icon="el-icon-edit" type="text" @click="edit(scope.row)">
|
||||||
编辑
|
编辑
|
||||||
</el-button>
|
</el-button>
|
||||||
|
@ -274,6 +276,26 @@
|
||||||
console.log(error);
|
console.log(error);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
},
|
||||||
|
stopPlay: function(row){
|
||||||
|
let that = this;
|
||||||
|
this.$axios({
|
||||||
|
method: 'get',
|
||||||
|
url:`/api/proxy/stop`,
|
||||||
|
params: {
|
||||||
|
id: row.id,
|
||||||
|
}
|
||||||
|
}).then(function (res) {
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
|
||||||
|
}else {
|
||||||
|
that.$message.error(res.data.msg);
|
||||||
|
}
|
||||||
|
|
||||||
|
}).catch(function (error) {
|
||||||
|
console.log(error);
|
||||||
|
});
|
||||||
|
|
||||||
},
|
},
|
||||||
queryCloudRecords: function (row) {
|
queryCloudRecords: function (row) {
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue