Fix: typo, sri

pull/925/head
AntoniaBK 2024-07-12 17:50:55 +02:00
parent 52590c0fe3
commit 746eb0971f
3 changed files with 20 additions and 17 deletions

View File

@ -667,18 +667,22 @@ def categories_capture(tree_uuid: str, query: str) -> str | WerkzeugResponse | R
return redirect(url_for('tree', tree_uuid=tree_uuid))
matching_categories = None
if 'verification-status' in request.form:
status = request.form.get('verification-status')
# fast categories
categories = []
possible_ctgs = {'legitime': ["parking-page", "default-page", 'institution', 'captcha', 'authentication-form', 'adult-content', 'shop'],
possible_ctgs = {
'legitimate': ["parking-page", "default-page", 'institution', 'captcha', 'authentication-form', 'adult-content', 'shop'],
'malicious': ['clone', 'phishing', 'captcha', 'authentication-form', 'adult-content', 'shop'],
'unclear': ['captcha', 'authentication-form', 'adult-content', 'shop']}
if request.form.get('verification-status') in possible_ctgs.keys():
for category in possible_ctgs[request.form.get('verification-status')]:
'unclear': ['captcha', 'authentication-form', 'adult-content', 'shop']
}
if status in possible_ctgs.keys():
lookyloo.categorize_capture(tree_uuid, status)
for category in possible_ctgs[status]:
if category in request.form:
categories.append(category)
for category in categories:
lookyloo.categorize_capture(tree_uuid, category)
if 'query' in request.form and request.form.get('query').strip():
if 'query' in request.form and request.form.get('query', '').strip():
matching_categories = {}
t = get_taxonomies()
entries = t.search(query)

View File

@ -35,7 +35,7 @@
"secure.svg": "H8ni7t0d60nCJDVGuZpuxC+RBy/ipAjWT627D12HlZGg6LUmjSwPTQTUekm3UJupEP7TUkhXyq6WHc5gy7QBjg==",
"stats.css": "/kY943FwWBTne4IIyf7iBROSfbGd82TeBicEXqKkRwawMVRIvM/Pk5MRa7okUyGIxaDjFQGmV/U1vy+PhN6Jbw==",
"stats_graph.js": "S/sMNQK1UMMLD0xQeEa7sq3ce8o6oPxwxGlyKVtaHOODjair86dbBDm7cu6pa/elMRDJT1j09jEFjWp+5GbhTw==",
"tree.css": "xffZ5VGbH0dvaD3pJRj48PttTd29xtU45QozhHi/oJCKy8HU/NkHcGutpx9sOGMuY5tsKn8Pub6Ncsjj9f4TSg==",
"tree.css": "jc7+RiJaZy7utfMu7iMWicpt0y0ZFiEQlB4c7MFNdlWcZf0czi3LgSQUFlDWt828Mx463V+JP1RalXuRjbGcEg==",
"tree.js": "Czw6AAUPQsIawEXi+eM9WG4vqfBw/y9vKbn0EedI3QG5+Y5ryZF05kGEexRc04wj5ec8RNRbR6QGnaVX3DAq3g==",
"up.jpg": "d1ljZJ9f5JekyM6RLFFH2Ua44j6neiQBdUIXOenRTjGppQr3JaeglpQIH6BjPCJL177+TH52U3UIRNS5YAyKIg==",
"up_right.jpg": "OMmz+n+MxR34P8/fn5t4DkqKqdJRzQbXQ7fAi2lhkZIJGhVs2vIyY1f2hpYoBxDAX1OcYsSE2lqIR2vXNDGZsA==",

View File

@ -95,27 +95,27 @@
});
// Fast categories
document.getElementById("legitime").addEventListener('change', function(){
document.getElementById("legitimate").addEventListener('change', function(){
if (this.checked){
disableInput(document.getElementById('malicious-categories'));
enableInput(document.getElementById('legitime-categories'));
enableInput(document.getElementById('legitimate-categories'));
}
});
document.getElementById("malicious").addEventListener('change', function(){
if (this.checked){
enableInput(document.getElementById('malicious-categories'));
disableInput(document.getElementById('legitime-categories'));
disableInput(document.getElementById('legitimate-categories'));
}
});
document.getElementById("unclear").addEventListener('change', function(){
if (this.checked){
disableInput(document.getElementById('malicious-categories'));
disableInput(document.getElementById('legitime-categories'));
disableInput(document.getElementById('legitimate-categories'));
}
});
document.getElementById("legitime-categories").addEventListener('click', function(){
document.getElementById("legitimate-categories").addEventListener('click', function(){
if (this.querySelectorAll('input[type="checkbox"]:checked').length > 0) {
document.getElementById("legitime").checked = true;
document.getElementById("legitimate").checked = true;
}
});
document.getElementById("malicious-categories").addEventListener('click', function(){
@ -981,7 +981,6 @@
</div>
</div>
</div>
############# got it ####
<div class="modal fade" id="modulesModal" tabindex="-1" role="dialog">
<div class="modal-dialog modal-xl" role="document">
@ -1112,8 +1111,8 @@
<p>
<form id="fast-categories" class="fast-categories">
<fieldset id="verification-status">
<input type="radio" id="legitime" name="verification-status" value="legitime">
<label for="legitime">legitime</label>
<input type="radio" id="legitimate" name="verification-status" value="legitimate">
<label for="legitimate">legitimate</label>
<input type="radio" id="malicious" name="verification-status" value="malicious">
<label for="malicious">malicious</label>
<input type="radio" id="unclear" name="verification-status" value="unclear">
@ -1123,8 +1122,8 @@
<div id="content-categoies">
<p>Content Categories (Multiple Choices possible)</p>
<fieldset id="legitime-categories">
<p>Only if legitime:</p>
<fieldset id="legitimate-categories">
<p>Only if legitimate:</p>
<input type="checkbox" id="parking-page" name="parking-page" value="parking-page">
<label for="parking-page">parking-page</label><br>
<input type="checkbox" id="default-page" name="default-page" value="default-page">