diff --git a/core/frontend/src/App.vue b/core/frontend/src/App.vue index 7b087c1da3..0d8e87d7b7 100644 --- a/core/frontend/src/App.vue +++ b/core/frontend/src/App.vue @@ -398,6 +398,7 @@ import blueos_blue from '@/assets/img/blueos-logo-blue.svg' import blueos_white from '@/assets/img/blueos-logo-white.svg' import consoleLogger from '@/libs/console-logger' import settings from '@/libs/settings' +import customization_store from '@/store/customization' import helper from '@/store/helper' import wifi from '@/store/wifi' import { Service } from '@/types/helper' @@ -760,7 +761,7 @@ export default Vue.extend({ return import.meta.env.VITE_BUILD_DATE }, blueos_logo(): string { - return settings.is_dark_theme ? blueos_white : blueos_blue + return customization_store.logoUrl ?? (settings.is_dark_theme ? blueos_white : blueos_blue) }, is_cloud_tray_menu_visible(): boolean { // Keep tray menu visible in everything except stable versions @@ -795,6 +796,7 @@ export default Vue.extend({ this.setupCallbacks() this.checkTour() updateTime() + customization_store.refreshAll() const body = document.querySelector('body') body?.addEventListener('click', (event) => { diff --git a/core/frontend/src/components/app/VehicleBanner.vue b/core/frontend/src/components/app/VehicleBanner.vue index 0a6bb6500f..5ba42f9a01 100755 --- a/core/frontend/src/components/app/VehicleBanner.vue +++ b/core/frontend/src/components/app/VehicleBanner.vue @@ -72,6 +72,7 @@ import Vue from 'vue' import ardupilot_data from '@/store/autopilot' import bag from '@/store/bag' import beacon from '@/store/beacon' +import customization_store from '@/store/customization' import ImagePicker from './ImagePicker.vue' @@ -83,7 +84,7 @@ export default Vue.extend({ data() { return { vehicle_name_input: '', - vehicle_image: undefined as string | undefined, + bag_vehicle_image: undefined as string | undefined, logo_image: null as string | null, mdns_hostname_input: '', dialog: false, @@ -99,6 +100,9 @@ export default Vue.extend({ system_id() { return ardupilot_data.system_id }, + vehicle_image(): string | undefined { + return customization_store.vehicleImageUrl ?? this.bag_vehicle_image + }, }, watch: { vehicle_name() { @@ -114,16 +118,16 @@ export default Vue.extend({ }, mounted() { beacon.registerBeaconListener(this) - this.load_vehicle_image() + this.load_bag_vehicle_image() this.vehicle_name_input = this.vehicle_name this.mdns_hostname_input = this.mdns_hostname this.load_company_logo() }, methods: { - async load_vehicle_image() { - this.vehicle_image = (await bag.getData('vehicle.image_path'))?.url as (string | undefined) - if (this.vehicle_image && !this.vehicle_image.startsWith('/')) { - this.vehicle_image = `/${this.vehicle_image}` + async load_bag_vehicle_image() { + this.bag_vehicle_image = (await bag.getData('vehicle.image_path'))?.url as (string | undefined) + if (this.bag_vehicle_image && !this.bag_vehicle_image.startsWith('/')) { + this.bag_vehicle_image = `/${this.bag_vehicle_image}` } }, async load_company_logo() { @@ -148,7 +152,7 @@ export default Vue.extend({ }) }, save_vehicle_image(image: string) { - this.vehicle_image = image + this.bag_vehicle_image = image bag.setData('vehicle.image_path', { url: image, }) diff --git a/core/frontend/src/components/customization/BrandingUploader.vue b/core/frontend/src/components/customization/BrandingUploader.vue new file mode 100644 index 0000000000..03aa37a11a --- /dev/null +++ b/core/frontend/src/components/customization/BrandingUploader.vue @@ -0,0 +1,117 @@ + + + diff --git a/core/frontend/src/components/customization/ThemeCustomization.vue b/core/frontend/src/components/customization/ThemeCustomization.vue new file mode 100644 index 0000000000..0ac6547498 --- /dev/null +++ b/core/frontend/src/components/customization/ThemeCustomization.vue @@ -0,0 +1,394 @@ + + + + + diff --git a/core/frontend/src/components/vehiclesetup/viewers/GenericViewer.vue b/core/frontend/src/components/vehiclesetup/viewers/GenericViewer.vue index 36c5dec24f..8e7d05630c 100755 --- a/core/frontend/src/components/vehiclesetup/viewers/GenericViewer.vue +++ b/core/frontend/src/components/vehiclesetup/viewers/GenericViewer.vue @@ -1,7 +1,7 @@