Martechsol commited on
Commit ·
ec36498
1
Parent(s): 6da6999
Deploy RAG Chatbot to Hugging Face Spaces
Browse files- NEW_FEATURES.md +39 -0
- app/admin/templates/admin.html +0 -12
- static/addon.html +2 -2
- static/chat-loader.js +1 -1
- static/chat-loader2.js +1 -1
NEW_FEATURES.md
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# New Features in the Admin Panel (LiveChat-Inspired Redesign)
|
| 2 |
+
|
| 3 |
+
We have completely overhauled the Admin Panel, transforming it from a basic data table into a professional, classic, and highly functional dashboard reminiscent of industry-standard tools like LiveChat.
|
| 4 |
+
|
| 5 |
+
Here is a comprehensive breakdown of the **7 new major features** added:
|
| 6 |
+
|
| 7 |
+
### 1. Professional White & Purple Interface (Classic Design)
|
| 8 |
+
- Replaced the dark "AI theme" with a crisp, classic light theme.
|
| 9 |
+
- Integrated soft purple gradients (`#8b5cf6` to `#a855f7`) that feel premium and trustworthy.
|
| 10 |
+
- Re-architected the interface using a modern 2-pane structure (Sidebar Navigation + Main Content Area).
|
| 11 |
+
- Implemented smooth micro-animations (e.g., hover states, subtle fade-ins) to dramatically increase user interaction and responsiveness without feeling gimmicky.
|
| 12 |
+
|
| 13 |
+
### 2. Analytics Dashboard & Real-Time Statistics
|
| 14 |
+
- **High-Level Metrics:** Instantly view "Total Sessions", "Today's Sessions", and "Total Messages" across all chats at a glance on the new Dashboard view.
|
| 15 |
+
- **Backend API Integration:** Built a brand new API endpoint (`/api/admin/analytics`) that aggregates this data safely from all session files without blocking the server.
|
| 16 |
+
|
| 17 |
+
### 3. Interactive Traffic Chart (Chart.js)
|
| 18 |
+
- Integrated an interactive line chart on the Dashboard.
|
| 19 |
+
- Visualizes message volume trends over the past 7 days.
|
| 20 |
+
- Features custom tooltips, smooth data lines, and gradient fills to match the new brand aesthetic.
|
| 21 |
+
|
| 22 |
+
### 4. Auto-Refresh Capability
|
| 23 |
+
- Added an **"Auto-refresh" toggle** switch in the top navigation bar.
|
| 24 |
+
- When enabled, it acts as a "live monitoring" system, automatically pulling the latest stats and new sessions every 15 seconds.
|
| 25 |
+
- Allows admins to keep the panel open on a secondary monitor to watch traffic come in real-time.
|
| 26 |
+
|
| 27 |
+
### 5. Enhanced Chat Transcript Viewer
|
| 28 |
+
- Upgraded the chat history viewer to look like a modern messaging app.
|
| 29 |
+
- User messages are aligned to the right in clean white bubbles; AI agent messages are aligned to the left in purple gradient bubbles.
|
| 30 |
+
- Improved message metadata visibility (timestamps and user identification).
|
| 31 |
+
|
| 32 |
+
### 6. Centralized Export Modal
|
| 33 |
+
- Consolidated the export functionality into a sleek, dark-backdrop modal window.
|
| 34 |
+
- Added options to export "All Sessions Combined" into one file, or "Separate Files (ZIP)" which bundles every individual session into a downloadable ZIP archive.
|
| 35 |
+
- Retained the ability to export in both Excel (`.xlsx`) and `.json` formats.
|
| 36 |
+
|
| 37 |
+
### 7. Streamlined Quick Links (Demo Widget)
|
| 38 |
+
- Added a dedicated "Quick Links" section to the navigation sidebar.
|
| 39 |
+
- Features a direct link to test the live **Chat Widget Demo**, allowing admins to quickly jump to the frontend bot and simulate user interactions.
|
app/admin/templates/admin.html
CHANGED
|
@@ -379,22 +379,10 @@
|
|
| 379 |
</div>
|
| 380 |
|
| 381 |
<div class="nav-section-title">Quick Links</div>
|
| 382 |
-
<a href="/ui" target="_blank" class="quick-link">
|
| 383 |
-
Main Chat UI (Gradio)
|
| 384 |
-
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"></path><polyline points="15 3 21 3 21 9"></polyline><line x1="10" y1="14" x2="21" y2="3"></line></svg>
|
| 385 |
-
</a>
|
| 386 |
<a href="/widget" target="_blank" class="quick-link">
|
| 387 |
Chat Widget Demo
|
| 388 |
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"></path><polyline points="15 3 21 3 21 9"></polyline><line x1="10" y1="14" x2="21" y2="3"></line></svg>
|
| 389 |
</a>
|
| 390 |
-
<a href="/static/chat-loader.js" target="_blank" class="quick-link">
|
| 391 |
-
chat-loader.js
|
| 392 |
-
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M13 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9z"></path><polyline points="13 2 13 9 20 9"></polyline></svg>
|
| 393 |
-
</a>
|
| 394 |
-
<a href="/static/chat-loader2.js" target="_blank" class="quick-link">
|
| 395 |
-
chat-loader2.js
|
| 396 |
-
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M13 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9z"></path><polyline points="13 2 13 9 20 9"></polyline></svg>
|
| 397 |
-
</a>
|
| 398 |
</nav>
|
| 399 |
|
| 400 |
<div class="sidebar-footer">
|
|
|
|
| 379 |
</div>
|
| 380 |
|
| 381 |
<div class="nav-section-title">Quick Links</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
| 382 |
<a href="/widget" target="_blank" class="quick-link">
|
| 383 |
Chat Widget Demo
|
| 384 |
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"></path><polyline points="15 3 21 3 21 9"></polyline><line x1="10" y1="14" x2="21" y2="3"></line></svg>
|
| 385 |
</a>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 386 |
</nav>
|
| 387 |
|
| 388 |
<div class="sidebar-footer">
|
static/addon.html
CHANGED
|
@@ -247,7 +247,7 @@
|
|
| 247 |
<!-- Animated Chatbot Icon -->
|
| 248 |
<div id="chat-icon" style="width: 233px; height: 238px; display: flex; align-items: center; justify-content: center; pointer-events: none;">
|
| 249 |
<dotlottie-player
|
| 250 |
-
src="https://joedown11-
|
| 251 |
background="transparent" speed="1" style="width: 100%; height: 100%; will-change: transform;" loop autoplay>
|
| 252 |
</dotlottie-player>
|
| 253 |
</div>
|
|
@@ -311,7 +311,7 @@
|
|
| 311 |
});
|
| 312 |
|
| 313 |
// Chat Logic
|
| 314 |
-
const API_URL = "https://joedown11-
|
| 315 |
const BASE_URL = API_URL.replace("/api/chat", "");
|
| 316 |
let chatHistory = [];
|
| 317 |
|
|
|
|
| 247 |
<!-- Animated Chatbot Icon -->
|
| 248 |
<div id="chat-icon" style="width: 233px; height: 238px; display: flex; align-items: center; justify-content: center; pointer-events: none;">
|
| 249 |
<dotlottie-player
|
| 250 |
+
src="https://joedown11-chatbot21.hf.space/static/bot-icon.lottie"
|
| 251 |
background="transparent" speed="1" style="width: 100%; height: 100%; will-change: transform;" loop autoplay>
|
| 252 |
</dotlottie-player>
|
| 253 |
</div>
|
|
|
|
| 311 |
});
|
| 312 |
|
| 313 |
// Chat Logic
|
| 314 |
+
const API_URL = "https://joedown11-chatbot21.hf.space/api/chat";
|
| 315 |
const BASE_URL = API_URL.replace("/api/chat", "");
|
| 316 |
let chatHistory = [];
|
| 317 |
|
static/chat-loader.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
|
| 2 |
(function () {
|
| 3 |
-
const baseUrl = 'https://joedown11-
|
| 4 |
|
| 5 |
|
| 6 |
const container = document.createElement('div');
|
|
|
|
| 1 |
|
| 2 |
(function () {
|
| 3 |
+
const baseUrl = 'https://joedown11-chatbot21.hf.space';
|
| 4 |
|
| 5 |
|
| 6 |
const container = document.createElement('div');
|
static/chat-loader2.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
|
| 2 |
(function () {
|
| 3 |
-
const baseUrl = 'https://joedown11-
|
| 4 |
|
| 5 |
function init() {
|
| 6 |
// Prevent duplicate containers
|
|
|
|
| 1 |
|
| 2 |
(function () {
|
| 3 |
+
const baseUrl = 'https://joedown11-chatbot21.hf.space';
|
| 4 |
|
| 5 |
function init() {
|
| 6 |
// Prevent duplicate containers
|