mirror of
https://github.com/pi-hole/web.git
synced 2024-12-06 19:36:21 +01:00
Add support for arbitrary RR caching
Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
@@ -40,7 +40,9 @@ function generateRow(topic, key, value) {
|
||||
'<div class="box-header no-user-select">' +
|
||||
'<h3 class="box-title">' +
|
||||
key +
|
||||
(value.modified ? ' <i class="far fa-edit text-light-blue" title="Modified"></i>' : "") +
|
||||
(value.modified
|
||||
? ' <i class="far fa-edit text-light-blue" title="Modified"></i>'
|
||||
: "") +
|
||||
(value.flags.advanced
|
||||
? ' <i class="fas fa-cogs text-yellow" title="Expert-level setting"></i>'
|
||||
: "") +
|
||||
|
||||
@@ -46,7 +46,16 @@ function updateHostInfo() {
|
||||
// to the corresponding element (add percentage for DNS replies)
|
||||
function setMetrics(data, prefix) {
|
||||
for (const [key, val] of Object.entries(data)) {
|
||||
if (typeof val === "object") {
|
||||
if (prefix === "sysinfo-dns-cache-content-") {
|
||||
// Append row to DNS cache table
|
||||
$("#dns-cache-table").append(
|
||||
"<tr><th>Valid " +
|
||||
(val.name !== null ? val.name : "TYPE " + val.type) +
|
||||
" records in cache:</th><td>" +
|
||||
val.count +
|
||||
"</td></tr>"
|
||||
);
|
||||
} else if (typeof val === "object") {
|
||||
setMetrics(val, prefix + key + "-");
|
||||
} else if (prefix === "sysinfo-dns-replies-") {
|
||||
// Compute and display percentage of DNS replies in addition to the absolute value
|
||||
@@ -65,6 +74,7 @@ function updateMetrics() {
|
||||
})
|
||||
.done(function (data) {
|
||||
var metrics = data.metrics;
|
||||
$("#dns-cache-table").empty();
|
||||
setMetrics(metrics, "sysinfo-");
|
||||
|
||||
$("div[id^='sysinfo-metrics-overlay']").hide();
|
||||
|
||||
+1
-43
@@ -202,49 +202,7 @@ require 'scripts/pi-hole/php/header_authenticated.php';
|
||||
</tbody>
|
||||
</table>
|
||||
<table class="table table-striped table-bordered nowrap settings-level-2">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th scope="row">
|
||||
Valid A records in cache:
|
||||
</th>
|
||||
<td id="sysinfo-dns-cache-content-a"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">
|
||||
Valid AAAA records in cache:
|
||||
</th>
|
||||
<td id="sysinfo-dns-cache-content-aaaa"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">
|
||||
Valid CNAME records in cache:
|
||||
</th>
|
||||
<td id="sysinfo-dns-cache-content-cname"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">
|
||||
Valid SRV records in cache:
|
||||
</th>
|
||||
<td id="sysinfo-dns-cache-content-srv"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">
|
||||
Valid DS records in cache:
|
||||
</th>
|
||||
<td id="sysinfo-dns-cache-content-ds"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">
|
||||
Valid DNSKEY records in cache:
|
||||
</th>
|
||||
<td id="sysinfo-dns-cache-content-dnskey"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">
|
||||
Other valid records in cache:
|
||||
</th>
|
||||
<td id="sysinfo-dns-cache-content-other"> </td>
|
||||
</tr>
|
||||
<tbody id="dns-cache-table">
|
||||
</tbody>
|
||||
</table>
|
||||
See also our <a href="https://docs.pi-hole.net/ftldns/dns-cache/" rel="noopener" target="_blank">DNS cache documentation</a>.
|
||||
|
||||
Reference in New Issue
Block a user