Händelsestyrd läsning av apiEndpoint och useModel
This commit is contained in:
@@ -14,14 +14,27 @@
|
||||
<textarea id="userInput" placeholder="Type your message..." rows="5"></textarea>
|
||||
<button id="sendButton" onclick="sendMessage()">Send</button>
|
||||
|
||||
<!-- Get the apiEndpoint -->
|
||||
<script>
|
||||
<!-- Get the apiEndpoint and the useModel -->
|
||||
<!-- <script>
|
||||
const apiEndpoint = window.apiEndpoint;
|
||||
const useModel = window.useModel;
|
||||
console.log("client.html - API Endpoint: ", apiEndpoint);
|
||||
console.log("client.html - use model: ", useModel);
|
||||
</script> -->
|
||||
|
||||
<script>
|
||||
let apiEndpoint; // Make variable available outside of the scope of the event listener
|
||||
let useModel; // Make variable available outside of the scope of the event listener
|
||||
window.addEventListener('message', function(event) {
|
||||
if (event.origin === 'http://localhost:5004') { // Make sure this matches your origin
|
||||
const { apiEndpoint, useModel } = event.data;
|
||||
console.log("client.html - API Endpoint: ", apiEndpoint);
|
||||
console.log("client.html - use model: ", useModel);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<!-- Marked for markdown rendering -->
|
||||
<!-- <script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script> -->
|
||||
<!-- Marked-it for markdown rendering -->
|
||||
<script src="https://cdn.jsdelivr.net/npm/markdown-it@14.1.0/dist/markdown-it.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/markdown-it@14/dist/markdown-it.min.js"></script>
|
||||
|
||||
@@ -40,8 +53,7 @@
|
||||
</script>
|
||||
|
||||
|
||||
<!-- Get the javascript handling communication with the backend -->
|
||||
<script src="/js/frontend.js"></script>
|
||||
|
||||
|
||||
<script>
|
||||
const chatContainer = document.getElementById('chatbox');
|
||||
@@ -67,6 +79,8 @@
|
||||
|
||||
</script>
|
||||
|
||||
<!-- Get the javascript handling communication with the backend -->
|
||||
<script src="/js/frontend.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user