-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bef48ab
commit b743469
Showing
3 changed files
with
76 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
--- | ||
layout: default | ||
title: Form Submissions | ||
--- | ||
|
||
This table shows form submissions over the last 30 days: | ||
<div id="form-submissions"><div class="lds-dual-ring"></div></div> | ||
|
||
<script> | ||
fetch("/secure/api/form", { | ||
method: "GET", | ||
headers: { | ||
"accept": "application/json", | ||
"content-type": "application/json", | ||
}, | ||
}) | ||
.then(res => res.json()) | ||
.then(submissions => { | ||
const table = document.createElement("table"); | ||
const thead = table.createTHead(); | ||
const headings = thead.insertRow(); | ||
headings.insertCell().innerHTML = "Submission ID"; | ||
headings.insertCell().innerHTML = "Form ID"; | ||
headings.insertCell().innerHTML = "Submitted"; | ||
headings.insertCell().innerHTML = "Spam Reasons"; | ||
headings.insertCell().innerHTML = "IP Address"; | ||
headings.insertCell().innerHTML = "ASN"; | ||
const tbody = table.createTBody(); | ||
submissions.forEach(row => { | ||
const tr = table.insertRow(); | ||
const td = tr.insertCell(); | ||
td.innerHTML = row.submission_id; | ||
}); | ||
document.getElementById("form-submissions").innerHTML = table.outerHTML; | ||
}); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters