mirror of https://github.com/CIRCL/lookyloo
adding timestamp
parent
0965fa63a2
commit
800d489781
|
@ -777,8 +777,9 @@ class CaptureHide(Resource): # type: ignore[misc]
|
||||||
return {'info': f'Capture {capture_uuid} successfully hidden.'}
|
return {'info': f'Capture {capture_uuid} successfully hidden.'}
|
||||||
|
|
||||||
|
|
||||||
@api.route('/json/recent_captures')
|
@api.route('/json/recent_captures/<string:timestamp>')
|
||||||
@api.doc(description='Get uuids of the most recent captures.')
|
@api.doc(description='Get uuids of the most recent captures.',
|
||||||
|
params={'timestamp': 'The timestamp up to which we want to have the current captures'})
|
||||||
class RecentCaptures(Resource): # type: ignore[misc]
|
class RecentCaptures(Resource): # type: ignore[misc]
|
||||||
def get(self) -> list:
|
def get(self, timestamp: str) -> list:
|
||||||
return lookyloo.redis.zrange('recent_captures',0, -1)
|
return lookyloo.redis.zrangebyscore('recent_captures', timestamp, '+inf')
|
Loading…
Reference in New Issue