-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathprocess_tree.html.j2
180 lines (157 loc) · 8.07 KB
/
process_tree.html.j2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
<!-- based of project https://github.com/jonmiles/bootstrap-treeview -->
<!DOCTYPE html>
<html class="no-js" lang="en">
<head>
<title>Illusive Incident Forensic System</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Bootstrap -->
<link href="bootstrap/css/bootstrap.min.css?bootstrap=3.3.5.7" rel="stylesheet">
<link rel="stylesheet" type=text/css href="treeview/css/bootstrap-treeview.css">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="description" content="">
<meta name="viewport" content="width=device-width">
</head>
<body>
<div class="container">
<h2>Process Tree</h2>
<div class="row">
<div class="col-sm-8">
<div id="treeview-searchable" class="treeview">
<ul class="list-group">
<li class="list-group-item node-treeview-searchable" data-nodeid="0" style="color:undefined;background-color:undefined;">
<span class="icon expand-icon glyphicon glyphicon-minus"></span>
<span class="icon node-icon"></span>Parent 1
</li>
<li class="list-group-item node-treeview-searchable" data-nodeid="1" style="color:undefined;background-color:undefined;">
<span class="indent"></span>
<span class="icon expand-icon glyphicon glyphicon-plus"></span>
<span class="icon node-icon"></span>Child 1
</li>
<li class="list-group-item node-treeview-searchable" data-nodeid="4" style="color:undefined;background-color:undefined;">
<span class="indent"></span>
<span class="icon glyphicon"></span>
<span class="icon node-icon"></span>Child 2
</li><li class="list-group-item node-treeview-searchable" data-nodeid="5" style="color:undefined;background-color:undefined;"><span class="icon glyphicon"></span><span class="icon node-icon"></span>Parent 2</li><li class="list-group-item node-treeview-searchable" data-nodeid="6" style="color:undefined;background-color:undefined;"><span class="icon glyphicon"></span><span class="icon node-icon"></span>Parent 3</li><li class="list-group-item node-treeview-searchable" data-nodeid="7" style="color:undefined;background-color:undefined;"><span class="icon glyphicon"></span><span class="icon node-icon"></span>Parent 4</li><li class="list-group-item node-treeview-searchable" data-nodeid="8" style="color:undefined;background-color:undefined;"><span class="icon glyphicon"></span><span class="icon node-icon"></span>Parent 5</li></ul></div>
</div>
<div class="col-sm-4">
<div class="row">
<h2>Search</h2>
<div class="col-sm-6">
<!-- <form> -->
<div class="form-group">
<label for="input-search" class="sr-only">Search Tree:</label>
<input type="input" class="form-control" id="input-search" placeholder="Type to search..." value="">
</div>
<div class="checkbox">
<label>
<input type="checkbox" class="checkbox" id="chk-ignore-case" value="false">
Ignore Case
</label>
</div>
<div class="checkbox">
<label>
<input type="checkbox" class="checkbox" id="chk-exact-match" value="false">
Exact Match
</label>
</div>
<div class="checkbox">
<label>
<input type="checkbox" class="checkbox" id="chk-reveal-results" value="false">
Reveal Results
</label>
</div>
<button type="button" class="btn btn-success" id="btn-search">Search</button><br>
<button type="button" class="btn btn-default" id="btn-clear-search">Clear</button>
<!-- </form> -->
</div>
</div>
<div class="col-sm-6">
<h2>Results</h2>
<div id="search-output"><p>0 matches found</p></div>
</div>
<div class="col-sm-7">
<h2>Additional Data</h2>
<div id="additional-data"><p></p></div>
</div>
</div>
</div>
<script src="bootstrap/jquery.min.js?bootstrap=3.3.5.7"></script>
<script src="bootstrap/js/bootstrap.min.js?bootstrap=3.3.5.7"></script>
<script type="text/javascript" src="treeview/js/bootstrap-treeview.js"></script>
<script type="text/javascript">
$(function() {
var json = {{my_data}};
var $searchableTree = $('#treeview-searchable').treeview({
color: "#428bca",
expandIcon: 'glyphicon glyphicon-chevron-right',
collapseIcon: 'glyphicon glyphicon-chevron-down',
nodeIcon: 'glyphicon glyphicon-cog',
showTags: true,
data: json,
onNodeSelected: function(event, node) {
$('#additional-data-id').remove();
$('#additional-data').prepend('<p id = additional-data-id>' + "<b><u> Command Line: </b></u><br>" + node.commandLine + '<br>' + "<b><u>Time: </b></u><br>" + node.time + '<br>' + "<b><u>Parent Process Name: <br></u></b>" + node.parentProcessName + '</p> ');
}
});
var search = function(e) {
var pattern = $('#input-search').val();
var options = {
ignoreCase: $('#chk-ignore-case').is(':checked'),
exactMatch: $('#chk-exact-match').is(':checked'),
revealResults: $('#chk-reveal-results').is(':checked')
};
var results = $searchableTree.treeview('search', [ pattern, options ]);
var output = '<p>' + results.length + ' matches found</p>';
$.each(results, function (index, result) {
output += '<p>- ' + result.text + '</p>';
});
$('#search-output').html(output);
}
$('#btn-search').on('click', search);
$('#input-search').on('keyup', search);
$('#btn-clear-search').on('click', function (e) {
$searchableTree.treeview('clearSearch');
$('#input-search').val('');
$('#search-output').html('');
});
var initSelectableTree = function() {
return $('#treeview-selectable').treeview({
data: defaultData,
multiSelect: $('#chk-select-multi').is(':checked'),
onNodeSelected: function(event, node) {
$('#selectable-output').prepend('<p>' + node.text + ' was selected</p>');
},
onNodeUnselected: function (event, node) {
$('#selectable-output').prepend('<p>' + node.text + ' was unselected</p>');
}
});
};
var $selectableTree = initSelectableTree();
var findSelectableNodes = function() {
return $selectableTree.treeview('search', [ $('#input-select-node').val(), { ignoreCase: false, exactMatch: false } ]);
};
var selectableNodes = findSelectableNodes();
$('#chk-select-multi:checkbox').on('change', function () {
console.log('multi-select change');
$selectableTree = initSelectableTree();
selectableNodes = findSelectableNodes();
});
// Select/unselect/toggle nodes
$('#input-select-node').on('keyup', function (e) {
selectableNodes = findSelectableNodes();
$('.select-node').prop('disabled', !(selectableNodes.length >= 1));
});
$('#btn-select-node.select-node').on('click', function (e) {
$selectableTree.treeview('selectNode', [ selectableNodes, { silent: $('#chk-select-silent').is(':checked') }]);
});
$('#btn-unselect-node.select-node').on('click', function (e) {
$selectableTree.treeview('unselectNode', [ selectableNodes, { silent: $('#chk-select-silent').is(':checked') }]);
});
$('#btn-toggle-selected.select-node').on('click', function (e) {
$selectableTree.treeview('toggleNodeSelected', [ selectableNodes, { silent: $('#chk-select-silent').is(':checked') }]);
});
});
</script>
</body>
</html>