diff --git a/site/app.py b/site/app.py index e945c5f..f8f82ab 100644 --- a/site/app.py +++ b/site/app.py @@ -5,7 +5,7 @@ from flask import Flask from routes.main import bp as main_bp from routes.api import bp as api_bp -VERSION = "1.0.3" +VERSION = "1.0.4" app = Flask(__name__, template_folder="templates", static_folder="static") app.config["NUBES_API_ENDPOINT"] = os.getenv("NUBES_API_ENDPOINT", "https://lk-api-gateway-dev.ngcloud.ru/api/v1/svc") diff --git a/site/routes/main.py b/site/routes/main.py index a035ea6..d9c46a8 100644 --- a/site/routes/main.py +++ b/site/routes/main.py @@ -14,6 +14,18 @@ def _mask(s): return s[:4] + "*" * (len(s) - 8) + s[-4:] +def _client_id(token): + import base64, json + try: + parts = token.split(".") + if len(parts) >= 2: + payload = base64.urlsafe_b64decode(parts[1] + "==") + return json.loads(payload).get("ClientID", "") + except Exception: + pass + return "" + + @bp.route("/", methods=["GET", "POST"]) def index(): env_token = current_app.config["NUBES_API_TOKEN"] @@ -75,6 +87,7 @@ def index(): organization=org, error=error, env_token_masked=_mask(env_token), has_user_token=bool(user_token), + client_id=_client_id(active_token), instance_groups=instance_groups) diff --git a/site/templates/index.html b/site/templates/index.html index 3ea5528..c5fd198 100644 --- a/site/templates/index.html +++ b/site/templates/index.html @@ -31,12 +31,8 @@ {% if organization %}
| Имя | {{ organization.displayName }} |
| UID | {{ organization.instanceUid }} |
| Статус | {{ organization.explainedStatus or "OK" }} |