From 7c9594a1cb0ff5e52124fc4a7213b46c5e4ffb7d Mon Sep 17 00:00:00 2001 From: Arturo Manzoli Date: Mon, 17 Jun 2024 07:32:20 -0300 Subject: [PATCH] App: Add config submenus and its contents Signed-off-by: Arturo Manzoli --- src/App.vue | 297 +++++++++++++++++++++++++++++++++++----------------- 1 file changed, 199 insertions(+), 98 deletions(-) diff --git a/src/App.vue b/src/App.vue index 8ecf1372b..fdb2b2c87 100644 --- a/src/App.vue +++ b/src/App.vue @@ -9,108 +9,152 @@ :style="simplifiedMainMenu ? { width: '45px', borderRadius: '0 10px 10px 0' } : mainMenuWidth" > -
- - - +
- - -
+ > + + + + + +
+ + +
+ +
+ + +
+
+
- - - + @@ -207,10 +251,10 @@ import { onClickOutside, useDebounceFn, useFullscreen, useTimestamp } from '@vueuse/core' import { format } from 'date-fns' import Swal from 'sweetalert2' -import { computed, DefineComponent, onBeforeUnmount, onMounted, ref, watch } from 'vue' +import { computed, DefineComponent, markRaw, onBeforeUnmount, onMounted, ref, watch } from 'vue' import { useRoute } from 'vue-router' -import ConfigurationMenu from '@/components/ConfigurationMenu.vue' +import GlassModal from '@/components/GlassModal.vue' import { useInteractionDialog } from '@/composables/interactionDialog' import { coolMissionNames } from '@/libs/funny-name/words' import { @@ -230,6 +274,13 @@ import { datalogger } from './libs/sensors-logging' import { useAppInterfaceStore } from './stores/appInterface' import { useMainVehicleStore } from './stores/mainVehicle' import { useWidgetManagerStore } from './stores/widgetManager' +import ConfigurationAlertsView from './views/ConfigurationAlertsView.vue' +import ConfigurationDevelopmentView from './views/ConfigurationDevelopmentView.vue' +import ConfigurationGeneralView from './views/ConfigurationGeneralView.vue' +import ConfigurationJoystickView from './views/ConfigurationJoystickView.vue' +import ConfigurationTelemetryView from './views/ConfigurationLogsView.vue' +import ConfigurationMissionView from './views/ConfigurationMissionView.vue' +import ConfigurationVideoView from './views/ConfigurationVideoView.vue' const { showDialog, closeDialog } = useInteractionDialog() @@ -249,6 +300,56 @@ const mainMenuStep = ref(1) const simplifiedMainMenu = ref(false) const windowHeight = ref(window.innerHeight) +const configMenu = [ + { + icon: 'mdi-view-dashboard-variant', + title: 'General', + component: markRaw(ConfigurationGeneralView) as ConfigComponent, + }, + { + icon: 'mdi-controller', + title: 'Joystick', + component: markRaw(ConfigurationJoystickView) as ConfigComponent, + }, + { + icon: 'mdi-video', + title: 'Video', + component: markRaw(ConfigurationVideoView) as ConfigComponent, + }, + { + icon: 'mdi-subtitles-outline', + title: 'Telemetry', + component: markRaw(ConfigurationTelemetryView) as ConfigComponent, + }, + { + icon: 'mdi-alert-rhombus-outline', + title: 'Alerts', + component: markRaw(ConfigurationAlertsView) as ConfigComponent, + }, + { + icon: 'mdi-dev-to', + title: 'Dev', + component: markRaw(ConfigurationDevelopmentView) as ConfigComponent, + }, + { + icon: 'mdi-map-marker-path', + title: 'Mission', + component: markRaw(ConfigurationMissionView) as ConfigComponent, + }, +] + +const toggleConfigComponent = (component: ConfigComponent): void => { + if (currentConfigMenuComponent.value === null) { + currentConfigMenuComponent.value = component + return + } + if (currentConfigMenuComponent.value === component) { + currentConfigMenuComponent.value = null + return + } + currentConfigMenuComponent.value = component +} + watch( () => windowHeight.value < 450, (isSmall: boolean) => {