Skip to content

Commit

Permalink
html report cosmetics and bugs fixing
Browse files Browse the repository at this point in the history
  • Loading branch information
98jfran committed May 7, 2020
1 parent d0ac890 commit ea33015
Show file tree
Hide file tree
Showing 20 changed files with 46 additions and 32 deletions.
10 changes: 5 additions & 5 deletions modules/report/tiktok.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def get_user_messages(self):
timeline_event["from"]= message["sender"]
timeline_event["to"]= message["receiver"]
timeline_event["message"]= message["message"]
self.timeline.add(message["createdtime"],"message", timeline_event)
self.timeline.add(message["createdtime"],"AF_message", timeline_event)

#adding conversation and participants information to main array
conversations_list.append(conversation_output)
Expand Down Expand Up @@ -146,7 +146,7 @@ def get_user_profile(self):
timeline_event["uniqueid"] = user_profile["unique_id"]
timeline_event["url"]= user_profile["url"]

self.timeline.add(user_profile["register_time"],"user", timeline_event)
self.timeline.add(user_profile["register_time"],"AF_user", timeline_event)

return user_profile

Expand Down Expand Up @@ -223,7 +223,7 @@ def get_videos(self):
timeline_event = {}
timeline_event["video"]= video["key"]

self.timeline.add(video["last_modified"],"video", timeline_event)
self.timeline.add(video["last_modified"],"AF_video", timeline_event)
break
self.media.add(os.path.join("internal", "cache", "cache", video["key"] ))
videos.append(video)
Expand Down Expand Up @@ -258,7 +258,7 @@ def get_videos_publish(self):
timeline_event = {}
timeline_event["url"]= video["video"]

self.timeline.add(video["created_time"],"publish", timeline_event)
self.timeline.add(video["created_time"],"AF_publish", timeline_event)
videos.append(video)

logging.info("{} video(s) found".format(len(videos)))
Expand Down Expand Up @@ -288,7 +288,7 @@ def get_last_session(self):
timeline_event = {}
timeline_event["action"]= session_entry["action"]

self.timeline.add(session_entry["time"],"system", timeline_event)
self.timeline.add(session_entry["time"],"AF_system", timeline_event)

session.append(session_entry)

Expand Down
10 changes: 5 additions & 5 deletions modules/report/tinder.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def get_user_messages(self):
timeline_event["from"]= message["from"]
timeline_event["to"]= message["to"]
timeline_event["message"]= message["message"]
self.timeline.add(message["created_time"],"message", timeline_event)
self.timeline.add(message["created_time"],"AF_message", timeline_event)



Expand Down Expand Up @@ -109,7 +109,7 @@ def get_bio_changes(self):
timeline_event = {}
timeline_event["old"]= bio_change["old"]
timeline_event["new"]= bio_change["new"]
self.timeline.add(bio_change["createdtime"],"biography", timeline_event)
self.timeline.add(bio_change["createdtime"],"AF_user", timeline_event)

biography_changes.append(bio_change)

Expand Down Expand Up @@ -140,7 +140,7 @@ def get_user_matches(self):
timeline_event["person_id"]= match["person_id"]
timeline_event["person_name"]= match["person_name"]
timeline_event["is_blocked"]= match["is_blocked"]
self.timeline.add(match["creation_date"],"match", timeline_event)
self.timeline.add(match["creation_date"],"AF_relation", timeline_event)


logging.info("{} matches found".format(len(matches)))
Expand Down Expand Up @@ -175,7 +175,7 @@ def get_credit_cards(self):

timeline_event = {}
timeline_event["name"]= card["name"]
self.timeline.add(card["use_date"],"credit_card", timeline_event)
self.timeline.add(card["use_date"],"AF_creditcard", timeline_event)

cards_list.append(card)

Expand Down Expand Up @@ -214,7 +214,7 @@ def get_locations(self):
timeline_event["address"]= location["address"]
timeline_event["city"]= location["city"]
timeline_event["country_long"]= location["country_long"]
self.timeline.add(location["last_seen_date"],"location", timeline_event)
self.timeline.add(location["last_seen_date"],"AF_location", timeline_event)

self.locations.add(location["last_seen_date"], location["latitude"], location["longitude"])

