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