Add USB, Notifications, Network plugins and reusable EmployeeSearch component
New Plugins: - USB plugin: Device checkout/checkin with employee lookup, checkout history - Notifications plugin: Announcements with types, scheduling, shopfloor display - Network plugin: Network device management with subnets and VLANs - Equipment and Computers plugins: Asset type separation Frontend: - EmployeeSearch component: Reusable employee lookup with autocomplete - USB views: List, detail, checkout/checkin modals - Notifications views: List, form with recognition mode - Network views: Device list, detail, form - Calendar view with FullCalendar integration - Shopfloor and TV dashboard views - Reports index page - Map editor for asset positioning - Light/dark mode fixes for map tooltips Backend: - Employee search API with external lookup service - Collector API for PowerShell data collection - Reports API endpoints - Slides API for TV dashboard - Fixed AppVersion model (removed BaseModel inheritance) - Added checkout_name column to usbcheckouts table Styling: - Unified detail page styles - Improved pagination (page numbers instead of prev/next) - Dark/light mode theme improvements Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
39
frontend/src/stores/theme.js
Normal file
39
frontend/src/stores/theme.js
Normal file
@@ -0,0 +1,39 @@
|
||||
import { ref, watch } from 'vue'
|
||||
|
||||
const STORAGE_KEY = 'shopdb-theme'
|
||||
|
||||
// Get initial theme from localStorage or system preference
|
||||
function getInitialTheme() {
|
||||
const stored = localStorage.getItem(STORAGE_KEY)
|
||||
if (stored) return stored
|
||||
|
||||
// Fall back to system preference
|
||||
if (window.matchMedia('(prefers-color-scheme: dark)').matches) {
|
||||
return 'dark'
|
||||
}
|
||||
return 'light'
|
||||
}
|
||||
|
||||
export const currentTheme = ref(getInitialTheme())
|
||||
|
||||
// Apply theme to document
|
||||
function applyTheme(theme) {
|
||||
document.documentElement.setAttribute('data-theme', theme)
|
||||
localStorage.setItem(STORAGE_KEY, theme)
|
||||
}
|
||||
|
||||
// Initialize on load
|
||||
applyTheme(currentTheme.value)
|
||||
|
||||
// Watch for changes
|
||||
watch(currentTheme, (newTheme) => {
|
||||
applyTheme(newTheme)
|
||||
})
|
||||
|
||||
export function toggleTheme() {
|
||||
currentTheme.value = currentTheme.value === 'dark' ? 'light' : 'dark'
|
||||
}
|
||||
|
||||
export function setTheme(theme) {
|
||||
currentTheme.value = theme
|
||||
}
|
||||
Reference in New Issue
Block a user