diff --git a/site/routes/main.py b/site/routes/main.py index db8db19..341c93c 100644 --- a/site/routes/main.py +++ b/site/routes/main.py @@ -54,17 +54,17 @@ def index(): org = get_organization(client) raw_svc = get_services(client) services = sorted(raw_svc, key=lambda s: (s.get("svcId", 0), s.get("svc", ""))) + # инфраструктурные сервисы (платформа/среда) + infra_ids = {2, 12, 21, 22, 25, 26, 27, 28, 29, 110, 111, 112, 150} raw_inst = get_instances(client) instances = [i for i in raw_inst if i.get("explainedStatus") not in ("deleted", "not created") - and i.get("serviceId") not in (109, 110, 111)] + and i.get("serviceId") in infra_ids] instances.sort(key=lambda i: (0 if i.get("serviceId") == 19 else 1, i.get("displayName", ""))) - # group non-org instances by service type + # group by service type instance_groups = {} for i in instances: - if i.get("serviceId") == 19: - continue svc_name = i.get("svc", "Прочее") instance_groups.setdefault(svc_name, []).append(i) config = load_config()