- 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
136 lines
5.2 KiB
Vue
136 lines
5.2 KiB
Vue
<template>
|
|
<div
|
|
v-if="settingsStore.settings.ui.navigationMode !== 'hidden'"
|
|
class="fixed bottom-0 left-0 right-0 h-16 group md:h-16"
|
|
>
|
|
<!-- Invisible hover trigger area for desktop (only for hover mode) -->
|
|
<div
|
|
v-if="settingsStore.settings.ui.navigationMode === 'hover'"
|
|
class="absolute inset-0 hidden md:block"
|
|
></div>
|
|
<!-- Navigation bar -->
|
|
<nav
|
|
class="absolute bottom-0 left-0 right-0 bg-white md:bg-transparent border-t md:border-t-0 border-gray-200 md:shadow-none shadow-lg"
|
|
:class="getNavigationClasses()"
|
|
>
|
|
<div class="flex justify-center md:pb-4 pb-2">
|
|
<ul
|
|
class="flex space-x-4 md:space-x-8 md:bg-white md:rounded-lg md:shadow-md px-6 py-3 w-full md:w-auto justify-around md:justify-center"
|
|
>
|
|
<li>
|
|
<router-link
|
|
to="/"
|
|
class="flex flex-col items-center font-medium"
|
|
:class="
|
|
$route.name === 'home' ? 'text-blue-600' : 'text-gray-600 hover:text-blue-600'
|
|
"
|
|
>
|
|
<svg class="w-6 h-6 mb-1" fill="currentColor" viewBox="0 0 24 24">
|
|
<path d="M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z" />
|
|
</svg>
|
|
<span class="text-xs">Dashboard</span>
|
|
</router-link>
|
|
</li>
|
|
<li>
|
|
<router-link
|
|
to="/sensors"
|
|
class="flex flex-col items-center font-medium"
|
|
:class="
|
|
$route.name === 'sensors'
|
|
? 'text-orange-600'
|
|
: 'text-gray-600 hover:text-orange-600'
|
|
"
|
|
>
|
|
<svg class="w-6 h-6 mb-1" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
<path
|
|
stroke-linecap="round"
|
|
stroke-linejoin="round"
|
|
stroke-width="2"
|
|
d="M9 3v2m6-2v2M9 19v2m6-2v2M5 9H3m2 6H3m18-6h-2m2 6h-2M7 19h10a2 2 0 002-2V7a2 2 0 00-2-2H7a2 2 0 00-2 2v10a2 2 0 002 2zM9 9h6v6H9V9z"
|
|
/>
|
|
</svg>
|
|
<span class="text-xs">Sensors</span>
|
|
</router-link>
|
|
</li>
|
|
<li>
|
|
<router-link
|
|
to="/ai-optimization"
|
|
class="flex flex-col items-center font-medium"
|
|
:class="
|
|
$route.name === 'ai-optimization'
|
|
? 'text-purple-600'
|
|
: 'text-gray-600 hover:text-purple-600'
|
|
"
|
|
>
|
|
<svg class="w-6 h-6 mb-1" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
<path
|
|
stroke-linecap="round"
|
|
stroke-linejoin="round"
|
|
stroke-width="2"
|
|
d="M13 10V3L4 14h7v7l9-11h-7z"
|
|
/>
|
|
</svg>
|
|
<span class="text-xs">AI Optimize</span>
|
|
</router-link>
|
|
</li>
|
|
<li>
|
|
<router-link
|
|
to="/settings"
|
|
class="flex flex-col items-center font-medium"
|
|
:class="
|
|
$route.name === 'settings' ? 'text-green-700' : 'text-gray-600 hover:text-green-700'
|
|
"
|
|
>
|
|
<svg class="w-6 h-6 mb-1" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
<path
|
|
stroke-linecap="round"
|
|
stroke-linejoin="round"
|
|
stroke-width="2"
|
|
d="M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"
|
|
/>
|
|
<path
|
|
stroke-linecap="round"
|
|
stroke-linejoin="round"
|
|
stroke-width="2"
|
|
d="M15 12a3 3 0 11-6 0 3 3 0 016 0z"
|
|
/>
|
|
</svg>
|
|
<span class="text-xs">Settings</span>
|
|
</router-link>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
</nav>
|
|
</div>
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
import { computed, onMounted } from 'vue'
|
|
import { useSettingsStore } from '@/stores/settings'
|
|
|
|
const settingsStore = useSettingsStore()
|
|
|
|
// Compute navigation classes based on settings
|
|
const getNavigationClasses = () => {
|
|
const mode = settingsStore.settings.ui.navigationMode
|
|
|
|
if (mode === 'always') {
|
|
// Always visible - no transform on desktop
|
|
return 'transform-none md:transform-none'
|
|
} else if (mode === 'hover') {
|
|
// Hover mode - original behavior
|
|
return 'transform-none md:transform md:translate-y-full md:group-hover:translate-y-0 md:transition-transform md:duration-300 md:ease-in-out'
|
|
}
|
|
|
|
// Default fallback
|
|
return 'transform-none md:transform md:translate-y-full md:group-hover:translate-y-0 md:transition-transform md:duration-300 md:ease-in-out'
|
|
}
|
|
|
|
// Initialize settings store
|
|
onMounted(() => {
|
|
if (!settingsStore.lastSaved) {
|
|
settingsStore.initialize()
|
|
}
|
|
})
|
|
</script>
|