Add settings page and store with UI customization options

- Implement SettingsView with appearance, data, notifications, and
advanced tabs - Add settings store (Pinia) for theme, navigation,
notifications, and app config - Integrate settings store into HomeView
and BottomNav for theme and navigation mode - Add room management modal
and store methods for adding/removing rooms - Update
SensorManagementView with room management button and modal - Support
exporting/importing settings and resetting to defaults - Enable dark
mode via Tailwind config
This commit is contained in:
rafaeldpsilva
2025-09-03 17:07:19 +01:00
parent 1c96437e5a
commit 05baaca23c
9 changed files with 1250 additions and 17 deletions

View File

@@ -66,9 +66,11 @@ import SensorConsumptionTable from '@/components/cards/SensorConsumptionTable.vu
import RoomMetricsCard from '@/components/cards/RoomMetricsCard.vue'
import AirQualityCard from '@/components/cards/AirQualityCard.vue'
import { useEnergyStore } from '@/stores/energy'
import { useSettingsStore } from '@/stores/settings'
import { computed, onMounted, onUnmounted } from 'vue'
const energyStore = useEnergyStore()
const settingsStore = useSettingsStore()
const currentEnergyValue = computed(() => {
return energyStore.latestMessage?.value?.toFixed(2) || '0.00'
@@ -82,7 +84,13 @@ const averageEnergyUsage = computed(() => {
})
onMounted(() => {
energyStore.connect('ws://192.168.1.73:8000/ws')
// Initialize settings
settingsStore.initialize()
// Auto-connect based on settings
if (settingsStore.settings.autoConnect) {
energyStore.connect(settingsStore.settings.websocketUrl)
}
})
onUnmounted(() => {