adding the possibility to get the recent captures

pull/920/head
Adrian Maraj 2024-06-19 10:45:58 +02:00
parent ecd67d5e22
commit 4c8fd74900
1 changed files with 7 additions and 0 deletions

View File

@ -775,3 +775,10 @@ class CaptureHide(Resource): # type: ignore[misc]
except Exception as e:
return {'error': f'Unable to hide the tree: {e}'}, 400
return {'info': f'Capture {capture_uuid} successfully hidden.'}
@api.route('/json/recent_captures')
@api.doc(description='Get uuids of the most recent captures.')
class RecentCaptures(Resource): # type: ignore[misc]
def get(self):
return lookyloo.redis.zrange('recent_captures',0, -1)