Update tag colors + ignore remove non-existent file

This commit is contained in:
relikd
2020-09-13 13:25:18 +02:00
parent 720b751cdd
commit 408fe305f8
4 changed files with 14 additions and 15 deletions

View File

@@ -109,19 +109,14 @@ td { padding: 0.2em 1em 0.2em 0.1em; }
font-size: 0.9em; font-size: 0.9em;
font-style: normal; font-style: normal;
font-weight: normal; font-weight: normal;
background: lightgray; background: #eee;
padding: 2pt 4pt; padding: 2pt 4pt;
border: 1pt solid #aaa; border: 1pt solid #aaa;
border-radius: 0.2em; border-radius: 0.2em;
display: inline-block; display: inline-block;
margin: 0.12em; margin: 0.12em;
} }
.tags i.trckr:before, .tags.trckr i:before, p.trckr:before { .tags i.trckr, .tags.trckr i { background: #F99; border-color: #C66; }
content: '* ';
color: red;
font-weight: bold;
}
.tags i.trckr, .tags.trckr i { background: #DBB; border-color: #C88; }
p.trckr { font-size: 0.9em; margin-left: 0.5em; } p.trckr { font-size: 0.9em; margin-left: 0.5em; }
/* graphs */ /* graphs */

View File

@@ -10,6 +10,7 @@ THRESHOLD_MIN_AVG_LOGS = 1.0 # at least x times in total (after %-thresh)
def seconds_to_time(seconds): def seconds_to_time(seconds):
seconds = int(seconds)
minutes, seconds = divmod(seconds, 60) minutes, seconds = divmod(seconds, 60)
hours, minutes = divmod(minutes, 60) hours, minutes = divmod(minutes, 60)
return '{:02d}:{:02d}:{:02d}'.format(hours, minutes, seconds) return '{:02d}:{:02d}:{:02d}'.format(hours, minutes, seconds)
@@ -71,7 +72,7 @@ def gen_dom_tags(sorted_arr, onlyTrackers=False):
txt += '<i{}>{}</i> '.format(clss, title) txt += '<i{}>{}</i> '.format(clss, title)
anyMark |= mark anyMark |= mark
if txt: if txt:
note = '<p class="trckr">known tracker</p>' note = '<p class="trckr">* Potential trackers are highlighted</p>'
return '<div class="{}tags">{}{}</div>'.format( return '<div class="{}tags">{}{}</div>'.format(
'trckr ' if onlyTrackers else '', txt, note if anyMark else '') 'trckr ' if onlyTrackers else '', txt, note if anyMark else '')
else: else:
@@ -133,21 +134,21 @@ def gen_html(bundle_id, obj):
time.strftime('%Y-%m-%d, %H:%M', time.gmtime(obj['last_date'])) time.strftime('%Y-%m-%d, %H:%M', time.gmtime(obj['last_date']))
}</time></td></tr> }</time></td></tr>
<tr><td>Number of recordings:</td><td>{ obj['sum_rec'] }</td></tr> <tr><td>Number of recordings:</td><td>{ obj['sum_rec'] }</td></tr>
<tr><td>Total number of logs:</td><td>{ <tr><td>Total number of requests:</td><td>{
obj['sum_logs'] }<i class="snd mg_lr">({ obj['sum_logs'] }<i class="snd mg_lr">({
round(obj['sum_logs_pm'], 1)} / min)</i></td></tr> round(obj['sum_logs_pm'], 1)} / min)</i></td></tr>
<tr><td>Average number of logs:</td><td>{ <tr><td>Average number of requests:</td><td>{
obj['avg_logs'] }<i class="snd mg_lr">({ obj['avg_logs'] }<i class="snd mg_lr">({
round(obj['avg_logs_pm'], 1)} / min)</i></td></tr> round(obj['avg_logs_pm'], 1)} / min)</i></td></tr>
<tr><td>Average recording time:</td><td>{ <tr><td>Average recording time:</td><td>{
round(obj['avg_time'], 1) } sec</td></tr> seconds_to_time(obj['avg_time']) }</td></tr>
<tr><td>Cumulative recording time:</td><td>{ <tr><td>Cumulative recording time:</td><td>{
seconds_to_time(obj['sum_time']) }</td></tr> seconds_to_time(obj['sum_time']) }</td></tr>
</table> </table>
</div> </div>
<h3>Connections</h3> <h3>Connections</h3>
<div> <div>
<h4>Known Trackers ({ len(obj['tracker']) }):</h4> <h4>Potential Trackers ({ len(obj['tracker']) }):</h4>
{ gen_dom_tags(obj['tracker'], onlyTrackers=True) } { gen_dom_tags(obj['tracker'], onlyTrackers=True) }
<p></p> <p></p>

View File

@@ -82,7 +82,10 @@ def import_update():
if len(then_delete) > 0: if len(then_delete) > 0:
print('cleanup _in folder ...') print('cleanup _in folder ...')
for x in then_delete: for x in then_delete:
os.remove(fname) try:
os.remove(fname)
except FileNotFoundError:
pass
print('') print('')

View File

@@ -3,9 +3,9 @@
<head> <head>
<meta charset="utf-8"/> <meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=0.75" /> <meta name="viewport" content="width=device-width, initial-scale=0.75" />
<script type="text/javascript" src="/static/script.js?1"></script> <script type="text/javascript" src="/static/script.js?2"></script>
<title>#_TITLE_#AppCheck: Privacy Monitor</title> <title>#_TITLE_#AppCheck: Privacy Monitor</title>
<link rel="stylesheet" type="text/css" href="/static/style.css?1"> <link rel="stylesheet" type="text/css" href="/static/style.css?2">
<link rel="stylesheet" type="text/css" href="/static/fonts/font.css"> <link rel="stylesheet" type="text/css" href="/static/fonts/font.css">
<link rel="apple-touch-icon" sizes="180x180" href="/static/favicon/apple-touch-icon.png"> <link rel="apple-touch-icon" sizes="180x180" href="/static/favicon/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/static/favicon/favicon-32x32.png"> <link rel="icon" type="image/png" sizes="32x32" href="/static/favicon/favicon-32x32.png">