This commit is contained in:
2025-12-31 09:57:55 +01:00
parent dbc3011cc6
commit a926a9d667
4 changed files with 139 additions and 63 deletions

View 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>