Skip to content

Commit 8b7ec5e

Browse files
joaoantoniocardosopatrickelectric
authored andcommitted
frontend: components: video-manager: VideoStream: Update status display for new state field
- Replace Running/Not running text with state-based display (Running, Idle, Stopped) - Only show errors when stream state is stopped (not when idle) - Add stream_state_text computed property for status text mapping
1 parent 35dbf29 commit 8b7ec5e

1 file changed

Lines changed: 16 additions & 5 deletions

File tree

core/frontend/src/components/video-manager/VideoStream.vue

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@
4444
Status:
4545
</div>
4646
<div class="info-value">
47-
{{ stream.running ? 'Running' : 'Not running' }}
47+
{{ stream_state_text }}
4848
</div>
4949

50-
<template v-if="(!stream.running) && stream.error">
50+
<template v-if="stream.state === 'stopped' && stream.error">
5151
<div class="info-label error--text font-weight-bold">
5252
Errors:
5353
</div>
@@ -209,6 +209,14 @@ export default Vue.extend({
209209
}
210210
},
211211
computed: {
212+
stream_state_text(): string {
213+
const stateMap: Record<string, string> = {
214+
running: 'Running',
215+
idle: 'Idle',
216+
stopped: 'Stopped',
217+
}
218+
return stateMap[this.stream.state] || 'Unknown'
219+
},
212220
stream_prototype(): StreamPrototype {
213221
let dimensions
214222
if (this.stream.video_and_stream.stream_information.configuration.width
@@ -218,15 +226,18 @@ export default Vue.extend({
218226
height: this.stream.video_and_stream.stream_information.configuration.height,
219227
}
220228
}
229+
const ext = this.stream.video_and_stream.stream_information?.extended_configuration
221230
return {
222231
name: this.stream.video_and_stream.name,
223232
encode: this.stream.video_and_stream.stream_information.configuration.encode,
224233
dimensions,
225234
interval: this.stream.video_and_stream.stream_information.configuration.frame_interval,
226235
endpoints: this.stream.video_and_stream.stream_information.endpoints,
227-
thermal: this.stream.video_and_stream.stream_information?.extended_configuration?.thermal ?? false,
228-
disable_mavlink:
229-
this.stream.video_and_stream.stream_information?.extended_configuration?.disable_mavlink ?? false,
236+
thermal: ext?.thermal ?? false,
237+
disable_lazy: ext?.disable_lazy ?? false,
238+
disable_mavlink: ext?.disable_mavlink ?? false,
239+
disable_thumbnails: ext?.disable_thumbnails ?? false,
240+
disable_zenoh: ext?.disable_zenoh ?? false,
230241
}
231242
},
232243
format(): string {

0 commit comments

Comments
 (0)