- Implemented a new bottom bar feature in `bottom-bar.js` that fetches and displays various notifications and statuses in real-time. - Added functions for handling visibility, state updates, and user interactions within the bottom bar. - Introduced WebSocket connection for real-time updates and fallback polling mechanism. - Created a manual testing script `test_manual.py` to validate API endpoints for the manual module. - Included tests for various paths to ensure expected responses from the server.
55 lines
1.6 KiB
Python
55 lines
1.6 KiB
Python
from fastapi import APIRouter
|
|
from app.core.config import settings
|
|
|
|
router = APIRouter()
|
|
|
|
@router.get("/state")
|
|
async def get_bottom_bar_state():
|
|
# MVP Mock Data for the Bottom Bar
|
|
return {
|
|
"enabled": True,
|
|
"sections": {
|
|
"mail": {
|
|
"unread": 5,
|
|
"customer_reply_needed": 2
|
|
},
|
|
"cases": {
|
|
"open": 12,
|
|
"list": []
|
|
},
|
|
"urgent": {
|
|
"count": 1,
|
|
"list": [{"id": 999, "title": "Server nede hos Kunde A"}]
|
|
},
|
|
"timer": {
|
|
"active_count": 1,
|
|
"list": [{"desc": "Fejlfinding WiFi", "elapsed": 1200}]
|
|
},
|
|
"kuma": {
|
|
"down": 3,
|
|
"list": ["Switch-Odense", "Printer-Aarhus", "FW-Kbh"]
|
|
},
|
|
"eset": {
|
|
"incidents": 0,
|
|
"list": []
|
|
},
|
|
"messages": {
|
|
"count": 2,
|
|
"list": [{"from": "Chef", "text": "Husk at ringe til Jensen"}, {"from": "System", "text": "Ny opgave tildelt."}]
|
|
},
|
|
"tasks": {
|
|
"count": 4,
|
|
"list": [
|
|
{"title": "Opsætning af ny PC", "deadline": "I dag 14:00"},
|
|
{"title": "Gennemgå ESET log", "deadline": "I dag 16:00"}
|
|
]
|
|
},
|
|
"boss": {
|
|
"stats": {
|
|
"unassigned": 3,
|
|
"active_employees": 4
|
|
}
|
|
}
|
|
}
|
|
}
|