mirror of
https://github.com/Akif9748/akf-forum.git
synced 2024-12-23 16:19:08 +03:00
31 lines
897 B
Text
31 lines
897 B
Text
|
<!DOCTYPE html>
|
||
|
<html lang="en">
|
||
|
|
||
|
<%- include("extra/meta", {title: "Edit Forum Config!" }) %>
|
||
|
|
||
|
<body style="text-align: center;">
|
||
|
<%- include("extra/navbar") %>
|
||
|
<h1>Edit forum config</h1>
|
||
|
<textarea rows="30" cols="75"><%= config %></textarea>
|
||
|
<a onclick="send();" class="btn-primary">Edit config</a>
|
||
|
<script>
|
||
|
const textarea = document.querySelector('textarea');
|
||
|
async function send() {
|
||
|
const res = await fetch('/api/config?text', {
|
||
|
method: 'PUT',
|
||
|
body: textarea.value,
|
||
|
headers: {
|
||
|
'Content-Type': 'application/json'
|
||
|
}
|
||
|
})
|
||
|
if (res.error) return alert(res.error);
|
||
|
alert('Success!');
|
||
|
textarea.value=JSON.stringify( await res.json(),null,4)
|
||
|
|
||
|
}
|
||
|
</script>
|
||
|
<%- include("extra/footer") %>
|
||
|
|
||
|
</body>
|
||
|
|
||
|
</html>
|