cloudflare fix

This commit is contained in:
oliver
2026-08-10 08:16:28 -03:00
parent 896f3b01bb
commit 11898faa3d
+6 -5
View File
@@ -317,8 +317,8 @@ function dnsRender() {
const name = r.name.toLowerCase(); const name = r.name.toLowerCase();
if (HIDDEN_NAMES.includes(name)) return false; if (HIDDEN_NAMES.includes(name)) return false;
const matchType = !typeFilter || r.type === typeFilter; const matchType = !typeFilter || r.type === typeFilter;
const content = (r.records || []) const content = (r.records && r.records.length ? r.records : [r])
.map((x) => x.content) .map((x) => x.content || "")
.join(" ") .join(" ")
.toLowerCase(); .toLowerCase();
const matchSearch = const matchSearch =
@@ -347,7 +347,7 @@ function dnsRender() {
tbody.innerHTML = filtered tbody.innerHTML = filtered
.map((r) => { .map((r) => {
const records = r.records || []; const records = r.records && r.records.length ? r.records : [r];
const content = records const content = records
.map((x) => `<span class="mono">${escHtml(x.content)}</span>`) .map((x) => `<span class="mono">${escHtml(x.content)}</span>`)
.join("<br>"); .join("<br>");
@@ -364,6 +364,7 @@ function dnsRender() {
<td style="white-space:nowrap;">${statusHtml}</td> <td style="white-space:nowrap;">${statusHtml}</td>
<td> <td>
<button class="btn btn-danger btn-sm" <button class="btn btn-danger btn-sm"
data-id="${escHtml(r.id)}"
data-name="${escHtml(r.name)}" data-name="${escHtml(r.name)}"
data-type="${escHtml(r.type)}" data-type="${escHtml(r.type)}"
onclick="dnsDeleteRecord(this)"> onclick="dnsDeleteRecord(this)">
@@ -382,6 +383,7 @@ function dnsRender() {
/* ─── DNS — Delete ─────────────────────────────────────────────────── */ /* ─── DNS — Delete ─────────────────────────────────────────────────── */
async function dnsDeleteRecord(btn) { async function dnsDeleteRecord(btn) {
const record = { const record = {
id: btn.dataset.id,
name: btn.dataset.name, name: btn.dataset.name,
type: btn.dataset.type, type: btn.dataset.type,
}; };
@@ -396,8 +398,7 @@ async function dnsDeleteRecord(btn) {
method: "DELETE", method: "DELETE",
headers: apiHeaders(), headers: apiHeaders(),
body: JSON.stringify({ body: JSON.stringify({
name: record.name, id: record.id,
type: record.type,
}), }),
}); });
if (!res.ok) throw new Error(`HTTP ${res.status}`); if (!res.ok) throw new Error(`HTTP ${res.status}`);