2022-10-09 22:57:46 +03:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html lang="en">
|
|
|
|
|
2023-05-25 17:23:31 +03:00
|
|
|
<%- include(dataset.getFile(dataset.theme.codename +"/views/extra/meta"), {title: "Edit Forum Config!" }) %>
|
2022-10-09 22:57:46 +03:00
|
|
|
|
|
|
|
<body style="text-align: center;">
|
2023-05-25 17:23:31 +03:00
|
|
|
<%- include(dataset.getFile(dataset.theme.codename +"/views/extra/navbar")) %>
|
|
|
|
|
2022-10-09 22:57:46 +03:00
|
|
|
<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>
|
2023-05-25 17:23:31 +03:00
|
|
|
<%- include(dataset.getFile(dataset.theme.codename +"/views/extra/footer")) %>
|
2022-10-09 22:57:46 +03:00
|
|
|
|
|
|
|
</body>
|
|
|
|
|
|
|
|
</html>
|