idk
This commit is contained in:
42
kiszolgalo/src/main/resources/admin.html
Normal file
42
kiszolgalo/src/main/resources/admin.html
Normal file
@@ -0,0 +1,42 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>ScottGPT admin</title>
|
||||
<link rel="icon" type="image/x-icon" href="/resources/favicon.ico">
|
||||
<link rel="stylesheet" href="/resources/style.css">
|
||||
|
||||
</head>
|
||||
<body onload="javascript:fetch_data()">
|
||||
<h2>Conversations:</h2>
|
||||
<div id="messages">
|
||||
|
||||
</div>
|
||||
</body>
|
||||
|
||||
<script>
|
||||
|
||||
async function fetch_data()
|
||||
{
|
||||
var url = '/admin/api/all_messages'
|
||||
|
||||
fetch(url)
|
||||
.then(response => {
|
||||
if (!response.ok) {
|
||||
throw new Error('Network response was not ok');
|
||||
}
|
||||
return response.text();
|
||||
})
|
||||
.then(data => {
|
||||
|
||||
document.getElementById("messages").insertAdjacentHTML("afterbegin", data)
|
||||
|
||||
console.log(data.body)
|
||||
})
|
||||
.catch(error => {
|
||||
console.error('Error:', error);
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
</html>
|
||||
Reference in New Issue
Block a user