diff --git a/site/app.py b/site/app.py index 89e305a..3d597d2 100644 --- a/site/app.py +++ b/site/app.py @@ -18,7 +18,7 @@ from routes.api import bp as api_bp from routes.api_test import bp as api_test_bp # Версия — меняется при КАЖДОМ изменении кода. Показывается в топбаре UI. -VERSION = "1.1.15" +VERSION = "1.1.16" app = Flask(__name__, template_folder="templates", static_folder="static") app.config["NUBES_API_ENDPOINT"] = os.getenv("NUBES_API_ENDPOINT", "https://lk-api-gateway-test.ngcloud.ru/api/v1/svc") diff --git a/site/routes/main.py b/site/routes/main.py index fa012b4..58fdbba 100644 --- a/site/routes/main.py +++ b/site/routes/main.py @@ -194,8 +194,6 @@ def api_operations(svc_id): display_name = str(i.get("displayName", "") or "") if not display_name.startswith(AUTOTEST_PREFIX): continue # не наш инстанс - if i.get("serviceId") != svc_id: - continue # не нашего сервиса if i.get("explainedStatus") in ("deleted",): continue # удалённые не показываем item = dict(i) @@ -203,6 +201,12 @@ def api_operations(svc_id): svc_instances.append(item) cloud_names.add(display_name) + # Сортировка: по имени сервиса, затем по дате создания (новые сверху) + svc_instances.sort(key=lambda i: ( + i.get("svc", ""), + -(i.get("instanceConfigDtCreated", "") or "").replace("T", " ").replace(" ", "") + )) + # --- Шаг 2: Tracker-fallback --- # Инстансы из трекера, которых ещё нет в облаке (только что созданы). # Но если displayName уже есть в cloud_names — дубль, пропускаем. diff --git a/site/templates/index.html b/site/templates/index.html index d5fe481..8b1b3cb 100644 --- a/site/templates/index.html +++ b/site/templates/index.html @@ -11,6 +11,7 @@ .col-infra { width:280px; flex-shrink:0; } .col-svc { width:240px; flex-shrink:0; max-height:calc(100vh - 50px); overflow-y:auto; } .col-main { flex:1; min-width:0; } + #inst-list { max-height:calc(100vh - 250px); overflow-y:auto; } .svc-item { cursor:pointer; padding:4px 8px; font-size:12px; border-radius:4px; } .svc-item:hover, .svc-item.active { background:#dbeafe; font-weight:600; } .inst-item { cursor:pointer; display:flex; align-items:center; gap:6px; padding:4px 8px; font-size:12px; border-radius:4px; }