feat(client_details.py): add client_details route

This commit is contained in:
2026-02-28 20:43:57 +01:00
parent b652db930f
commit 31c51574f7

View File

@@ -0,0 +1,31 @@
# -*- coding: utf-8 -*-
from __future__ import annotations
from typing import TYPE_CHECKING
import flask
import flask_login
if TYPE_CHECKING:
from judas_server.backend import BackendServer
from judas_server.backend.client import Client
bp: flask.Blueprint = flask.Blueprint(
"client_details", __name__, url_prefix="/client"
)
@bp.route("/<client_id>")
@flask_login.login_required
def client_details(client_id: str) -> str:
"""Renders the client details page for a specific client.
Args:
client_id: The ID of the client to display details for.
"""
backend: BackendServer = flask.current_app.config["BACKEND"]
client: Client | None = backend.clients.get(client_id)
if not client:
flask.abort(404, description="Client not found")
return flask.render_template("client_details.html", client=client)