Skip to content

Commit

Permalink
main-vehicle: allow setting vehicle and stream urls via query
Browse files Browse the repository at this point in the history
  • Loading branch information
Williangalvani authored and rafaellehmkuhl committed Apr 30, 2024
1 parent 7dcb28a commit 6093baa
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/stores/mainVehicle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,15 @@ export const useMainVehicleStore = defineStore('main-vehicle', () => {
const cpuLoad = ref<number>()
const globalAddress = useStorage('cockpit-vehicle-address', defaultGlobalAddress)
const _mainConnectionURI = new CustomizableParameter<Connection.URI>(() => {
return new Connection.URI(`${ws_protocol}://${globalAddress.value}:6040/ws/mavlink`)
const queryMainConnectionURI = new URLSearchParams(window.location.search).get('mainConnectionURI')
return new Connection.URI(
queryMainConnectionURI || `${ws_protocol}://${globalAddress.value}/mavlink2rest/ws/mavlink`
)
})
const mainConnectionURI = ref(_mainConnectionURI)
const _webRTCSignallingURI = new CustomizableParameter<Connection.URI>(() => {
return new Connection.URI(`${ws_protocol}://${globalAddress.value}:6021`)
const queryWebRTCSignallingURI = new URLSearchParams(window.location.search).get('webRTCSignallingURI')
return new Connection.URI(queryWebRTCSignallingURI || `${ws_protocol}://${globalAddress.value}:6021`)
})
const webRTCSignallingURI = ref(_webRTCSignallingURI)
const lastHeartbeat = ref<Date>()
Expand Down

0 comments on commit 6093baa

Please sign in to comment.