novy prehled prirazovani IP apod.

This commit is contained in:
JiriUhlir
2026-07-30 07:13:12 +02:00
parent 6beca6f79a
commit f67a3fc993
8 changed files with 1230 additions and 16 deletions
+13 -9
View File
@@ -414,11 +414,13 @@ def get_app_ip_access_rules(app_id: str):
rows = con.execute(
"""
SELECT id, app_id, ip_cidr, methods, description,
COALESCE(is_enabled, 1) AS is_enabled, created_at, updated_at
FROM app_ip_access_rules
WHERE app_id = ?
ORDER BY id
SELECT r.id, r.app_id, r.ip_cidr, r.methods, r.description,
COALESCE(r.is_enabled, 1) AS is_enabled, r.created_at, r.updated_at,
r.address_id, a.label AS address_label
FROM app_ip_access_rules r
LEFT JOIN ip_addresses a ON a.id = r.address_id
WHERE r.app_id = ?
ORDER BY r.id
""",
(app_id,),
).fetchall()
@@ -433,10 +435,12 @@ def get_app_ip_access_rule(rule_id: int, app_id: str):
row = con.execute(
"""
SELECT id, app_id, ip_cidr, methods, description,
COALESCE(is_enabled, 1) AS is_enabled, created_at, updated_at
FROM app_ip_access_rules
WHERE id = ? AND app_id = ?
SELECT r.id, r.app_id, r.ip_cidr, r.methods, r.description,
COALESCE(r.is_enabled, 1) AS is_enabled, r.created_at, r.updated_at,
r.address_id, a.label AS address_label
FROM app_ip_access_rules r
LEFT JOIN ip_addresses a ON a.id = r.address_id
WHERE r.id = ? AND r.app_id = ?
""",
(rule_id, app_id),
).fetchone()