Expand Down
1 change: 0 additions & 1 deletion psy/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ def initComponents(self):
self.bg_method.add(self.rb_liveExtraction)

self.p_method.add(JLabel("Analysis method"))
self.p_method.add(self.sp)
self.p_method.add(self.rb_selectedDatasource)
self.p_method.add(self.rb_importReportFile)
self.p_method.add(self.rb_liveExtraction)
Expand Down
32 changes: 19 additions & 13 deletions template/assets/js/report.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function initializeMenus() {
let list = "";

Object.keys(reportData).forEach(function (item) {
if (item !== "header") {
if (item !== "header" && item.substring(0, 3) !=="AF_") {
list += `<li class="nav-item"><a id="menulink-${item}" class="nav-link menu-item" href="javascript:void(null);"><span data-feather="file-text"></span>${capitalize(item.replace("_", " "))}</a></li>`;
}
});
Expand All @@ -34,7 +34,12 @@ function initializeMenus() {
}

function generatedDate() {
$("#generated-date").html("Generated at " + (new Date(Number(reportData["header"]["report_date"])).toISOString().slice(0, 19).replace(/-/g, "/").replace("T", " ")));
let timestamp = new Date(reportData["header"]["report_date"]);
let date = timestamp.toLocaleDateString("pt-PT");
let time = timestamp.toLocaleTimeString("pt-PT");


$("#generated-date").html("Generated at " + date + " " + time);
}

function extraButtons() {
Expand Down Expand Up @@ -75,17 +80,15 @@ function renderMap() {

$("#page-builder").html(content);


var map = L.map('map').setView([51.505, -0.09], 13);

L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
// attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
}).addTo(map);

if (report["AF_location"] == undefined) {
$('#empty-map-modal').modal('show');
return
}
var map = L.map('map').setView([report["AF_location"][0]["latitude"], report["AF_location"][0][["longitude"]]], 13);

L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
// attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
}).addTo(map);

report["AF_location"].forEach(item => {

Expand Down Expand Up @@ -126,9 +129,11 @@ function renderTimeline() {
report["AF_timeline"].forEach(item => {
let date = "";
let time = "";
let textclass = ""
if (item["timestamp"] == 0) {
date = `<span class="badge badge-pill badge-danger text-white ml-3">Invalid date</span>`
time = ``
date = `Invalid date`
time = `Invalid time`
textclass= "text-danger"
} else {
timestamp = new Date(item["timestamp"] * 1000);
date = timestamp.toLocaleDateString("pt-PT");
Expand All @@ -140,7 +145,7 @@ function renderTimeline() {
<object data="assets/svg/${item["event"]}.svg" type="image/svg+xml" class="w-100"}"></object>
</div>
<div class="tracking-date">${date}<span>${time}</span></div>
<div class="tracking-date ${textclass}">${date}<span class="${textclass}">${time}</span></div>
<div class="tracking-content">`

id += 1
Expand All @@ -149,7 +154,7 @@ function renderTimeline() {
try {
if (item["value"][body].length > 100) {
content += `<span><strong class="d-inline">${body} : </strong><div id='${"timeline-" + id}' class='collapse'> ${item["value"][body]}</div>
<span class=" d-inline btn btn-link " data-toggle="collapse" data-target="#${"timeline-" + id}">Expand/Collapse</span></span>`;
<span class="d-inline btn btn-link text-primary" data-toggle="collapse" data-target="#${"timeline-" + id}">Expand/Collapse</span></span>`;
} else {
content += `<span><strong class="d-inline">${body} : </strong><div class="d-inline" id='${"timeline-" + id}'> ${item["value"][body]}</div></span>`;
}
Expand Down Expand Up @@ -207,6 +212,7 @@ function renderMedia() {
<source src="${item}" type="video/mp4">
Doest support video
</video>
<img src="${item}" alt="">
</div>
<span>${item}</span>
</div>`
Expand Down
1 change: 1 addition & 0 deletions template/assets/svg/AF_creditcard.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions template/assets/svg/AF_download.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions template/assets/svg/AF_image.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions template/assets/svg/AF_location.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions template/assets/svg/AF_message.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions template/assets/svg/AF_photo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions template/assets/svg/AF_publish.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit ea33015

Please sign in to comment.