diff --git a/__pycache__/app.cpython-314.pyc b/__pycache__/app.cpython-314.pyc index cce0a79..116838a 100644 Binary files a/__pycache__/app.cpython-314.pyc and b/__pycache__/app.cpython-314.pyc differ diff --git a/app.py b/app.py index 19a2469..2b38153 100644 --- a/app.py +++ b/app.py @@ -14,7 +14,7 @@ DB_CONFIG = dict( dbname="inventory_cartriges", user="inventory_user", password="inventory_password", - host="192.168.1.92", + host="192.168.100.3", port=5433 ) @@ -1697,6 +1697,24 @@ def index(): """ ) computers = cur.fetchall() + cur.execute( + """ + SELECT c.id, + c.type, + c.rustdesk_id, + c.rustdesk_password, + COALESCE(cab.name, 'Без кабинета') AS cabinet_name, + c.inventory_number, + c.brand, + c.model + FROM computers c + LEFT JOIN cabinets cab ON cab.id = c.cabinet_id + WHERE COALESCE(BTRIM(c.rustdesk_id), '') <> '' + AND COALESCE(BTRIM(c.rustdesk_password), '') <> '' + ORDER BY cab.name NULLS LAST, c.inventory_number, c.model + """ + ) + computers_manage = cur.fetchall() cur.execute( """ SELECT DISTINCT brand @@ -1791,6 +1809,7 @@ def index(): cabinets_full=cabinets_rows, devices=devices, computers=computers, + computers_manage=computers_manage, component_types=COMPONENT_TYPES, consumable_types=consumable_types, device_brands=device_brands, @@ -3760,7 +3779,8 @@ def computers(): """ SELECT c.id, c.inventory_number, c.brand, c.model, c.serial_number, c.type, c.cpu_brand, c.cpu_model, c.gpu_model, c.memory_size, c.memory_type, - c.storage_size, c.motherboard, c.os, c.cabinet_id, cab.name AS cabinet_name, + c.storage_size, c.motherboard, c.os, c.rustdesk_id, c.rustdesk_password, + c.cabinet_id, cab.name AS cabinet_name, c.note, c.date_in_operation, c.date_added FROM computers c LEFT JOIN cabinets cab ON cab.id = c.cabinet_id diff --git a/templates/computers.html b/templates/computers.html index d6dc11c..21bf201 100644 --- a/templates/computers.html +++ b/templates/computers.html @@ -141,6 +141,12 @@