feature: Simulation Control Center (Dashboard)
CI / backend (push) Successful in 8m43s
CI / frontend (push) Successful in 2m0s

This commit is contained in:
voltsrage
2026-08-06 02:22:55 +08:00
parent 24f45851e9
commit 1d28880920
91 changed files with 1943 additions and 25 deletions
@@ -0,0 +1,25 @@
import { computed } from 'vue'
import { useAuthStore } from '@/stores/auth'
import { useSimulationStore } from '@/stores/simulation'
/**
* Feature-detects in-app simulation via GET /api/v1/simulation/config.
* Fail-closed: any error leaves simulationStore.enabled = false.
*/
export function useSimulationAvailable() {
const auth = useAuthStore()
const simulation = useSimulationStore()
const available = computed(() => simulation.enabled)
async function detect() {
if (!auth.isAuthenticated) {
simulation.enabled = false
return false
}
await simulation.loadConfig()
return simulation.enabled
}
return { available, detect }
}