[RPC 云端录像] 修复服务ID 获取

dev/数据库统合
648540858 2024-12-31 15:36:48 +08:00
parent 32e90b2537
commit 874733fa2c
7 changed files with 41 additions and 25 deletions

View File

@ -116,6 +116,7 @@ public class CloudRecordServiceImpl implements ICloudRecordService {
@EventListener
public void onApplicationEvent(MediaRecordMp4Event event) {
CloudRecordItem cloudRecordItem = CloudRecordItem.getInstance(event);
cloudRecordItem.setServerId(userSetting.getServerId());
if (ObjectUtils.isEmpty(cloudRecordItem.getCallId())) {
StreamAuthorityInfo streamAuthorityInfo = redisCatchStorage.getStreamAuthorityInfo(event.getApp(), event.getStream());
if (streamAuthorityInfo != null) {

View File

@ -21,6 +21,7 @@ public interface CloudRecordServiceMapper {
" folder," +
" file_path," +
" file_size," +
" server_id," +
" time_len ) " +
"VALUES (" +
" #{app}," +
@ -33,6 +34,7 @@ public interface CloudRecordServiceMapper {
" #{folder}," +
" #{filePath}," +
" #{fileSize}," +
" #{serverId}," +
" #{timeLen})" +
" </script>")
int add(CloudRecordItem cloudRecordItem);

View File

@ -65,8 +65,8 @@
</el-table-column>
<el-table-column label="时长">
<template v-slot:default="scope">
<el-tag v-if="serverId !== scope.row.serverId" style="border-color: #ecf1af">{{formatTime(scope.row.timeLen)}}</el-tag>
<el-tag v-if="serverId === scope.row.serverId">{{formatTime(scope.row.timeLen)}}</el-tag>
<el-tag v-if="Vue.prototype.$myServerId !== scope.row.serverId" style="border-color: #ecf1af">{{formatTime(scope.row.timeLen)}}</el-tag>
<el-tag v-if="Vue.prototype.$myServerId === scope.row.serverId">{{formatTime(scope.row.timeLen)}}</el-tag>
</template>
</el-table-column>
<el-table-column prop="fileName" label="文件名称">
@ -135,7 +135,6 @@ export default {
mediaServerPath: null, //
recordList: [], //
chooseRecord: null, //
serverId: this.$myServerId,
updateLooper: 0, //
winHeight: window.innerHeight - 250,
currentPage: 1,

View File

@ -56,8 +56,8 @@
<el-table-column label="状态" min-width="100">
<template v-slot:default="scope">
<div slot="reference" class="name-wrapper">
<el-tag size="medium" v-if="scope.row.onLine && serverId !== scope.row.serverId" style="border-color: #ecf1af">线</el-tag>
<el-tag size="medium" v-if="scope.row.onLine && serverId === scope.row.serverId">线</el-tag>
<el-tag size="medium" v-if="scope.row.onLine && Vue.prototype.$myServerId !== scope.row.serverId" style="border-color: #ecf1af">线</el-tag>
<el-tag size="medium" v-if="scope.row.onLine && Vue.prototype.$myServerId === scope.row.serverId">线</el-tag>
<el-tag size="medium" type="info" v-if="!scope.row.onLine">线</el-tag>
</div>
</template>
@ -122,6 +122,7 @@ import uiHeader from '../layout/UiHeader.vue'
import deviceEdit from './dialog/deviceEdit.vue'
import syncChannelProgress from './dialog/SyncChannelProgress.vue'
import configInfo from "./dialog/configInfo.vue";
import Vue from "vue";
export default {
name: 'app',
@ -144,11 +145,13 @@ export default {
currentPage: 1,
count: 15,
total: 0,
serverId: this.$myServerId,
getDeviceListLoading: false,
};
},
computed: {
Vue() {
return Vue
},
getcurrentDeviceChannels: function () {
let data = this.currentDevice['channelMap'];
let channels = null;

View File

@ -58,8 +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 && 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" v-if="scope.row.pulling && Vue.prototype.$myServerId !== scope.row.serverId" style="border-color: #ecf1af"></el-tag>
<el-tag size="medium" v-if="scope.row.pulling && Vue.prototype.$myServerId === scope.row.serverId"></el-tag>
<el-tag size="medium" type="info" v-if="!scope.row.pulling"></el-tag>
</div>
</template>
@ -67,8 +67,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.enable && serverId !== scope.row.serverId" style="border-color: #ecf1af"></el-tag>
<el-tag size="medium" v-if="scope.row.enable && serverId === scope.row.serverId"></el-tag>
<el-tag size="medium" v-if="scope.row.enable && Vue.prototype.$myServerId !== scope.row.serverId" style="border-color: #ecf1af"></el-tag>
<el-tag size="medium" v-if="scope.row.enable && Vue.prototype.$myServerId === scope.row.serverId"></el-tag>
<el-tag size="medium" type="info" v-if="!scope.row.enable"></el-tag>
</div>
</template>
@ -114,6 +114,8 @@
import uiHeader from '../layout/UiHeader.vue'
import StreamProxyEdit from "./StreamProxyEdit";
import MediaServer from "./service/MediaServer";
import Vue from "vue";
export default {
name: 'streamProxyList',
components: {
@ -138,12 +140,14 @@
searchSrt: "",
mediaServerId: "",
pulling: "",
serverId: this.$myServerId,
mediaServerObj: new MediaServer(),
mediaServerList: [],
};
},
computed: {
Vue() {
return Vue
},
},
mounted() {
this.initData();

View File

@ -52,8 +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 && 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" v-if="scope.row.pushing && Vue.prototype.$myServerId !== scope.row.serverId" style="border-color: #ecf1af"></el-tag>
<el-tag size="medium" v-if="scope.row.pushing && Vue.prototype.$myServerId === scope.row.serverId"></el-tag>
<el-tag size="medium" type="info" v-if="!scope.row.pushing"></el-tag>
</template>
</el-table-column>
@ -117,6 +117,7 @@ import importChannel from './dialog/importChannel.vue'
import MediaServer from './service/MediaServer'
import StreamPushEdit from "./StreamPushEdit";
import ChannelEdit from "./ChannelEdit.vue";
import Vue from "vue";
export default {
name: 'streamPushList',
@ -145,11 +146,14 @@ export default {
mediaServerList: [],
multipleSelection: [],
loading: false,
serverId: this.$myServerId,
streamPush: null,
};
},
computed: {},
computed: {
Vue() {
return Vue
},
},
mounted() {
this.initData();
this.updateLooper = setInterval(this.getPushList, 2000);

View File

@ -76,18 +76,21 @@ 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({
beforeCreate: function () {
// 获取本平台的服务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)=> {
});
},
router: router,
render: h => h(App),
}).$mount('#app')