mirror of
https://github.com/ail-project/ail-framework.git
synced 2024-11-27 08:17:17 +00:00
66 lines
2 KiB
Python
66 lines
2 KiB
Python
|
#!/usr/bin/env python3
|
||
|
# -*-coding:UTF-8 -*
|
||
|
|
||
|
import os
|
||
|
import sys
|
||
|
import redis
|
||
|
|
||
|
# sys.path.append(os.path.join(os.environ['AIL_BIN'], 'packages/'))
|
||
|
|
||
|
sys.path.append(os.path.join(os.environ['AIL_BIN'], 'lib/'))
|
||
|
import ConfigLoader
|
||
|
|
||
|
from abstract_object import AbstractObject
|
||
|
|
||
|
config_loader = ConfigLoader.ConfigLoader()
|
||
|
r_serv_metadata = config_loader.get_redis_conn("ARDB_Metadata")
|
||
|
HASH_DIR = config_loader.get_config_str('Directories', 'hash')
|
||
|
config_loader = None
|
||
|
|
||
|
|
||
|
################################################################################
|
||
|
################################################################################
|
||
|
################################################################################
|
||
|
|
||
|
class Screenshot(AbstractObject):
|
||
|
"""
|
||
|
AIL Screenshot Object. (strings)
|
||
|
"""
|
||
|
|
||
|
def __init__(self, id):
|
||
|
super(Screenshot, self).__init__('screenshot', id)
|
||
|
|
||
|
# def get_ail_2_ail_payload(self):
|
||
|
# payload = {'raw': self.get_gzip_content(b64=True),
|
||
|
# 'compress': 'gzip'}
|
||
|
# return payload
|
||
|
|
||
|
# # WARNING: UNCLEAN DELETE /!\ TEST ONLY /!\
|
||
|
def delete(self):
|
||
|
# # TODO:
|
||
|
pass
|
||
|
|
||
|
def get_link(self, flask_context=False):
|
||
|
if flask_context:
|
||
|
url = url_for('correlation.show_correlation', object_type=self.type, correlation_id=self.id)
|
||
|
else:
|
||
|
url = f'{baseurl}/correlation/show_correlation?object_type={self.type}&correlation_id={self.id}'
|
||
|
return url
|
||
|
|
||
|
def get_svg_icon(self):
|
||
|
return {'style': 'fas', 'icon': '\uf03e', 'color': '#E1F5DF', 'radius':5}
|
||
|
|
||
|
############################################################################
|
||
|
############################################################################
|
||
|
############################################################################
|
||
|
|
||
|
def exist_correlation(self):
|
||
|
pass
|
||
|
|
||
|
############################################################################
|
||
|
############################################################################
|
||
|
|
||
|
|
||
|
|
||
|
#if __name__ == '__main__':
|