diff --git a/src/assets/defaults.ts b/src/assets/defaults.ts index 9b2e61be4..ac52aae66 100644 --- a/src/assets/defaults.ts +++ b/src/assets/defaults.ts @@ -10,6 +10,12 @@ import { WidgetType, } from '@/types/widgets' +import { + availableGamepadToCockpitMaps, + cockpitStandardToProtocols, + defaultProtocolMappingVehicleCorrespondency, +} from './joystick-profiles' + export const defaultRovProfileHash = 'c2bcf04d-048f-496f-9d78-fc4002608028' export const defaultBoatProfileHash = 'adb7d856-f2e5-4980-aaeb-c39c1fa3562b' export const defaultMavProfileHash = '2309ffda-896a-449d-a171-7b7fdf80bc95' @@ -901,3 +907,90 @@ export const defaultSensorDataloggerProfile: OverlayGrid = { export const defaultDisplayUnitPreferences = { distance: DistanceDisplayUnit.Meters, } + +export const defaultCockpitSettings = { + 'cockpit-current-view-index': 0, + 'cockpit-has-seen-tutorial': false, + 'cockpit-auto-process-videos': true, + 'cockpit-slide-events-enabled': true, + 'cockpit-last-mission-name': null, + 'cockpit-default-map-center': [-27.5935, -48.55854], + 'cockpit-saved-profiles-v8': widgetProfiles, + 'cockpit-slide-events-categories-required': { + 'Arm': true, + 'Disarm': true, + 'Takeoff': true, + 'Altitude Change': true, + 'Land': true, + 'Goto': true, + }, + 'cockpit-enabled-alert-levels': [ + { level: 'info', enabled: false }, + { level: 'success', enabled: true }, + { level: 'error', enabled: true }, + { level: 'warning', enabled: true }, + { level: 'critical', enabled: true }, + ], + 'cockpit-mission-start-time': '2025-02-10T21:34:50.113Z', + 'cockpit-current-profile-index': 0, + 'cockpit-streams-correspondency': [], + 'cockpit-allowed-stream-protocols': [], + 'cockpit-username': null, + 'cockpit-standard-mappings-v2': availableGamepadToCockpitMaps, + 'cockpit-datalogger-log-interval': 1000, + 'cockpit-enable-blueos-settings-sync': true, + 'cockpit-jitter-buffer-target': 0, + 'cockpit-default-vehicle-type-protocol-mappings': defaultProtocolMappingVehicleCorrespondency, + 'cockpit-vehicle-custom-main-connection-uri': { + data: 'ws://blueos-avahi.local/mavlink2rest/ws/mavlink', + enabled: false, + }, + 'cockpit-last-tutorial-step': 1, + 'cockpit-hold-last-joystick-input-when-window-hidden': false, + 'cockpit-unprocessed-video-info': {}, + 'cockpit-enable-usage-statistics-telemetry': true, + 'cockpit-default-map-zoom': 15, + 'cockpit-zip-multiple-video-files': false, + 'cockpit-enable-system-logging': true, + 'cockpit-selected-alert-speech-voice': 'Google US English', + 'cockpit-custom-rtc-config': { + data: { + bundlePolicy: 'max-bundle', + iceServers: [], + }, + enabled: false, + }, + 'cockpit-protocol-mapping-index-v1': 0, + 'cockpit-main-menu-style': 'center-left', + 'cockpit-prevent-auto-vehicle-discovery-dialog': false, + 'cockpit-datalogger-overlay-grid': defaultSensorDataloggerProfile, + 'cockpit-enable-voice-alerts': true, + 'cockpit-mini-widgets-profile-v4': miniWidgetsProfile, + 'cockpit-mini-widget-last-values': {}, + 'cockpit-vehicle-custom-webrtc-signalling-uri': { + data: 'ws://blueos-avahi.local:6021/', + enabled: false, + }, + 'cockpit-reset-just-made': false, + 'cockpit-display-unit-preferences': defaultDisplayUnitPreferences, + 'cockpit-ui-glass-effect': defaultUIGlassColor, + 'cockpit-default-vehicle-type-profiles': defaultProfileVehicleCorrespondency, + 'cockpit-actions-joystick-confirm-required': {}, + 'cockpit-allowed-stream-ips': [], + 'cockpit-enable-auto-ice-ip-fetch': true, + 'cockpit-protocol-mappings-v1': cockpitStandardToProtocols, + 'cockpit-datalogger-overlay-options': { + fontSize: 30, + fontColor: '#FFFFFFFF', + backgroundColor: '#000000FF', + fontOutlineColor: '#000000FF', + fontOutlineSize: 2, + fontShadowColor: '#000000FF', + fontShadowSize: 1, + fontBold: false, + fontItalic: false, + fontUnderline: false, + fontStrikeout: false, + }, + 'cockpit-vehicle-address': 'blueos-avahi.local', +} diff --git a/src/components/configuration/ManageCockpitSettings.vue b/src/components/configuration/ManageCockpitSettings.vue new file mode 100644 index 000000000..847e2a899 --- /dev/null +++ b/src/components/configuration/ManageCockpitSettings.vue @@ -0,0 +1,425 @@ +