Add TimescaleDB migration for QDS
This commit is contained in:
86
resources/views/chatbot.blade.php
Normal file
86
resources/views/chatbot.blade.php
Normal file
@@ -0,0 +1,86 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Gemini Chat</title>
|
||||
<style>
|
||||
body {
|
||||
font-family: Arial, sans-serif;
|
||||
margin: 40px;
|
||||
}
|
||||
#chat-box {
|
||||
border: 1px solid #ccc;
|
||||
padding: 15px;
|
||||
height: 300px;
|
||||
overflow-y: scroll;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.user, .bot {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.user {
|
||||
text-align: right;
|
||||
color: blue;
|
||||
}
|
||||
.bot {
|
||||
text-align: left;
|
||||
color: green;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<h2>Gemini Chat</h2>
|
||||
<div id="chat-box"></div>
|
||||
<textarea id="prompt" rows="3" cols="60" placeholder="Type your message here..."></textarea><br>
|
||||
<button onclick="sendPrompt()">Send</button>
|
||||
|
||||
<script>
|
||||
async function getGeminiResponse(prompt) {
|
||||
try {
|
||||
const res = await fetch('http://172.31.31.51:8000/api/chatbot/message', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
body: JSON.stringify({ message: prompt })
|
||||
});
|
||||
|
||||
if (!res.ok) {
|
||||
const errorText = await res.text();
|
||||
console.error(`Server returned ${res.status}:`, errorText);
|
||||
throw new Error(`HTTP error! Status: ${res.status}`);
|
||||
}
|
||||
|
||||
const data = await res.json();
|
||||
return data.reply || "Sorry, no response.";
|
||||
} catch (e) {
|
||||
console.error('Fetch error:', e);
|
||||
return "Error fetching response.";
|
||||
}
|
||||
}
|
||||
|
||||
async function sendPrompt() {
|
||||
const promptInput = document.getElementById('prompt');
|
||||
const prompt = promptInput.value.trim();
|
||||
if (!prompt) return;
|
||||
|
||||
appendMessage('user', prompt);
|
||||
promptInput.value = '';
|
||||
|
||||
const reply = await getGeminiResponse(prompt);
|
||||
appendMessage('bot', reply);
|
||||
}
|
||||
|
||||
function appendMessage(sender, text) {
|
||||
const chatBox = document.getElementById('chat-box');
|
||||
const message = document.createElement('div');
|
||||
message.className = sender;
|
||||
message.textContent = text;
|
||||
chatBox.appendChild(message);
|
||||
chatBox.scrollTop = chatBox.scrollHeight;
|
||||
}
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,8 @@
|
||||
<button
|
||||
type="button"
|
||||
wire:click="updateInvoice"
|
||||
class="px-2 py-1 border border-primary-500 text-primary-600 rounded hover:bg-primary-50 hover:border-primary-700 transition text-sm"
|
||||
>
|
||||
Update Invoice
|
||||
</button>
|
||||
|
||||
0
resources/views/vendor/filament/components/layouts/app.blade.php
vendored
Normal file
0
resources/views/vendor/filament/components/layouts/app.blade.php
vendored
Normal file
Reference in New Issue
Block a user