Send logs to web server for display there

This commit is contained in:
2021-06-02 23:42:29 +09:30
parent 9e22490fe2
commit b69cdebf3b
6 changed files with 140 additions and 67 deletions

35
data/logs.html Normal file
View File

@@ -0,0 +1,35 @@
<main role="main" class="inner DAU">
<h1 class="DAU-heading">Config</h1>
<p class="lead">Discord-auto-upload logs</p>
<table class="table table-condensed">
<thead>
<tr>
<th>time</th><th>entry</th>
</tr>
</thead>
<tbody id="logs">
</tbody>
</table>
</main>
<script>
$(document).ready(function() {
$.ajax({ method: 'get', url: '/rest/logs'})
.done(function(data) {
console.log(data);
$.each(data, function(i, d) {
console.log('do', d);
$('#logs').append(
$('<tr>').append(
$('<th>').text(d.ts),
$('<td>').text(d.log)
)
);
});
});
});
</script>