Skip to content

Commit

Permalink
Merge pull request #38 from clenk/master
Browse files Browse the repository at this point in the history
Reorder report fields in web UI
  • Loading branch information
awest1339 authored Oct 22, 2017
2 parents cea3a22 + adde2e1 commit 25cdeac
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
1 change: 1 addition & 0 deletions web/static/css/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,7 @@
width: 50px;
overflow: hidden;
word-wrap: break-word;
font-family: 'Inconsolata', 'Consolas', monospace;
}

table.dataTable thead .sorting:after {
Expand Down
21 changes: 21 additions & 0 deletions web/templates/report.html
Original file line number Diff line number Diff line change
Expand Up @@ -242,14 +242,35 @@
$('#report-extras').show();
$('#report-tags').show();

// Take tags out of report and put into tags input element
if (data.Report.hasOwnProperty('tags')) {
tags = data.Report.tags;
delete data.Report.tags;
$('#tags').val(tags.toString());
}

// Take some report data and put it at the top of the report
var top_fields_list = [
'filename',
'Scan Time',
'Scan Metadata',
'MD5',
'SHA1',
'SHA256'
]
top_fields_list.forEach(function(elem) {
if (data.Report.hasOwnProperty(elem)) {
val = data.Report[elem];
delete data.Report[elem];
$('tbody:first').append(determineType(elem, val));
}
});

// Put report into table
$.each(data.Report, function(index, item) {
$('tbody:first').append(determineType(index, item));
});

// Handle row expanson
$('.expander').each(function(idx, elem) {
$(elem).click(function(e) {
Expand Down

0 comments on commit 25cdeac

Please sign in to comment.