Move of LOG folder from /app/front/log to app/log

This commit is contained in:
jokob-sk
2024-12-08 21:06:44 +11:00
parent cd9c4a2176
commit a7e35c4697
24 changed files with 90 additions and 60 deletions

View File

@@ -115,8 +115,7 @@ class Query(ObjectType):
device["devParentChildrenCount"] = get_number_of_children(device["devMac"], devices_data)
device["devIpLong"] = format_ip_long(device.get("devLastIP", ""))
total_count = len(devices_data)
mylog('none', f'[graphql_schema] devices_data: {devices_data}')
@@ -161,14 +160,7 @@ class Query(ObjectType):
elif status == "offline":
devices_data = [device for device in devices_data if device["devPresentLastScan"] == 0]
# sorting
if options.sort:
for sort_option in options.sort:
devices_data = sorted(
devices_data,
key=lambda x: mixed_type_sort_key(x.get(sort_option.field)),
reverse=(sort_option.order.lower() == "desc")
)
# Filter data if a search term is provided
if options.search:
@@ -189,6 +181,18 @@ class Query(ObjectType):
)
]
# sorting
if options.sort:
for sort_option in options.sort:
devices_data = sorted(
devices_data,
key=lambda x: mixed_type_sort_key(x.get(sort_option.field)),
reverse=(sort_option.order.lower() == "desc")
)
# capture total count after all the filtering and searching
total_count = len(devices_data)
# Then apply pagination
if options.page and options.limit:
start = (options.page - 1) * options.limit