调整前端获取服务ID方式

dev/数据库统合
648540858 2024-12-30 16:32:37 +08:00
parent 0cebbee0a9
commit 785da6d5ef
6 changed files with 23 additions and 16 deletions

View File

@ -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 (" +

View File

@ -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;

View File

@ -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)=> {
});

View File

@ -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: [],
};

View File

@ -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,
};
},

View File

@ -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),