mirror of https://github.com/CIRCL/AIL-framework
chg: [investigations] show organisation
parent
a51347bf3c
commit
b030382cdf
|
@ -224,6 +224,8 @@ class Investigation(object):
|
|||
}
|
||||
if 'objects' in options:
|
||||
meta['objects'] = self.get_objects()
|
||||
if 'org_name' in options and meta['org']:
|
||||
meta['org_name'] = ail_orgs.Organisation(self.get_org()).get_name()
|
||||
return meta
|
||||
|
||||
def set_name(self, name):
|
||||
|
@ -438,7 +440,15 @@ def get_org_investigations_meta(org_uuid, r_str=False):
|
|||
investigations_meta = []
|
||||
for investigation_uuid in get_org_investigations(org_uuid):
|
||||
investigation = Investigation(investigation_uuid)
|
||||
investigations_meta.append(investigation.get_metadata(r_str=r_str))
|
||||
investigations_meta.append(investigation.get_metadata(r_str=r_str, options={'org_name'}))
|
||||
return investigations_meta
|
||||
|
||||
def get_orgs_investigations_meta(r_str=False):
|
||||
investigations_meta = []
|
||||
for tracker_uuid in get_all_investigations():
|
||||
inv = Investigation(tracker_uuid)
|
||||
if inv.get_level() == 2:
|
||||
investigations_meta.append(inv.get_metadata(r_str=r_str, options={'org_name'}))
|
||||
return investigations_meta
|
||||
|
||||
|
||||
|
|
|
@ -45,7 +45,15 @@ def investigations_dashboard():
|
|||
inv_global = Investigations.get_global_investigations_meta(r_str=True)
|
||||
inv_org = Investigations.get_org_investigations_meta(current_user.get_org(), r_str=True)
|
||||
return render_template("investigations.html", bootstrap_label=bootstrap_label,
|
||||
inv_global=inv_global, inv_org=inv_org)
|
||||
inv_global=inv_global, inv_org=inv_org)
|
||||
|
||||
@investigations_b.route("/investigations/admin", methods=['GET'])
|
||||
@login_required
|
||||
@login_admin
|
||||
def investigations_admin():
|
||||
inv_org = Investigations.get_orgs_investigations_meta(r_str=True)
|
||||
return render_template("investigations.html", bootstrap_label=bootstrap_label,
|
||||
inv_global=[], inv_org=inv_org)
|
||||
|
||||
|
||||
@investigations_b.route("/investigation", methods=['GET']) ## FIXME: add /view ????
|
||||
|
@ -63,7 +71,7 @@ def show_investigation():
|
|||
if res:
|
||||
return create_json_response(res[0], res[1])
|
||||
|
||||
metadata = investigation.get_metadata(r_str=True)
|
||||
metadata = investigation.get_metadata(r_str=True, options={'org_name'})
|
||||
objs = []
|
||||
for obj in investigation.get_objects():
|
||||
obj_meta = ail_objects.get_object_meta(obj["type"], obj["subtype"], obj["id"], flask_context=True)
|
||||
|
|
|
@ -38,6 +38,7 @@
|
|||
<thead class="bg-dark text-white">
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Org</th>
|
||||
<th>Date</th>
|
||||
<th>last modified</th>
|
||||
<td>Info</td>
|
||||
|
@ -57,6 +58,7 @@
|
|||
</div>
|
||||
</a>
|
||||
</td>
|
||||
<td>{{ dict_investigation['org_name']}}<br>{{ dict_investigation['org'] }}</td>
|
||||
<td>{{ dict_investigation['date']}}</td>
|
||||
<td>{{ dict_investigation['last_change']}}</td>
|
||||
<td>{{ dict_investigation['info']}}</td>
|
||||
|
|
|
@ -47,6 +47,10 @@
|
|||
<th>Creator</th>
|
||||
<td>{{metadata['user_creator']}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Org</th>
|
||||
<td>{{metadata['org_name']}}<br>{{ metadata['org'] }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Level</th>
|
||||
<td>
|
||||
|
|
Loading…
Reference in New Issue