feat: webhook info page on / and always show phone status in dashboard
- GET / on port 8081 shows API usage info instead of 404 - Dashboard always shows phone badge (Telefoniert/Frei) alongside AIDA and Teams Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
7f2858aab6
commit
73f25c4c7e
@ -84,6 +84,8 @@
|
|||||||
|
|
||||||
{% if seg.phone %}
|
{% if seg.phone %}
|
||||||
<span class="badge bg-danger"><i class="bi bi-telephone-fill"></i> Telefoniert</span>
|
<span class="badge bg-danger"><i class="bi bi-telephone-fill"></i> Telefoniert</span>
|
||||||
|
{% else %}
|
||||||
|
<span class="badge bg-light text-dark"><i class="bi bi-telephone"></i> Frei</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|||||||
15
webhook.py
15
webhook.py
@ -13,6 +13,21 @@ logger = logging.getLogger(__name__)
|
|||||||
webhook_app = FastAPI(title="Busylight Webhook")
|
webhook_app = FastAPI(title="Busylight Webhook")
|
||||||
|
|
||||||
|
|
||||||
|
@webhook_app.get("/", response_class=PlainTextResponse)
|
||||||
|
async def webhook_info():
|
||||||
|
return """Busylight Webhook API (Telefonanlage)
|
||||||
|
|
||||||
|
Endpoints:
|
||||||
|
GET/POST /{durchwahl}/callstart - Anruf gestartet (WLED -> Rot)
|
||||||
|
GET/POST /{durchwahl}/callend - Anruf beendet (WLED -> zurueck auf Teams-Status)
|
||||||
|
|
||||||
|
Beispiel:
|
||||||
|
curl http://localhost:8081/123/callstart
|
||||||
|
curl http://localhost:8081/123/callend
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def _get_user_by_extension(extension, conn):
|
def _get_user_by_extension(extension, conn):
|
||||||
"""Find user and their assignment by phone extension."""
|
"""Find user and their assignment by phone extension."""
|
||||||
return conn.execute("""
|
return conn.execute("""
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user