web: fixes for logo
This commit is contained in:
@@ -93,6 +93,7 @@ class SimpleAuthMiddleware(BaseHTTPMiddleware):
|
|||||||
"/webhook/",
|
"/webhook/",
|
||||||
"/health",
|
"/health",
|
||||||
"/logo/", # Logo files should always be accessible
|
"/logo/", # Logo files should always be accessible
|
||||||
|
"/favicon.ico", # Favicon should always be accessible
|
||||||
"/ping",
|
"/ping",
|
||||||
"/api/v1/health",
|
"/api/v1/health",
|
||||||
"/api/v1/metrics",
|
"/api/v1/metrics",
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ body {
|
|||||||
.header-logo .logo {
|
.header-logo .logo {
|
||||||
height: 60px;
|
height: 60px;
|
||||||
width: auto;
|
width: auto;
|
||||||
filter: brightness(0) invert(1); /* Make logo white */
|
/* filter: brightness(0) invert(1); */ /* Make logo white - temporarily disabled for testing */
|
||||||
}
|
}
|
||||||
|
|
||||||
.header-text {
|
.header-text {
|
||||||
|
|||||||
@@ -64,6 +64,24 @@ def setup_static_files(app: FastAPI) -> None:
|
|||||||
return FileResponse(index_file)
|
return FileResponse(index_file)
|
||||||
else:
|
else:
|
||||||
return {"message": "NFOGuard Web Interface", "status": "running"}
|
return {"message": "NFOGuard Web Interface", "status": "running"}
|
||||||
|
|
||||||
|
# Serve favicon
|
||||||
|
@app.get("/favicon.ico")
|
||||||
|
async def serve_favicon():
|
||||||
|
# Try to serve favicon from logo directory or static files
|
||||||
|
favicon_paths = [
|
||||||
|
os.path.join(logo_path, "favicon.ico"),
|
||||||
|
os.path.join(static_path, "favicon.ico"),
|
||||||
|
os.path.join(logo_path, "NFOguardLogoPlain.png") # Fallback to logo
|
||||||
|
]
|
||||||
|
|
||||||
|
for favicon_path in favicon_paths:
|
||||||
|
if os.path.exists(favicon_path):
|
||||||
|
return FileResponse(favicon_path)
|
||||||
|
|
||||||
|
# Return 204 No Content if no favicon found
|
||||||
|
from fastapi import Response
|
||||||
|
return Response(status_code=204)
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
|||||||
Reference in New Issue
Block a user