调整前端获取服务ID方式
parent
0cebbee0a9
commit
785da6d5ef
|
@ -80,11 +80,10 @@ public interface StreamPushMapper {
|
|||
List<StreamPush> selectAllByMediaServerIdWithOutGbID(String mediaServerId);
|
||||
|
||||
@Update("UPDATE wvp_stream_push " +
|
||||
"SET pushing=#{pushing} " +
|
||||
"SET pushing=#{pushing}, server_id=#{serverId} " +
|
||||
"WHERE id=#{id}")
|
||||
int updatePushStatus(@Param("id") int id, @Param("pushing") boolean pushing);
|
||||
|
||||
|
||||
@Select("<script> "+
|
||||
"SELECT st.*, st.id as data_device_id, wdc.*, wdc.id as gb_id FROM wvp_stream_push st LEFT join wvp_device_channel wdc on wdc.data_type = 2 and st.id = wdc.data_device_id " +
|
||||
"where (st.app, st.stream) in (" +
|
||||
|
|
|
@ -497,8 +497,6 @@ public class StreamPushServiceImpl implements IStreamPushService {
|
|||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void updatePushStatus(StreamPush streamPush, boolean pushIng) {
|
||||
|
@ -507,6 +505,7 @@ public class StreamPushServiceImpl implements IStreamPushService {
|
|||
streamPush.setGbStatus(pushIng?"ON":"OFF");
|
||||
}
|
||||
streamPush.setPushTime(DateUtil.getNow());
|
||||
streamPush.setServerId(userSetting.getServerId());
|
||||
streamPushMapper.updatePushStatus(streamPush.getId(), pushIng);
|
||||
if (ObjectUtils.isEmpty(streamPush.getGbDeviceId())) {
|
||||
return;
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
</el-select>
|
||||
<el-button icon="el-icon-plus" size="mini" style="margin-right: 1rem;" type="primary" @click="add">添加设备
|
||||
</el-button>
|
||||
<el-button icon="el-icon-info" size="mini" style="margin-right: 1rem;" type="primary" @click="showInfo(true)">平台信息
|
||||
<el-button icon="el-icon-info" size="mini" style="margin-right: 1rem;" type="primary" @click="showInfo()">平台信息
|
||||
</el-button>
|
||||
<el-button icon="el-icon-refresh-right" circle size="mini" :loading="getDeviceListLoading"
|
||||
@click="getDeviceList()"></el-button>
|
||||
|
@ -144,7 +144,7 @@ export default {
|
|||
currentPage: 1,
|
||||
count: 15,
|
||||
total: 0,
|
||||
serverId: null,
|
||||
serverId: this.$myServerId,
|
||||
getDeviceListLoading: false,
|
||||
};
|
||||
},
|
||||
|
@ -173,8 +173,6 @@ export default {
|
|||
initData: function () {
|
||||
this.currentPage = 1;
|
||||
this.total= 0;
|
||||
// 获取平台信息
|
||||
this.showInfo(false)
|
||||
this.getDeviceList();
|
||||
},
|
||||
currentChange: function (val) {
|
||||
|
@ -337,18 +335,14 @@ export default {
|
|||
|
||||
})
|
||||
},
|
||||
showInfo: function (showConfigInfo){
|
||||
|
||||
showInfo: function (){
|
||||
this.$axios({
|
||||
method: 'get',
|
||||
url: `/api/server/system/configInfo`,
|
||||
}).then( (res)=> {
|
||||
if (res.data.code === 0) {
|
||||
this.serverId = res.data.data.addOn.serverId;
|
||||
console.log(this.serverId);
|
||||
if(showConfigInfo) {
|
||||
this.$refs.configInfo.openDialog(res.data.data)
|
||||
}
|
||||
this.$refs.configInfo.openDialog(res.data.data)
|
||||
}
|
||||
}).catch( (error)=> {
|
||||
});
|
||||
|
|
|
@ -58,7 +58,8 @@
|
|||
<el-table-column label="拉流状态" min-width="120" >
|
||||
<template v-slot:default="scope">
|
||||
<div slot="reference" class="name-wrapper">
|
||||
<el-tag size="medium" v-if="scope.row.pulling">正在拉流</el-tag>
|
||||
<el-tag size="medium" v-if="scope.row.pulling && serverId !== scope.row.serverId" style="border-color: #ecf1af">正在拉流</el-tag>
|
||||
<el-tag size="medium" v-if="scope.row.pulling && serverId === scope.row.serverId">正在拉流</el-tag>
|
||||
<el-tag size="medium" type="info" v-if="!scope.row.pulling">尚未拉流</el-tag>
|
||||
</div>
|
||||
</template>
|
||||
|
@ -136,6 +137,7 @@
|
|||
searchSrt: "",
|
||||
mediaServerId: "",
|
||||
pulling: "",
|
||||
serverId: this.$myServerId,
|
||||
mediaServerObj: new MediaServer(),
|
||||
mediaServerList: [],
|
||||
};
|
||||
|
|
|
@ -52,7 +52,8 @@
|
|||
</el-table-column>
|
||||
<el-table-column label="推流状态" min-width="100">
|
||||
<template v-slot:default="scope">
|
||||
<el-tag size="medium" v-if="scope.row.pushing">推流中</el-tag>
|
||||
<el-tag size="medium" v-if="scope.row.pushing && serverId !== scope.row.serverId" style="border-color: #ecf1af">推流中</el-tag>
|
||||
<el-tag size="medium" v-if="scope.row.pushing && serverId === scope.row.serverId">推流中</el-tag>
|
||||
<el-tag size="medium" type="info" v-if="!scope.row.pushing">已停止</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
@ -144,6 +145,7 @@ export default {
|
|||
mediaServerList: [],
|
||||
multipleSelection: [],
|
||||
loading: false,
|
||||
serverId: this.$myServerId,
|
||||
streamPush: null,
|
||||
};
|
||||
},
|
||||
|
|
|
@ -76,6 +76,17 @@ axios.interceptors.request.use(
|
|||
Vue.prototype.$axios = axios;
|
||||
Vue.prototype.$cookies.config(60 * 30);
|
||||
|
||||
// 获取本平台的服务ID
|
||||
axios({
|
||||
method: 'get',
|
||||
url: `/api/server/system/configInfo`,
|
||||
}).then( (res)=> {
|
||||
if (res.data.code === 0) {
|
||||
Vue.prototype.$myServerId = res.data.data.addOn.serverId;
|
||||
}
|
||||
}).catch( (error)=> {
|
||||
});
|
||||
|
||||
new Vue({
|
||||
router: router,
|
||||
render: h => h(App),
|
||||
|
|
Loading…
Reference in New Issue