Restructure: site/ with modular code, matching Nubes Flask convention

This commit is contained in:
2026-07-23 10:48:14 +04:00
parent 51e4d7a4f6
commit 420d09e6b5
17 changed files with 21 additions and 39 deletions
+23
View File
@@ -0,0 +1,23 @@
"""Главная страница — blueprint."""
from flask import Blueprint, current_app, render_template
from api.http_client import HttpClient
from operations.get_instances import get_organization
bp = Blueprint("main", __name__)
@bp.route("/")
def index():
org = None
error = None
try:
client = HttpClient(
current_app.config["NUBES_API_ENDPOINT"],
current_app.config["NUBES_API_TOKEN"],
)
org = get_organization(client)
except Exception as e:
error = str(e)
return render_template("index.html", organization=org, error=error)