Skip to content

Commit 8425475

Browse files
committed
Various tweaks
1 parent f08fb92 commit 8425475

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
lines changed

_assets/css/main.css

+7
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ thead th {
7575
border: solid 1px #000;
7676
font-weight: bold;
7777
padding: 10px;
78+
text-align: left;
7879
}
7980

8081
tbody td {
@@ -180,7 +181,13 @@ label {
180181

181182
/* professional experience (about page) */
182183

184+
table#professional-experience {
185+
border: none;
186+
}
187+
183188
table#professional-experience td {
189+
border: none;
190+
padding: 0;
184191
vertical-align: top;
185192
}
186193

functions/secure/api/form.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ export async function onRequest(context) {
33
return new Response("Invalid request method", { status: 405 });
44
}
55

6-
const submissionsQuery = await context.env.DB_FORMS.prepare("SELECT submission_id, form_id, submitted_ts, spam_reasons, json_extract(headers, '$.cf-connecting-ip') as ip, json_extract(cf, '$.asn') as asn, json_extract(cf, '$.country') as country FROM submissions WHERE submitted_ts > ?")
6+
const submissionsQuery = await context.env.DB_FORMS.prepare("SELECT submission_id, form_id, submitted_ts, spam_reasons, json_extract(headers, '$.cf-connecting-ip') as ip, json_extract(cf, '$.asn') as asn, json_extract(cf, '$.country') as country FROM submissions WHERE submitted_ts > ? ORDER BY submitted_ts DESC")
77
.bind(
88
new Date().subtractDays(30).toISOString(),
99
)

secure/form-submissions.md

+6-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,11 @@ This table shows form submissions over the last 30 days:
2626
"Spam Reasons",
2727
"IP Address",
2828
"ASN",
29-
].forEach(heading => headings.insertCell().innerHTML = heading);
29+
].forEach(heading => {
30+
const th = document.createElement("th");
31+
th.innerHTML = heading;
32+
headings.appendChild(th);
33+
});
3034
const tbody = table.createTBody();
3135
submissions.forEach(row => {
3236
const tr = tbody.insertRow();
@@ -41,7 +45,7 @@ This table shows form submissions over the last 30 days:
4145
tdSubmitted.innerHTML = row.submitted_ts;
4246

4347
const tdSpamReasons = tr.insertCell();
44-
tdSpamReasons.innerHTML = row.spam_reasons;
48+
tdSpamReasons.innerHTML = row.spam_reasons.join([separator = ', ']);
4549

4650
const tdIpAddress = tr.insertCell();
4751
tdIpAddress.innerHTML = `${getFlagEmoji(row.country)} <a href="https://cleantalk.org/blacklists/${row.ip}">${row.ip}</a>`;

0 commit comments

Comments
 (0)