CHANGE SLD+TLD to FQDN, CHANGE dedublication to show all entries

This commit is contained in:
CaffeineFueled 2025-04-09 19:38:03 +02:00
parent 6ce10f673e
commit fc72f6f51c
3 changed files with 83 additions and 142 deletions

View file

@ -115,14 +115,10 @@
background-color: #e0e0e0;
color: #333;
}
.sld-badge {
.domain-badge {
background-color: #d1e7dd;
color: #0f5132;
}
.tld-badge {
background-color: #cfe2ff;
color: #0a58ca;
}
.service-badge {
background-color: #fff3cd;
color: #664d03;
@ -149,6 +145,13 @@
margin-left: 10px;
font-weight: normal;
}
.dedup-note {
display: block;
font-size: 0.7em;
color: #666;
font-weight: normal;
margin-top: 5px;
}
.tooltip {
position: relative;
display: inline-block;
@ -185,10 +188,10 @@
</head>
<body>
<div class="container">
<h1>DNS Entry Viewer</h1>
<h1>DNS Records Viewer {% if deduplicate %}(Deduplicated){% else %}(All Records){% endif %}</h1>
<div class="nav">
<a href="/" class="nav-link">SLD View</a>
<a href="/" class="nav-link">Domains</a>
<a href="/dns-records" class="nav-link">DNS Records</a>
</div>
@ -222,35 +225,28 @@
{% endfor %}
</select>
</div>
<div class="filter-group">
<label for="tld">TLD:</label>
<select id="tld" name="tld">
<option value="">All TLDs</option>
{% for tld in unique_values.tld %}
<option value="{{ tld }}" {% if request.query_params.get('tld') == tld %}selected{% endif %}>{{ tld }}</option>
{% endfor %}
</select>
</div>
<div class="filter-group">
<label for="sld">SLD:</label>
<select id="sld" name="sld">
<option value="">All SLDs</option>
{% for sld in unique_values.sld %}
<option value="{{ sld }}" {% if request.query_params.get('sld') == sld %}selected{% endif %}>{{ sld }}</option>
{% endfor %}
</select>
</div>
<div class="filter-group">
<label for="domain-search">Domain Search:</label>
<input type="text" id="domain-search" name="domain" placeholder="Enter domain name..." value="{{ request.query_params.get('domain', '') }}">
</div>
<div class="filter-group">
<label for="deduplicate">Deduplicate Records:</label>
<select id="deduplicate" name="deduplicate" class="filter-select">
<option value="true" {% if request.query_params.get('deduplicate', 'true') == 'true' %}selected{% endif %}>Yes (Deduplicate Identical Records)</option>
<option value="false" {% if request.query_params.get('deduplicate') == 'false' %}selected{% endif %}>No (Show All)</option>
</select>
</div>
<div class="filter-buttons">
<button type="submit">Apply Filters</button>
<a href="/dns-records" class="reset-button" style="padding: 8px 16px; background-color: #f44336; color: white; text-decoration: none; border-radius: 4px; font-weight: bold; display: inline-block;">Reset</a>
</div>
</form>
<h2>DNS Records <span class="count-badge">{{ entries|length }}</span></h2>
<h2>DNS Records <span class="count-badge">{{ entries|length }}</span>
{% if deduplicate %}
<small class="dedup-note">(Showing most recent entries for each Domain+Class+Type+TTL+Data combination)</small>
{% endif %}
</h2>
{% if entries %}
<table id="dns-table">
@ -271,11 +267,7 @@
{% if entry.get('service') %}
<span class="badge service-badge">{{ entry.service }}</span>
{% endif %}
{% if entry.get('subdomain') %}
{{ entry.subdomain }}.
{% endif %}
<span class="badge sld-badge">{{ entry.sld }}</span>.
<span class="badge tld-badge">{{ entry.tld }}</span>
<span class="badge domain-badge">{{ entry.domain }}</span>
</td>
<td>{{ entry.ttl }}</td>
<td>{{ entry.record_class }}</td>
@ -302,8 +294,9 @@
<div class="api-section">
<h2>API Endpoints</h2>
<p>Get all DNS entries: <code>/api/dns</code></p>
<p>Get filtered DNS entries: <code>/api/dns?record_type=A&tld=de</code></p>
<p>Get filtered DNS entries: <code>/api/dns?record_type=A&domain=example.com</code></p>
<p>Filter by upload: <code>/api/dns?upload_id={upload_id}</code></p>
<p>Show all records (no deduplication): <code>/api/dns?deduplicate=false</code></p>
<p>Get unique filter values: <code>/api/dns/types</code></p>
</div>
</div>

View file

@ -53,7 +53,7 @@
tr:hover {
background-color: #f5f5f5;
}
.sld-badge {
.domain-badge {
display: inline-block;
padding: 3px 7px;
background-color: #d1e7dd;
@ -61,14 +61,6 @@
font-size: 0.9em;
color: #0f5132;
}
.tld-badge {
display: inline-block;
padding: 3px 7px;
background-color: #cfe2ff;
border-radius: 4px;
font-size: 0.9em;
color: #0a58ca;
}
.api-section {
margin-top: 30px;
padding: 15px;
@ -149,7 +141,7 @@
<h1>Domain Management System</h1>
<div class="nav">
<a href="/" class="nav-link">SLD View</a>
<a href="/" class="nav-link">Domains</a>
<a href="/dns-records" class="nav-link">DNS Records</a>
</div>
@ -222,9 +214,9 @@
<div class="api-section">
<h3>API Endpoints</h3>
<p>Get all uploads: <code>/api/uploads</code></p>
<p>Get all domains: <code>/api/slds</code></p>
<p>Get domains by SLD: <code>/api/slds/{sld}</code></p>
<p>Filter by upload: <code>/api/slds?upload_id={upload_id}</code></p>
<p>Get all domains: <code>/api/domains</code></p>
<p>Get domains by name: <code>/api/domains/{domain}</code></p>
<p>Filter by upload: <code>/api/domains?upload_id={upload_id}</code></p>
</div>
{% if domains %}
@ -232,20 +224,14 @@
<table>
<thead>
<tr>
<th>SLD</th>
<th>TLD</th>
<th>Subdomain</th>
<th>Full Domain</th>
<th>Domain</th>
<th>Upload Date</th>
</tr>
</thead>
<tbody>
{% for item in domains %}
<tr>
<td><span class="sld-badge">{{ item.sld }}</span></td>
<td><span class="tld-badge">{{ item.tld }}</span></td>
<td>{{ item.get('subdomain', 'N/A') }}</td>
<td>{{ item.full_domain }}</td>
<td><span class="domain-badge">{{ item.full_domain }}</span></td>
<td>{{ item.timestamp.replace('T', ' ').split('.')[0] if item.get('timestamp') else 'N/A' }}</td>
</tr>
{% endfor %}