Spaces:
Paused
Paused
Update index.html
Browse files- index.html +102 -102
index.html
CHANGED
|
@@ -3,131 +3,131 @@
|
|
| 3 |
<head>
|
| 4 |
<meta charset="UTF-8">
|
| 5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
-
<title>Elite Visuals
|
| 7 |
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap" rel="stylesheet">
|
| 8 |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
| 9 |
<style>
|
| 10 |
* { margin: 0; padding: 0; box-sizing: border-box; }
|
| 11 |
-
body { background: linear-gradient(135deg, #0a0a0f 0%, #12121a 100%); font-family: 'Inter', sans-serif; height: 100vh;
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
.
|
| 16 |
-
.
|
| 17 |
-
|
| 18 |
-
.
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
.chat-messages { flex: 1; padding: 16px; overflow-y: auto; background: #f0f2f5; display: flex; flex-direction: column; gap: 12px; }
|
| 26 |
-
.message { max-width: 85%; padding: 10px 14px; border-radius: 22px; font-size: 0.85rem; line-height: 1.45; white-space: pre-line; animation: fadeIn 0.25s; }
|
| 27 |
-
@keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
|
| 28 |
-
.user-msg { background: #DCF8C6; margin-left: auto; border-bottom-right-radius: 6px; }
|
| 29 |
-
.bot-msg { background: white; margin-right: auto; border-bottom-left-radius: 6px; box-shadow: 0 1px 2px rgba(0,0,0,0.05); }
|
| 30 |
-
|
| 31 |
-
.status-badge { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 0.7rem; margin-left: 8px; }
|
| 32 |
.status-pending { background: #ffc107; color: #333; }
|
| 33 |
.status-progress { background: #17a2b8; color: white; }
|
| 34 |
.status-completed { background: #28a745; color: white; }
|
| 35 |
-
|
| 36 |
-
.
|
| 37 |
-
.
|
| 38 |
-
.
|
| 39 |
-
.input-box button { background: #25D366; border: none; width: 42px; height: 42px; border-radius: 50%; color: white; cursor: pointer; transition: 0.2s; }
|
| 40 |
-
.input-box button:hover { background: #128C7E; transform: scale(1.02); }
|
| 41 |
-
|
| 42 |
-
.typing { display: flex; gap: 6px; padding: 5px 0; }
|
| 43 |
-
.typing span { width: 8px; height: 8px; background: #aaa; border-radius: 50%; animation: wave 1.2s infinite; }
|
| 44 |
-
@keyframes wave { 0%,60%,100% { opacity: 0.3; } 30% { opacity: 1; transform: translateY(-3px); } }
|
| 45 |
-
|
| 46 |
-
.project-id { background: #1e2a3a; color: #ffd700; padding: 2px 6px; border-radius: 6px; font-family: monospace; }
|
| 47 |
-
|
| 48 |
-
/* Project status panel */
|
| 49 |
-
.status-panel { background: white; border-radius: 16px; padding: 12px; margin: 8px 0; border-left: 4px solid #25D366; }
|
| 50 |
</style>
|
| 51 |
</head>
|
| 52 |
<body>
|
| 53 |
-
<div class="
|
| 54 |
-
<
|
| 55 |
-
<
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
<div class="
|
|
|
|
| 61 |
</div>
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
<
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 67 |
</div>
|
| 68 |
</div>
|
| 69 |
|
| 70 |
<script>
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 106 |
}
|
| 107 |
|
| 108 |
-
|
| 109 |
-
const msg = userInput.value.trim();
|
| 110 |
-
if (!msg) return;
|
| 111 |
-
addMessage(msg, 'user');
|
| 112 |
-
userInput.value = '';
|
| 113 |
-
showTyping();
|
| 114 |
try {
|
| 115 |
-
|
| 116 |
-
method: '
|
| 117 |
headers: { 'Content-Type': 'application/json' },
|
| 118 |
-
body: JSON.stringify({
|
| 119 |
});
|
| 120 |
-
|
| 121 |
-
hideTyping();
|
| 122 |
-
addMessage(data.reply, 'bot');
|
| 123 |
} catch (err) {
|
| 124 |
-
|
| 125 |
-
addMessage("β Server error. Please try again.", 'bot');
|
| 126 |
}
|
| 127 |
-
}
|
| 128 |
|
| 129 |
-
|
| 130 |
-
|
| 131 |
</script>
|
| 132 |
</body>
|
| 133 |
</html>
|
|
|
|
| 3 |
<head>
|
| 4 |
<meta charset="UTF-8">
|
| 5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>Elite Visuals β Admin Panel</title>
|
| 7 |
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap" rel="stylesheet">
|
| 8 |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
| 9 |
<style>
|
| 10 |
* { margin: 0; padding: 0; box-sizing: border-box; }
|
| 11 |
+
body { background: linear-gradient(135deg, #0a0a0f 0%, #12121a 100%); font-family: 'Inter', sans-serif; min-height: 100vh; padding: 30px; }
|
| 12 |
+
.container { max-width: 1400px; margin: 0 auto; }
|
| 13 |
+
h1 { color: white; margin-bottom: 10px; display: flex; align-items: center; gap: 15px; }
|
| 14 |
+
h1 i { color: #25D366; }
|
| 15 |
+
.subtitle { color: #8e8e9e; margin-bottom: 30px; }
|
| 16 |
+
.stats { display: flex; gap: 20px; margin-bottom: 30px; flex-wrap: wrap; }
|
| 17 |
+
.stat-card { background: rgba(255,255,255,0.1); backdrop-filter: blur(10px); border-radius: 20px; padding: 20px; min-width: 150px; text-align: center; }
|
| 18 |
+
.stat-card h3 { color: #8e8e9e; font-size: 0.85rem; margin-bottom: 8px; }
|
| 19 |
+
.stat-card .number { font-size: 2rem; font-weight: 700; color: #25D366; }
|
| 20 |
+
.projects-table { background: rgba(255,255,255,0.05); border-radius: 20px; overflow-x: auto; }
|
| 21 |
+
table { width: 100%; border-collapse: collapse; }
|
| 22 |
+
th, td { padding: 15px; text-align: left; border-bottom: 1px solid rgba(255,255,255,0.1); color: #e0e0e0; }
|
| 23 |
+
th { background: rgba(0,0,0,0.3); font-weight: 600; color: #25D366; }
|
| 24 |
+
.status-badge { display: inline-block; padding: 4px 12px; border-radius: 20px; font-size: 0.75rem; font-weight: 500; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
.status-pending { background: #ffc107; color: #333; }
|
| 26 |
.status-progress { background: #17a2b8; color: white; }
|
| 27 |
.status-completed { background: #28a745; color: white; }
|
| 28 |
+
select { background: #1e2a3a; color: white; border: 1px solid #2a2a35; border-radius: 8px; padding: 6px 10px; cursor: pointer; }
|
| 29 |
+
.refresh-btn { background: #25D366; border: none; padding: 10px 20px; border-radius: 12px; color: white; cursor: pointer; margin-bottom: 20px; }
|
| 30 |
+
.refresh-btn:hover { background: #128C7E; }
|
| 31 |
+
.loading { text-align: center; padding: 40px; color: #8e8e9e; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 32 |
</style>
|
| 33 |
</head>
|
| 34 |
<body>
|
| 35 |
+
<div class="container">
|
| 36 |
+
<h1><i class="fas fa-crown"></i> Elite Visuals β Admin Panel</h1>
|
| 37 |
+
<p class="subtitle"><i class="fas fa-chart-line"></i> Manage all client projects, update status, track everything</p>
|
| 38 |
+
|
| 39 |
+
<div class="stats">
|
| 40 |
+
<div class="stat-card"><h3>Total Projects</h3><div class="number" id="totalProjects">0</div></div>
|
| 41 |
+
<div class="stat-card"><h3>Pending</h3><div class="number" id="pendingCount">0</div></div>
|
| 42 |
+
<div class="stat-card"><h3>In Progress</h3><div class="number" id="progressCount">0</div></div>
|
| 43 |
+
<div class="stat-card"><h3>Completed</h3><div class="number" id="completedCount">0</div></div>
|
| 44 |
</div>
|
| 45 |
+
|
| 46 |
+
<button class="refresh-btn" id="refreshBtn"><i class="fas fa-sync-alt"></i> Refresh Data</button>
|
| 47 |
+
|
| 48 |
+
<div class="projects-table">
|
| 49 |
+
<table>
|
| 50 |
+
<thead>
|
| 51 |
+
<tr><th>Project ID</th><th>Domain</th><th>Pages</th><th>E-com</th><th>Chatbot</th><th>SEO</th><th>Price (PKR)</th><th>Timeline</th><th>Status</th><th>Action</th></tr>
|
| 52 |
+
</thead>
|
| 53 |
+
<tbody id="projectsTableBody">
|
| 54 |
+
<tr><td colspan="10" class="loading">Loading projects... <i class="fas fa-spinner fa-spin"></i></td></tr>
|
| 55 |
+
</tbody>
|
| 56 |
+
</table>
|
| 57 |
</div>
|
| 58 |
</div>
|
| 59 |
|
| 60 |
<script>
|
| 61 |
+
async function loadProjects() {
|
| 62 |
+
try {
|
| 63 |
+
const res = await fetch('/api/projects');
|
| 64 |
+
const data = await res.json();
|
| 65 |
+
const projects = data.projects || [];
|
| 66 |
+
|
| 67 |
+
const total = projects.length;
|
| 68 |
+
const pending = projects.filter(p => p.status === 'pending').length;
|
| 69 |
+
const progress = projects.filter(p => p.status === 'in-progress').length;
|
| 70 |
+
const completed = projects.filter(p => p.status === 'completed').length;
|
| 71 |
+
|
| 72 |
+
document.getElementById('totalProjects').innerText = total;
|
| 73 |
+
document.getElementById('pendingCount').innerText = pending;
|
| 74 |
+
document.getElementById('progressCount').innerText = progress;
|
| 75 |
+
document.getElementById('completedCount').innerText = completed;
|
| 76 |
+
|
| 77 |
+
const tbody = document.getElementById('projectsTableBody');
|
| 78 |
+
if (projects.length === 0) {
|
| 79 |
+
tbody.innerHTML = '<tr><td colspan="10" class="loading">No projects found</td></tr>';
|
| 80 |
+
return;
|
| 81 |
+
}
|
| 82 |
+
|
| 83 |
+
tbody.innerHTML = '';
|
| 84 |
+
projects.forEach(proj => {
|
| 85 |
+
const req = proj.requirements || {};
|
| 86 |
+
const statusClass = proj.status === 'pending' ? 'status-pending' : (proj.status === 'in-progress' ? 'status-progress' : 'status-completed');
|
| 87 |
+
const statusText = proj.status === 'pending' ? 'β³ Pending' : (proj.status === 'in-progress' ? 'π In Progress' : 'β
Completed');
|
| 88 |
+
|
| 89 |
+
const row = document.createElement('tr');
|
| 90 |
+
row.innerHTML = `
|
| 91 |
+
<td><code>${proj.project_id}</code></td>
|
| 92 |
+
<td>${req.domain ? 'β
Yes' : 'β No'}</td>
|
| 93 |
+
<td>${req.pages || 5}</td>
|
| 94 |
+
<td>${req.ecommerce ? 'β
' : 'β'}</td>
|
| 95 |
+
<td>${req.chatbot ? 'β
' : 'β'}</td>
|
| 96 |
+
<td>${req.seo ? 'β
' : 'β'}</td>
|
| 97 |
+
<td><strong>PKR ${(proj.calculated_price || 0).toLocaleString()}</strong></td>
|
| 98 |
+
<td>${proj.calculated_timeline || 0} days</td>
|
| 99 |
+
<td><span class="status-badge ${statusClass}">${statusText}</span></td>
|
| 100 |
+
<td>
|
| 101 |
+
<select onchange="updateStatus('${proj.project_id}', this.value)">
|
| 102 |
+
<option value="pending" ${proj.status === 'pending' ? 'selected' : ''}>β³ Pending</option>
|
| 103 |
+
<option value="in-progress" ${proj.status === 'in-progress' ? 'selected' : ''}>π In Progress</option>
|
| 104 |
+
<option value="completed" ${proj.status === 'completed' ? 'selected' : ''}>β
Completed</option>
|
| 105 |
+
</select>
|
| 106 |
+
</td>
|
| 107 |
+
`;
|
| 108 |
+
tbody.appendChild(row);
|
| 109 |
+
});
|
| 110 |
+
} catch (err) {
|
| 111 |
+
console.error(err);
|
| 112 |
+
document.getElementById('projectsTableBody').innerHTML = '<tr><td colspan="10" class="loading">Error loading projects</td></tr>';
|
| 113 |
+
}
|
| 114 |
}
|
| 115 |
|
| 116 |
+
window.updateStatus = async (projectId, newStatus) => {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 117 |
try {
|
| 118 |
+
await fetch(`/api/project/${projectId}/status`, {
|
| 119 |
+
method: 'PUT',
|
| 120 |
headers: { 'Content-Type': 'application/json' },
|
| 121 |
+
body: JSON.stringify({ status: newStatus })
|
| 122 |
});
|
| 123 |
+
loadProjects(); // refresh
|
|
|
|
|
|
|
| 124 |
} catch (err) {
|
| 125 |
+
alert('Error updating status');
|
|
|
|
| 126 |
}
|
| 127 |
+
};
|
| 128 |
|
| 129 |
+
document.getElementById('refreshBtn').addEventListener('click', loadProjects);
|
| 130 |
+
loadProjects();
|
| 131 |
</script>
|
| 132 |
</body>
|
| 133 |
</html>
|