v1.1.16: remove serviceId filter, sort by svc+date, scrollable inst-list
This commit is contained in:
+1
-1
@@ -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")
|
||||
|
||||
+6
-2
@@ -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 — дубль, пропускаем.
|
||||
|
||||
@@ -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; }
|
||||
|
||||
Reference in New Issue
Block a user