From a5af910264c3dcf4415ce34d60fc0f583393aaad Mon Sep 17 00:00:00 2001 From: Arturo Manzoli Date: Fri, 14 Jun 2024 08:07:52 -0300 Subject: [PATCH] Views: Configuration-general: Refactor component to new UI Signed-off-by: Arturo Manzoli --- src/styles/global.css | 7 +- src/views/ConfigurationGeneralView.vue | 409 +++++++++++++++---------- 2 files changed, 253 insertions(+), 163 deletions(-) diff --git a/src/styles/global.css b/src/styles/global.css index 33e873d2c..40f19d470 100644 --- a/src/styles/global.css +++ b/src/styles/global.css @@ -52,7 +52,12 @@ ::-webkit-scrollbar-thumb:hover { background-color: hsla(0, 0%, 0%, 0.411); } - +.v-text-field input { + background-color: transparent; +} +.v-field__input { + background-color: transparent; +} select:focus { outline: none; } \ No newline at end of file diff --git a/src/views/ConfigurationGeneralView.vue b/src/views/ConfigurationGeneralView.vue index bb2a32880..c453561b1 100644 --- a/src/views/ConfigurationGeneralView.vue +++ b/src/views/ConfigurationGeneralView.vue @@ -1,176 +1,232 @@ @@ -179,15 +235,21 @@ import { onMounted, ref, watch } from 'vue' import { defaultGlobalAddress } from '@/assets/defaults' +import ExpansiblePanel from '@/components/ExpansiblePanel.vue' +import GlassButton from '@/components/GlassButton.vue' +import { useInteractionDialog } from '@/composables/interactionDialog' import * as Connection from '@/libs/connection/connection' import { ConnectionManager } from '@/libs/connection/connection-manager' import { isValidNetworkAddress } from '@/libs/utils' import * as Protocol from '@/libs/vehicle/protocol/protocol' +import { useAppInterfaceStore } from '@/stores/appInterface' import { useMainVehicleStore } from '@/stores/mainVehicle' import BaseConfigurationView from './BaseConfigurationView.vue' const mainVehicleStore = useMainVehicleStore() +const interfaceStore = useAppInterfaceStore() +const { showDialog } = useInteractionDialog() const globalAddressForm = ref() const globalAddressFormValid = ref(false) @@ -215,6 +277,12 @@ const resetGlobalAddress = async (): Promise => { await setGlobalAddress() } +const handleCustomRtcConfiguration = (): void => { + if (mainVehicleStore.customWebRTCConfiguration.enabled) { + updateWebRtcConfiguration() + } +} + /** Main vehicle connection */ const vehicleConnected = ref(mainVehicleStore.isVehicleOnline) @@ -385,10 +453,27 @@ watch(customRtcConfiguration, () => tryToPrettifyRtcConfig()) onMounted(() => { tryToPrettifyRtcConfig() }) + +const openHelpDialog = (): void => { + showDialog({ + title: 'General Configuration Help', + message: [ + // eslint-disable-next-line vue/max-len + 'Global Vehicle Address: Sets the network address for device communication. Change and apply new settings as needed.', + // eslint-disable-next-line vue/max-len + 'Mavlink2Rest Connection: Configures MAVLink over HTTP/WS. Toggle to enable/disable and apply settings to take effect.', + // eslint-disable-next-line vue/max-len + 'WebRTC Connection: Establishes real-time communication over the web. Set the signaling server URI and toggle to activate.', + 'Additional Help: For more detailed settings, refer to documentation or contact us.', + ], + variant: 'text-only', + maxWidth: interfaceStore.isOnSmallScreen ? '80vw' : '60vw', + }) +}