feat: add standalone (frontend-only) mode via VITE_STANDALONE build flag
- App.tsx: bypass auth gate, swap canvas save/load to localStorage - Sidebar.tsx: hide scan views and Scan Network button - useStatusPolling.ts: skip WebSocket connection - Dockerfile.frontend: accept VITE_STANDALONE build arg - docker-publish.yml: build ghcr.io/pouzor/homelable-frontend-standalone image - docker-compose.standalone.yml: frontend-only compose file - install.sh: add --standalone flag Usage: curl -fsSL .../install.sh | bash -s -- --standalone cd homelable && docker compose up -d
This commit is contained in:
@@ -12,13 +12,15 @@ interface StatusMessage {
|
||||
devices_found?: number
|
||||
}
|
||||
|
||||
const STANDALONE = import.meta.env.VITE_STANDALONE === 'true'
|
||||
|
||||
export function useStatusPolling() {
|
||||
const wsRef = useRef<WebSocket | null>(null)
|
||||
const { updateNode, notifyScanDeviceFound } = useCanvasStore()
|
||||
const { isAuthenticated, token } = useAuthStore()
|
||||
|
||||
useEffect(() => {
|
||||
if (!isAuthenticated || !token) return
|
||||
if (STANDALONE || !isAuthenticated || !token) return
|
||||
|
||||
const protocol = window.location.protocol === 'https:' ? 'wss' : 'ws'
|
||||
const host = window.location.hostname
|
||||
|
||||
Reference in New Issue
Block a user