|
|
<!DOCTYPE html> |
|
|
<html lang="en"> |
|
|
<head> |
|
|
<meta charset="UTF-8"> |
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0"> |
|
|
<title>AI Project Manager</title> |
|
|
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script> |
|
|
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet"> |
|
|
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css" rel="stylesheet"> |
|
|
<style> |
|
|
:root { |
|
|
--primary-color: #2c3e50; |
|
|
--secondary-color: #3498db; |
|
|
--accent-color: #e74c3c; |
|
|
--success-color: #27ae60; |
|
|
--warning-color: #f39c12; |
|
|
--background-color: #f8f9fa; |
|
|
--card-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); |
|
|
} |
|
|
|
|
|
body { |
|
|
background-color: var(--background-color); |
|
|
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; |
|
|
} |
|
|
|
|
|
.navbar { |
|
|
background: linear-gradient(135deg, var(--primary-color), var(--secondary-color)); |
|
|
box-shadow: var(--card-shadow); |
|
|
} |
|
|
|
|
|
.navbar-brand { |
|
|
font-weight: bold; |
|
|
font-size: 1.5rem; |
|
|
color: white !important; |
|
|
} |
|
|
|
|
|
.dashboard-card { |
|
|
background: white; |
|
|
border-radius: 12px; |
|
|
box-shadow: var(--card-shadow); |
|
|
transition: transform 0.3s ease; |
|
|
border: none; |
|
|
} |
|
|
|
|
|
.dashboard-card:hover { |
|
|
transform: translateY(-2px); |
|
|
} |
|
|
|
|
|
.filter-section { |
|
|
background: white; |
|
|
border-radius: 12px; |
|
|
box-shadow: var(--card-shadow); |
|
|
padding: 20px; |
|
|
margin-bottom: 20px; |
|
|
} |
|
|
|
|
|
.chart-container { |
|
|
position: relative; |
|
|
height: 300px; |
|
|
padding: 20px; |
|
|
} |
|
|
|
|
|
.priority-table { |
|
|
max-height: 300px; |
|
|
overflow-y: auto; |
|
|
} |
|
|
|
|
|
.priority-high { |
|
|
color: var(--accent-color); |
|
|
font-weight: bold; |
|
|
} |
|
|
|
|
|
.priority-medium { |
|
|
color: var(--warning-color); |
|
|
font-weight: bold; |
|
|
} |
|
|
|
|
|
.priority-low { |
|
|
color: var(--success-color); |
|
|
font-weight: bold; |
|
|
} |
|
|
|
|
|
.chat-container { |
|
|
background: white; |
|
|
border-radius: 12px; |
|
|
box-shadow: var(--card-shadow); |
|
|
height: 500px; |
|
|
display: flex; |
|
|
flex-direction: column; |
|
|
} |
|
|
|
|
|
.chat-header { |
|
|
background: linear-gradient(135deg, var(--primary-color), var(--secondary-color)); |
|
|
color: white; |
|
|
padding: 15px 20px; |
|
|
border-radius: 12px 12px 0 0; |
|
|
font-weight: bold; |
|
|
} |
|
|
|
|
|
.chat-messages { |
|
|
flex: 1; |
|
|
padding: 20px; |
|
|
overflow-y: auto; |
|
|
max-height: 350px; |
|
|
} |
|
|
|
|
|
.message { |
|
|
margin-bottom: 15px; |
|
|
animation: fadeIn 0.3s ease; |
|
|
} |
|
|
|
|
|
.message.user { |
|
|
text-align: right; |
|
|
} |
|
|
|
|
|
.message.bot { |
|
|
text-align: left; |
|
|
} |
|
|
|
|
|
.message-bubble { |
|
|
display: inline-block; |
|
|
padding: 12px 16px; |
|
|
border-radius: 18px; |
|
|
max-width: 70%; |
|
|
word-wrap: break-word; |
|
|
} |
|
|
|
|
|
.message.user .message-bubble { |
|
|
background: var(--secondary-color); |
|
|
color: white; |
|
|
} |
|
|
|
|
|
.message.bot .message-bubble { |
|
|
background: #e9ecef; |
|
|
color: var(--primary-color); |
|
|
} |
|
|
|
|
|
.chat-input-container { |
|
|
padding: 20px; |
|
|
border-top: 1px solid #e9ecef; |
|
|
border-radius: 0 0 12px 12px; |
|
|
} |
|
|
|
|
|
.chat-input { |
|
|
border: 2px solid #e9ecef; |
|
|
border-radius: 25px; |
|
|
padding: 12px 20px; |
|
|
transition: border-color 0.3s ease; |
|
|
} |
|
|
|
|
|
.chat-input:focus { |
|
|
border-color: var(--secondary-color); |
|
|
box-shadow: 0 0 0 0.2rem rgba(52, 152, 219, 0.25); |
|
|
} |
|
|
|
|
|
.btn-send { |
|
|
background: var(--secondary-color); |
|
|
border: none; |
|
|
border-radius: 50%; |
|
|
width: 45px; |
|
|
height: 45px; |
|
|
color: white; |
|
|
transition: background-color 0.3s ease; |
|
|
} |
|
|
|
|
|
.btn-send:hover { |
|
|
background: var(--primary-color); |
|
|
color: white; |
|
|
} |
|
|
|
|
|
@keyframes fadeIn { |
|
|
from { opacity: 0; transform: translateY(10px); } |
|
|
to { opacity: 1; transform: translateY(0); } |
|
|
} |
|
|
|
|
|
.loading { |
|
|
display: none; |
|
|
text-align: center; |
|
|
color: #6c757d; |
|
|
} |
|
|
|
|
|
.loading .spinner-border { |
|
|
width: 1rem; |
|
|
height: 1rem; |
|
|
} |
|
|
|
|
|
@media (max-width: 768px) { |
|
|
.chart-container { |
|
|
height: 250px; |
|
|
} |
|
|
|
|
|
.chat-container { |
|
|
height: 400px; |
|
|
} |
|
|
|
|
|
.chat-messages { |
|
|
max-height: 250px; |
|
|
} |
|
|
} |
|
|
</style> |
|
|
</head> |
|
|
<body> |
|
|
|
|
|
<nav class="navbar navbar-expand-lg"> |
|
|
<div class="container"> |
|
|
<a class="navbar-brand" href="#"> |
|
|
<i class="fas fa-chart-line me-2"></i>AI Project Manager |
|
|
</a> |
|
|
</div> |
|
|
</nav> |
|
|
|
|
|
<div class="container mt-4"> |
|
|
|
|
|
<div class="filter-section"> |
|
|
<div class="row g-3"> |
|
|
<div class="col-md-4"> |
|
|
<label class="form-label"><i class="fas fa-calendar me-2"></i>Date Range</label> |
|
|
<div class="input-group"> |
|
|
<input type="date" class="form-control" value="2024-01-01"> |
|
|
<span class="input-group-text">to</span> |
|
|
<input type="date" class="form-control" value="2024-12-31"> |
|
|
</div> |
|
|
</div> |
|
|
<div class="col-md-4"> |
|
|
<label class="form-label"><i class="fas fa-tasks me-2"></i>Status</label> |
|
|
<select class="form-select"> |
|
|
<option>All Status</option> |
|
|
<option>Active</option> |
|
|
<option>Completed</option> |
|
|
<option>On Hold</option> |
|
|
<option>Cancelled</option> |
|
|
</select> |
|
|
</div> |
|
|
<div class="col-md-4"> |
|
|
<label class="form-label"><i class="fas fa-project-diagram me-2"></i>Project</label> |
|
|
<select class="form-select"> |
|
|
<option>All Projects</option> |
|
|
<option>E-commerce Platform</option> |
|
|
<option>Mobile App</option> |
|
|
<option>Data Analytics</option> |
|
|
<option>AI Chatbot</option> |
|
|
</select> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
<div class="row g-4 mb-4"> |
|
|
|
|
|
<div class="col-lg-4"> |
|
|
<div class="card dashboard-card h-100"> |
|
|
<div class="card-header bg-transparent"> |
|
|
<h5 class="mb-0"><i class="fas fa-chart-pie me-2"></i>Project Breakdown</h5> |
|
|
</div> |
|
|
<div class="chart-container"> |
|
|
<canvas id="projectChart"></canvas> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
<div class="col-lg-4"> |
|
|
<div class="card dashboard-card h-100"> |
|
|
<div class="card-header bg-transparent"> |
|
|
<h5 class="mb-0"><i class="fas fa-chart-donut me-2"></i>Task Status</h5> |
|
|
</div> |
|
|
<div class="chart-container"> |
|
|
<canvas id="taskChart"></canvas> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
<div class="col-lg-4"> |
|
|
<div class="card dashboard-card h-100"> |
|
|
<div class="card-header bg-transparent"> |
|
|
<h5 class="mb-0"><i class="fas fa-list me-2"></i>Priority Projects</h5> |
|
|
</div> |
|
|
<div class="card-body p-0"> |
|
|
<div class="priority-table"> |
|
|
<table class="table table-hover mb-0"> |
|
|
<thead class="table-light"> |
|
|
<tr> |
|
|
<th>Project</th> |
|
|
<th>Priority</th> |
|
|
<th>Progress</th> |
|
|
</tr> |
|
|
</thead> |
|
|
<tbody> |
|
|
<tr> |
|
|
<td>E-commerce Platform</td> |
|
|
<td><span class="priority-high">High</span></td> |
|
|
<td> |
|
|
<div class="progress" style="height: 8px;"> |
|
|
<div class="progress-bar bg-danger" style="width: 75%"></div> |
|
|
</div> |
|
|
</td> |
|
|
</tr> |
|
|
<tr> |
|
|
<td>Mobile App Development</td> |
|
|
<td><span class="priority-high">High</span></td> |
|
|
<td> |
|
|
<div class="progress" style="height: 8px;"> |
|
|
<div class="progress-bar bg-warning" style="width: 60%"></div> |
|
|
</div> |
|
|
</td> |
|
|
</tr> |
|
|
<tr> |
|
|
<td>Data Analytics Dashboard</td> |
|
|
<td><span class="priority-medium">Medium</span></td> |
|
|
<td> |
|
|
<div class="progress" style="height: 8px;"> |
|
|
<div class="progress-bar bg-info" style="width: 40%"></div> |
|
|
</div> |
|
|
</td> |
|
|
</tr> |
|
|
<tr> |
|
|
<td>AI Chatbot Integration</td> |
|
|
<td><span class="priority-medium">Medium</span></td> |
|
|
<td> |
|
|
<div class="progress" style="height: 8px;"> |
|
|
<div class="progress-bar bg-success" style="width: 90%"></div> |
|
|
</div> |
|
|
</td> |
|
|
</tr> |
|
|
<tr> |
|
|
<td>Website Redesign</td> |
|
|
<td><span class="priority-low">Low</span></td> |
|
|
<td> |
|
|
<div class="progress" style="height: 8px;"> |
|
|
<div class="progress-bar bg-secondary" style="width: 25%"></div> |
|
|
</div> |
|
|
</td> |
|
|
</tr> |
|
|
<tr> |
|
|
<td>API Documentation</td> |
|
|
<td><span class="priority-low">Low</span></td> |
|
|
<td> |
|
|
<div class="progress" style="height: 8px;"> |
|
|
<div class="progress-bar bg-success" style="width: 85%"></div> |
|
|
</div> |
|
|
</td> |
|
|
</tr> |
|
|
<tr> |
|
|
<td>Security Audit</td> |
|
|
<td><span class="priority-high">High</span></td> |
|
|
<td> |
|
|
<div class="progress" style="height: 8px;"> |
|
|
<div class="progress-bar bg-warning" style="width: 50%"></div> |
|
|
</div> |
|
|
</td> |
|
|
</tr> |
|
|
</tbody> |
|
|
</table> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
<div class="row"> |
|
|
<div class="col-12"> |
|
|
<div class="chat-container"> |
|
|
<div class="chat-header"> |
|
|
<i class="fas fa-robot me-2"></i>AI Project Assistant |
|
|
</div> |
|
|
<div class="chat-messages" id="chatMessages"> |
|
|
<div class="message bot"> |
|
|
<div class="message-bubble"> |
|
|
Hello! I'm your AI Project Assistant. How can I help you manage your projects today? |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
<div class="loading" id="loadingIndicator"> |
|
|
<div class="spinner-border me-2" role="status"></div> |
|
|
<span>AI is thinking...</span> |
|
|
</div> |
|
|
<div class="chat-input-container"> |
|
|
<div class="input-group"> |
|
|
<input type="text" class="form-control chat-input" id="chatInput" |
|
|
placeholder="Ask me about your projects..." |
|
|
onkeypress="handleKeyPress(event)"> |
|
|
<button class="btn btn-send" onclick="sendMessage()"> |
|
|
<i class="fas fa-paper-plane"></i> |
|
|
</button> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script> |
|
|
<script> |
|
|
|
|
|
const projectCtx = document.getElementById('projectChart').getContext('2d'); |
|
|
const projectChart = new Chart(projectCtx, { |
|
|
type: 'pie', |
|
|
data: { |
|
|
labels: ['E-commerce', 'Mobile App', 'Data Analytics', 'AI Chatbot', 'Others'], |
|
|
datasets: [{ |
|
|
data: [30, 25, 20, 15, 10], |
|
|
backgroundColor: [ |
|
|
'#e74c3c', |
|
|
'#3498db', |
|
|
'#f39c12', |
|
|
'#27ae60', |
|
|
'#9b59b6' |
|
|
], |
|
|
borderWidth: 2, |
|
|
borderColor: '#fff' |
|
|
}] |
|
|
}, |
|
|
options: { |
|
|
responsive: true, |
|
|
maintainAspectRatio: false, |
|
|
plugins: { |
|
|
legend: { |
|
|
position: 'bottom', |
|
|
labels: { |
|
|
padding: 15, |
|
|
usePointStyle: true |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
}); |
|
|
|
|
|
const taskCtx = document.getElementById('taskChart').getContext('2d'); |
|
|
const taskChart = new Chart(taskCtx, { |
|
|
type: 'doughnut', |
|
|
data: { |
|
|
labels: ['Completed', 'In Progress', 'On Hold', 'Pending'], |
|
|
datasets: [{ |
|
|
data: [45, 30, 15, 10], |
|
|
backgroundColor: [ |
|
|
'#27ae60', |
|
|
'#3498db', |
|
|
'#f39c12', |
|
|
'#e74c3c' |
|
|
], |
|
|
borderWidth: 2, |
|
|
borderColor: '#fff' |
|
|
}] |
|
|
}, |
|
|
options: { |
|
|
responsive: true, |
|
|
maintainAspectRatio: false, |
|
|
plugins: { |
|
|
legend: { |
|
|
position: 'bottom', |
|
|
labels: { |
|
|
padding: 15, |
|
|
usePointStyle: true |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
}); |
|
|
|
|
|
|
|
|
function addMessage(message, isUser = false) { |
|
|
const chatMessages = document.getElementById('chatMessages'); |
|
|
const messageDiv = document.createElement('div'); |
|
|
messageDiv.className = `message ${isUser ? 'user' : 'bot'}`; |
|
|
|
|
|
const bubbleDiv = document.createElement('div'); |
|
|
bubbleDiv.className = 'message-bubble'; |
|
|
bubbleDiv.textContent = message; |
|
|
|
|
|
messageDiv.appendChild(bubbleDiv); |
|
|
chatMessages.appendChild(messageDiv); |
|
|
|
|
|
|
|
|
chatMessages.scrollTop = chatMessages.scrollHeight; |
|
|
} |
|
|
|
|
|
function showLoading(show) { |
|
|
const loadingIndicator = document.getElementById('loadingIndicator'); |
|
|
loadingIndicator.style.display = show ? 'block' : 'none'; |
|
|
} |
|
|
|
|
|
async function sendMessage() { |
|
|
const chatInput = document.getElementById('chatInput'); |
|
|
const message = chatInput.value.trim(); |
|
|
|
|
|
if (!message) return; |
|
|
|
|
|
|
|
|
addMessage(message, true); |
|
|
chatInput.value = ''; |
|
|
|
|
|
|
|
|
showLoading(true); |
|
|
|
|
|
try { |
|
|
const response = await fetch('/chat', { |
|
|
method: 'POST', |
|
|
headers: { |
|
|
'Content-Type': 'application/json', |
|
|
}, |
|
|
body: JSON.stringify({ query: message }) |
|
|
}); |
|
|
|
|
|
const data = await response.json(); |
|
|
|
|
|
|
|
|
showLoading(false); |
|
|
|
|
|
|
|
|
addMessage(data.answer || 'Sorry, I could not process your request.'); |
|
|
|
|
|
} catch (error) { |
|
|
console.error('Error:', error); |
|
|
showLoading(false); |
|
|
addMessage('Sorry, there was an error processing your request. Please try again.'); |
|
|
} |
|
|
} |
|
|
|
|
|
function handleKeyPress(event) { |
|
|
if (event.key === 'Enter') { |
|
|
sendMessage(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
document.getElementById('chatInput').focus(); |
|
|
</script> |
|
|
</body> |
|
|
</html> |