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