feat: add toggle to filter dictionary-based domain scans
This commit is contained in:
parent
6bc117b118
commit
b01d32067f
@ -72,6 +72,7 @@
|
||||
</select>
|
||||
</label>
|
||||
<label>Min score <input id="minScore" type="number" min="0" max="100" step="1" placeholder="np. 70" /></label>
|
||||
<label class="small"><input type="checkbox" id="onlyDictionary" /> Tylko słownikowe</label>
|
||||
<label>Sortuj po
|
||||
<select id="sortBy">
|
||||
<option value="score">score</option>
|
||||
@ -196,11 +197,18 @@ function applyFiltersAndSort(){
|
||||
const sortBy = document.getElementById('sortBy').value;
|
||||
const sortDir = document.getElementById('sortDir').value;
|
||||
|
||||
const onlyDictionary = document.getElementById('onlyDictionary').checked;
|
||||
|
||||
let arr = (domains || []).filter(d => {
|
||||
if (decision === 'none' && d.decision) return false;
|
||||
if (decision && decision !== 'none' && (d.decision || '') !== decision) return false;
|
||||
if (status && (d.status || 'available') !== status) return false;
|
||||
if (minScore !== null && Number(d.score || 0) < minScore) return false;
|
||||
if (onlyDictionary) {
|
||||
const kw = Array.isArray(d.keywords) ? d.keywords.map(x => String(x).toLowerCase()) : [];
|
||||
const isDict = kw.includes('brand') && kw.includes('short') && kw.includes('dictionary');
|
||||
if (!isDict) return false;
|
||||
}
|
||||
return true;
|
||||
});
|
||||
|
||||
@ -310,6 +318,7 @@ document.getElementById('onlyNew').addEventListener('change', async()=>{await lo
|
||||
document.getElementById('decisionFilter').addEventListener('change', renderRows);
|
||||
document.getElementById('statusFilter').addEventListener('change', renderRows);
|
||||
document.getElementById('minScore').addEventListener('input', renderRows);
|
||||
document.getElementById('onlyDictionary').addEventListener('change', renderRows);
|
||||
document.getElementById('sortBy').addEventListener('change', renderRows);
|
||||
document.getElementById('sortDir').addEventListener('change', renderRows);
|
||||
document.querySelectorAll('th.sortable').forEach(th=>{
|
||||
|
||||
Loading…
Reference in New Issue
Block a user