feat: Add PWA support and CORS configuration
- Configure VitePWA with manifest, icons and service worker - Add PwaInstallBanner component for install prompt in header - Enable CORS for z590.interno.com access - Use dynamic hostname for terminal WebSocket connection - Add generate-icons script with sharp for PWA icons - Fix theme-color to match header background
This commit is contained in:
@@ -80,6 +80,17 @@ export function startTerminalServer() {
|
||||
fetch(req, server) {
|
||||
const url = new URL(req.url)
|
||||
|
||||
const corsHeaders = {
|
||||
'Access-Control-Allow-Origin': '*',
|
||||
'Access-Control-Allow-Methods': 'GET, POST, OPTIONS',
|
||||
'Access-Control-Allow-Headers': 'Content-Type'
|
||||
}
|
||||
|
||||
// CORS preflight
|
||||
if (req.method === 'OPTIONS') {
|
||||
return new Response(null, { headers: corsHeaders })
|
||||
}
|
||||
|
||||
// Health check with session info
|
||||
if (url.pathname === '/health') {
|
||||
const sessionsInfo = Array.from(sessions.entries()).map(([id, s]) => ({
|
||||
@@ -93,7 +104,7 @@ export function startTerminalServer() {
|
||||
status: 'ok',
|
||||
sessions: sessionsInfo,
|
||||
cwd: WORKING_DIR
|
||||
})
|
||||
}, { headers: corsHeaders })
|
||||
}
|
||||
|
||||
// List active sessions
|
||||
|
||||
Reference in New Issue
Block a user