forked from abrignoni/ALEAPP
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhtml_parts.py
333 lines (325 loc) · 14.1 KB
/
html_parts.py
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
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
# Variables in page_header = {title}
#
page_header = \
"""<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<title>{0}</title>
<!-- Dark mode -->
<link rel="stylesheet" href="_elements/dark-mode.css">
<!-- Font Awesome -->
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.11.2/css/all.css">
<!-- Google Fonts Roboto -->
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap">
<!-- Bootstrap core CSS -->
<link rel="stylesheet" href="_elements/MDB-Free_4.13.0/css/bootstrap.min.css">
<!-- Material Design Bootstrap - TOGGLE THIS FOR ALTERNATE DESIGN!-->
<link rel="stylesheet" href="_elements/MDB-Free_4.13.0/css/mdb.min.css">
<!-- Your custom styles (optional) -->
<link rel="stylesheet" href="_elements/dashboard.css">
<link rel="stylesheet" href="_elements/custom.css"> <!-------Link to custom.css-------!>
<!-- MDBootstrap Datatables -->
<link rel="stylesheet" href="_elements/MDB-Free_4.13.0/css/addons/datatables.min.css" rel="stylesheet">
<!-- Icons -->
<!--script src="https://unpkg.com/feather-icons/dist/feather.min.js"></script-->
<script src="_elements/feather.min.js"></script>
<script src="_elements/sidebar.js"></script> <!-------Link to sidebar.js-------!>
</head>
<body>
"""
# body_part_1 includes fixed navbar at top and starting tags for rest of page
# Variables = {version_info}
body_start = \
"""
<!-- Start your project here-->
<nav class="navbar navbar-dark fixed-top bg-dark flex-md-nowrap p-0 shadow">
<button type="button" class="toggle" id="toggle" onclick="sidebar_toggle()"> <!-------Added toggle button-------!>
<span></span>
</button>
<a class="navbar-brand col-sm-3 col-md-2 mr-0" href="#">{0}</a>
<div class="custom-control custom-switch">
<input type="checkbox" class="custom-control-input" id="darkSwitch" />
<label class="custom-control-label mr-2" for="darkSwitch" style="color:white">Dark Switch</label>
</div>
<script src="_elements/dark-mode-switch.js"></script>
</nav>
<div class="container-fluid">
<div class="row">
"""
body_sidebar_setup = \
"""
<nav class="col-md-2 d-none d-md-block bg-light sidebar" id="sidebar_id"> <!-------Added html ID tag sidebar_id-------!>
<div class="sidebar-sticky" id="sidebar_id">
<ul class="nav flex-column">
"""
# The 'active' class must be set only for the current page, it will highlight that entry in blue
# class="nav-link active"
# Below is sample data, use own generated data!
body_sidebar_dynamic_data = \
"""
<h6 class="sidebar-heading justify-content-between align-items-center px-3 mt-4 mb-1 text-muted">
Saved reports
</h6>
<li class="nav-item">
<a class="nav-link" href="#">
<span data-feather="home"></span> Report Home
</a>
</li>
<h6 class="sidebar-heading justify-content-between align-items-center px-3 mt-4 mb-1 text-muted">
Recent Activity
</h6>
<li class="nav-item">
<a class="nav-link" href="#">
<span data-feather="activity"></span> RecentActivity_0
</a>
</li>
<h6 class="sidebar-heading justify-content-between align-items-center px-3 mt-4 mb-1 text-muted">
Script Logs
</h6>
<li class="nav-item">
<a class="nav-link" href="#">
<span data-feather="archive"></span> Processed Files Log
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">
<span data-feather="archive"></span> Screen Output
</a>
</li>
<h6 class="sidebar-heading justify-content-between align-items-center px-3 mt-4 mb-1 text-muted">
Usage Stats
</h6>
<li class="nav-item">
<a class="nav-link" href="#">
<span data-feather="bar-chart-2"></span> UsageStats_0
</a>
</li>
<h6 class="sidebar-heading justify-content-between align-items-center px-3 mt-4 mb-1 text-muted">
Wellbeing
</h6>
<li class="nav-item">
<a class="nav-link" href="#">
<span data-feather="layers"></span> Events
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">
<span data-feather="user"></span> Wellbeing Account
</a>
</li>
"""
body_sidebar_dynamic_data_placeholder = '<!--__INSERT-NAV-BAR-DATA-HERE__-->'
body_sidebar_trailer = \
"""
</ul>
<br /><br />
</div>
</nav>
"""
body_main_header = \
"""
<main role="main" class="col-md-9 ml-sm-auto col-lg-10 px-4" id="main"> <!-------Added html ID tag main-------!>
"""
# Variable {title}, {description}
body_main_data_title = \
"""
<div class="justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom">
<h1 class="display-5">{0}</h1>
<h6 class="animated fadeIn mb-3">{1}</h6>
</div>
"""
body_spinner = \
"""
<div id="mySpinner" class="spinner-border text-info float-right" role="status">
<span class="sr-only">Loading...</span>
</div>
"""
body_infinite_loading_bar = \
"""
<div id ="infiniteLoading" class="progress md-progress primary-color-dark">
<div class="indeterminate"></div>
</div>
"""
# body_main_data is a placeholder, replace content with real data
body_main_data = \
"""
<h5>All dates and times are in UTC unless stated otherwise.</h5>
<div class="alert alert-warning" role="alert">
All dates and times are in UTC unless noted otherwise!
</div>
<p class="note note-primary mb-4">
All dates and times are in UTC unless noted otherwise!
</p>
<h2>Case</h2>
<div class="table-responsive">
<table class="table table-bordered table-hover table-sm" width="70%">
<tbody>
<tr>
<td>Extraction Location</td>
<td>N:\aleapp_images\Pixel 5</td>
</tr>
</tbody>
</table>
</div>
<div class="androidevents">
<h1>Android Events</h1>
<h1>Android Events</h1>
</div>
"""
# tabs code for Case information in index.html
# Variables are {case_table_code}, {script_run_log}, {processed_file_list}
tabs_code = \
"""
<ul class="nav nav-tabs" id="myTab" role="tablist">
<li class="nav-item">
<a class="nav-link active" id="case-tab" data-toggle="tab" href="#case" role="tab" aria-controls="case" aria-selected="true">Details</a>
</li>
<li class="nav-item">
<a class="nav-link" id="device-list-tab" data-toggle="tab" href="#device" role="tab" aria-controls="device" aria-selected="false">Device details</a>
</li>
<li class="nav-item">
<a class="nav-link" id="run-log-tab" data-toggle="tab" href="#run" role="tab" aria-controls="run" aria-selected="false">Script run log</a>
</li>
<li class="nav-item">
<a class="nav-link" id="files-list-tab" data-toggle="tab" href="#files" role="tab" aria-controls="files" aria-selected="false">Processed files list</a>
</li>
</ul>
<div class="tab-content" id="myTabContent">
<div class="tab-pane fade show active" id="case" role="tabpanel" aria-labelledby="case-tab"><br />{}</div>
<div class="tab-pane fade" id="device" role="tabpanel" aria-labelledby="device-tab"><br />{}</div>
<div class="tab-pane fade text-monospace" id="run" role="tabpanel" aria-labelledby="script-run-tab"><br />{}</div>
<div class="tab-pane fade" id="files" role="tabpanel" aria-labelledby="profile-tab"><br />{}</div>
</div>
"""
# thank you note , at bottom of index.html
thank_you_note = \
"""
<br /><br /><br />
<div class="text-center">
<br />
<div class="card bg-white mb-3" style="max-width: 500px; margin:auto">
<div class="row no-gutters">
<center><div class="col-md-4">
<img src="_elements/logo.jpg" class="card-img" alt="DFIR">
</div>
<div class="col-md-8">
<div class="card-body">
<h5 class="card-title">Thank you for using ALEAPP</h5>
<p class="card-text">
Support open source and report any bugs!
</p>
<!--Github-->
<a class="btn-floating btn-git" type="button" role="button" href="https://github.com/abrignoni/aleapp" target="_blank"><i class="fab fa-github"></i> Project Home </a>
<p class="card-text fadeIn"><small class="text-muted">ALEAPP Team</small></p>
</div>
</div></center>
</div>
</div>
<br />
<br />
</div><!--end text-center area-->
"""
# Variable: HTML List of individual contributors (for index.html)
credits_block = \
"""
<div class="alert alert-light mb-4 bg-white" style="border-style: none">
<h4 class="text-center">ALEAPP contributors</h4>
<ul class="list-group" style="max-width: 500px; margin:auto">
{}
</ul>
</div>
"""
blog_icon = '<i class="fab fa-blogger-b fa-fw"></i>'
twitter_icon = '<i class="fab fa-twitter fa-fw"></i>'
github_icon = '<i class="fab fa-github fa-fw"></i>'
blank_icon = '<i class="fab fa-fw"></i>'
individual_contributor = \
"""
<li class="list-group-item d-flex justify-content-between align-items-center bg-white"><i class="fas fa-medal"></i>{}
<span>
{}
</span>
</li>
"""
""" sample contibutor data..
<a href="{}" target="_blank"><i class="fab fa-blogger-b fa-fw"></i></a>
<a href="{}" target="_blank"><i class="fab fa-twitter fa-fw"></i></a>
<a href="{}" target="_blank"><i class="fab fa-github fa-fw"></i></a>
"""
body_main_trailer = \
"""
</main>
</div>
</div>
"""
body_end = \
"""
<!-- End your project here-->
<!-- jQuery -->
<script type="text/javascript" src="_elements/MDB-Free_4.13.0/js/jquery.min.js"></script>
<!-- Bootstrap tooltips -->
<script type="text/javascript" src="_elements/MDB-Free_4.13.0/js/popper.min.js"></script>
<!-- Bootstrap core JavaScript -->
<script type="text/javascript" src="_elements/MDB-Free_4.13.0/js/bootstrap.js"></script>
<!-- MDB core JavaScript -->
<script type="text/javascript" src="_elements/MDB-Free_4.13.0/js/mdb.min.js"></script>
<!-- Your custom scripts -->
<!-- MDBootstrap Datatables -->
<script type="text/javascript" src="_elements/MDB-Free_4.13.0/js/addons/datatables.min.js"></script>
<script>
feather.replace()
</script>
"""
nav_bar_script = \
"""
<script>
feather.replace();
var element = document.getElementById("sidebar_id");
var searchParams = new URLSearchParams(window.location.search);
if (searchParams.has('navpos')) {
var nav_pos = parseInt(searchParams.get('navpos'));
if (!isNaN(nav_pos))
element.scrollTop = nav_pos;
}
</script>
"""
nav_bar_script_footer = \
"""
<script>
var elemScrollTop = document.getElementById("sidebar_id").scrollTop.toString();
document.addEventListener("DOMContentLoaded", function() {
var element = document.getElementById("sidebar_id");
element.addEventListener("scroll", function() {
elemScrollTop = document.getElementById("sidebar_id").scrollTop.toString();
});
});
$('a.nav-link').click(function(e) {
e.preventDefault();
location.href = $(this).attr('href') + "?navpos=" + elemScrollTop;
});
</script>
"""
default_responsive_table_script = \
"""
<script>
$(document).ready(function() {
$('#dtBasicExample').DataTable({
//"scrollY": "60vh",
//"scrollX": "10%",
//"scrollCollapse": true,
"aLengthMenu": [[ 15, 50, 100, -1 ], [ 15, 50, 100, "All" ]],
});
$('.dataTables_length').addClass('bs-select');
$('#mySpinner').remove();
//$('#infiniteLoading').remove();
});
</script>
"""
page_footer = \
"""
</body>
</html>
"""