Migrate frontend to plugin-based asset architecture
- Add equipmentApi and computersApi to replace legacy machinesApi - Add controller vendor/model fields to Equipment model and forms - Fix map marker navigation to use plugin-specific IDs (equipmentid, computerid, printerid, networkdeviceid) instead of assetid - Fix search to use unified Asset table with correct plugin IDs - Remove legacy printer search that used non-existent field names - Enable optional JWT auth for detail endpoints (public read access) - Clean up USB plugin models (remove unused checkout model) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -41,7 +41,8 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, computed, nextTick, watch, onMounted, onUnmounted } from 'vue'
|
||||
import { ref, computed, nextTick, watch } from 'vue'
|
||||
import { currentTheme } from '../stores/theme'
|
||||
|
||||
const props = defineProps({
|
||||
left: { type: Number, default: null },
|
||||
@@ -49,22 +50,6 @@ const props = defineProps({
|
||||
machineName: { type: String, default: '' }
|
||||
})
|
||||
|
||||
// Auto-detect system theme with reactive updates
|
||||
const systemTheme = ref(window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light')
|
||||
const mediaQuery = window.matchMedia('(prefers-color-scheme: dark)')
|
||||
|
||||
function handleThemeChange(e) {
|
||||
systemTheme.value = e.matches ? 'dark' : 'light'
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
mediaQuery.addEventListener('change', handleThemeChange)
|
||||
})
|
||||
|
||||
onUnmounted(() => {
|
||||
mediaQuery.removeEventListener('change', handleThemeChange)
|
||||
})
|
||||
|
||||
const visible = ref(false)
|
||||
const tooltipRef = ref(null)
|
||||
const mapPreview = ref(null)
|
||||
@@ -82,7 +67,9 @@ const hasPosition = computed(() => {
|
||||
})
|
||||
|
||||
const blueprintUrl = computed(() => {
|
||||
return systemTheme.value === 'light'
|
||||
// Force re-evaluation when theme changes by including theme in the computed
|
||||
const theme = currentTheme.value
|
||||
return theme === 'light'
|
||||
? '/static/images/sitemap2025-light.png'
|
||||
: '/static/images/sitemap2025-dark.png'
|
||||
})
|
||||
@@ -196,6 +183,11 @@ watch(visible, (newVal) => {
|
||||
zoom.value = 1
|
||||
}
|
||||
})
|
||||
|
||||
// Reset imageLoaded when theme changes to force reload
|
||||
watch(currentTheme, () => {
|
||||
imageLoaded.value = false
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
Reference in New Issue
Block a user