Spaces:
Runtime error
Runtime error
DJAKOUA KWANKAM BRAYAN STEVE commited on
Commit ·
798895b
1
Parent(s): 3febd9b
style(chat-app): add settings back button, premium dropdown select arrows, browser mockup for preview, update free CPU models list, and refine discussion list cards
Browse files- cypher-chat-app/public/index.html +20 -8
- cypher-chat-app/public/style.css +123 -0
- cypher-chat-app/server.js +3 -3
cypher-chat-app/public/index.html
CHANGED
|
@@ -259,7 +259,17 @@
|
|
| 259 |
|
| 260 |
<!-- Preview View (iframe sandbox) -->
|
| 261 |
<div class="artifact-content-area artifact-preview-area" id="artifactPreviewView" style="display: none;">
|
| 262 |
-
<
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 263 |
</div>
|
| 264 |
|
| 265 |
<!-- Mermaid View -->
|
|
@@ -286,10 +296,12 @@
|
|
| 286 |
<div class="modal-overlay" id="settingsModal">
|
| 287 |
<div class="modal-content settings-panel">
|
| 288 |
<div class="modal-header">
|
| 289 |
-
<
|
| 290 |
-
|
| 291 |
-
|
| 292 |
-
|
|
|
|
|
|
|
| 293 |
</div>
|
| 294 |
|
| 295 |
<!-- Settings Tabs -->
|
|
@@ -334,9 +346,9 @@
|
|
| 334 |
<label for="modelSelect">Modèle d'IA</label>
|
| 335 |
<select id="modelSelect">
|
| 336 |
<option value="Qwen/Qwen2.5-Coder-7B-Instruct">Qwen 2.5 Coder 7B (Par défaut)</option>
|
| 337 |
-
<option value="
|
| 338 |
-
<option value="
|
| 339 |
-
<option value="
|
| 340 |
</select>
|
| 341 |
<span class="help-text">Le modèle utilisé pour générer les réponses.</span>
|
| 342 |
</div>
|
|
|
|
| 259 |
|
| 260 |
<!-- Preview View (iframe sandbox) -->
|
| 261 |
<div class="artifact-content-area artifact-preview-area" id="artifactPreviewView" style="display: none;">
|
| 262 |
+
<div class="browser-mockup">
|
| 263 |
+
<div class="browser-address-bar">
|
| 264 |
+
<div class="browser-dots">
|
| 265 |
+
<span class="browser-dot red"></span>
|
| 266 |
+
<span class="browser-dot yellow"></span>
|
| 267 |
+
<span class="browser-dot green"></span>
|
| 268 |
+
</div>
|
| 269 |
+
<div class="browser-url" id="browserUrl">localhost:3000/preview.html</div>
|
| 270 |
+
</div>
|
| 271 |
+
<iframe id="artifactPreviewFrame" sandbox="allow-scripts" class="artifact-iframe"></iframe>
|
| 272 |
+
</div>
|
| 273 |
</div>
|
| 274 |
|
| 275 |
<!-- Mermaid View -->
|
|
|
|
| 296 |
<div class="modal-overlay" id="settingsModal">
|
| 297 |
<div class="modal-content settings-panel">
|
| 298 |
<div class="modal-header">
|
| 299 |
+
<div style="display: flex; align-items: center; gap: 12px;">
|
| 300 |
+
<button class="close-modal-btn" id="closeModalBtn" title="Retour" style="background: none; border: none; color: var(--text-secondary); cursor: pointer; display: flex; align-items: center; justify-content: center;">
|
| 301 |
+
<i data-lucide="arrow-left" size="18"></i>
|
| 302 |
+
</button>
|
| 303 |
+
<h3 style="margin: 0; font-size: 18px; font-weight: 700;">Réglages</h3>
|
| 304 |
+
</div>
|
| 305 |
</div>
|
| 306 |
|
| 307 |
<!-- Settings Tabs -->
|
|
|
|
| 346 |
<label for="modelSelect">Modèle d'IA</label>
|
| 347 |
<select id="modelSelect">
|
| 348 |
<option value="Qwen/Qwen2.5-Coder-7B-Instruct">Qwen 2.5 Coder 7B (Par défaut)</option>
|
| 349 |
+
<option value="meta-llama/Llama-3.2-3B-Instruct">Llama 3.2 3B (Gratuit CPU)</option>
|
| 350 |
+
<option value="mistralai/Mistral-7B-Instruct-v0.3">Mistral 7B (Gratuit CPU)</option>
|
| 351 |
+
<option value="microsoft/Phi-3-mini-4k-instruct">Phi-3 Mini 4K (Gratuit CPU)</option>
|
| 352 |
</select>
|
| 353 |
<span class="help-text">Le modèle utilisé pour générer les réponses.</span>
|
| 354 |
</div>
|
cypher-chat-app/public/style.css
CHANGED
|
@@ -2739,4 +2739,127 @@ pre.line-numbers > code {
|
|
| 2739 |
}
|
| 2740 |
}
|
| 2741 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2742 |
|
|
|
|
| 2739 |
}
|
| 2740 |
}
|
| 2741 |
|
| 2742 |
+
/* --- Premium Selection Dropdown Arrows --- */
|
| 2743 |
+
.form-group select {
|
| 2744 |
+
appearance: none !important;
|
| 2745 |
+
-webkit-appearance: none !important;
|
| 2746 |
+
-moz-appearance: none !important;
|
| 2747 |
+
background-image: url("data:image/svg+xml;utf8,<svg fill='%2300E5FF' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/><path d='M0 0h24v24H0z' fill='none'/></svg>") !important;
|
| 2748 |
+
background-repeat: no-repeat !important;
|
| 2749 |
+
background-position: right 12px center !important;
|
| 2750 |
+
padding-right: 40px !important;
|
| 2751 |
+
}
|
| 2752 |
+
.light-theme .form-group select {
|
| 2753 |
+
background-image: url("data:image/svg+xml;utf8,<svg fill='%230284C7' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/><path d='M0 0h24v24H0z' fill='none'/></svg>") !important;
|
| 2754 |
+
}
|
| 2755 |
+
|
| 2756 |
+
/* --- Beautiful Preview Browser Mockup --- */
|
| 2757 |
+
.browser-mockup {
|
| 2758 |
+
display: flex;
|
| 2759 |
+
flex-direction: column;
|
| 2760 |
+
flex: 1;
|
| 2761 |
+
height: 100%;
|
| 2762 |
+
background: #FFFFFF;
|
| 2763 |
+
border-radius: 8px;
|
| 2764 |
+
overflow: hidden;
|
| 2765 |
+
margin: 16px;
|
| 2766 |
+
border: 1px solid var(--border-color);
|
| 2767 |
+
box-shadow: var(--shadow-app);
|
| 2768 |
+
}
|
| 2769 |
+
.browser-address-bar {
|
| 2770 |
+
display: flex;
|
| 2771 |
+
align-items: center;
|
| 2772 |
+
background: rgba(30, 34, 53, 0.4);
|
| 2773 |
+
border-bottom: 1px solid var(--border-color);
|
| 2774 |
+
padding: 8px 16px;
|
| 2775 |
+
gap: 12px;
|
| 2776 |
+
user-select: none;
|
| 2777 |
+
}
|
| 2778 |
+
.browser-dots {
|
| 2779 |
+
display: flex;
|
| 2780 |
+
gap: 6px;
|
| 2781 |
+
}
|
| 2782 |
+
.browser-dot {
|
| 2783 |
+
width: 10px;
|
| 2784 |
+
height: 10px;
|
| 2785 |
+
border-radius: 50%;
|
| 2786 |
+
}
|
| 2787 |
+
.browser-dot.red { background-color: #EF4444; }
|
| 2788 |
+
.browser-dot.yellow { background-color: #F59E0B; }
|
| 2789 |
+
.browser-dot.green { background-color: #10B981; }
|
| 2790 |
+
.browser-url {
|
| 2791 |
+
background: rgba(8, 10, 18, 0.4);
|
| 2792 |
+
border: 1px solid var(--border-color);
|
| 2793 |
+
border-radius: 6px;
|
| 2794 |
+
padding: 2px 12px;
|
| 2795 |
+
font-size: 11px;
|
| 2796 |
+
color: var(--text-secondary);
|
| 2797 |
+
font-family: 'JetBrains Mono', monospace;
|
| 2798 |
+
flex: 1;
|
| 2799 |
+
max-width: 300px;
|
| 2800 |
+
text-align: center;
|
| 2801 |
+
white-space: nowrap;
|
| 2802 |
+
overflow: hidden;
|
| 2803 |
+
text-overflow: ellipsis;
|
| 2804 |
+
}
|
| 2805 |
+
.light-theme .browser-address-bar {
|
| 2806 |
+
background: rgba(226, 232, 240, 0.6);
|
| 2807 |
+
}
|
| 2808 |
+
.light-theme .browser-url {
|
| 2809 |
+
background: #FFFFFF;
|
| 2810 |
+
}
|
| 2811 |
+
|
| 2812 |
+
/* --- Premium Chat History List --- */
|
| 2813 |
+
.chat-history-list {
|
| 2814 |
+
padding: 0 12px 20px;
|
| 2815 |
+
}
|
| 2816 |
+
.sidebar-group-label {
|
| 2817 |
+
font-size: 10.5px !important;
|
| 2818 |
+
color: var(--accent-cyan) !important;
|
| 2819 |
+
font-weight: 700 !important;
|
| 2820 |
+
text-transform: uppercase !important;
|
| 2821 |
+
letter-spacing: 0.8px !important;
|
| 2822 |
+
margin: 20px 8px 8px !important;
|
| 2823 |
+
opacity: 0.85 !important;
|
| 2824 |
+
display: flex !important;
|
| 2825 |
+
align-items: center !important;
|
| 2826 |
+
gap: 8px !important;
|
| 2827 |
+
user-select: none;
|
| 2828 |
+
}
|
| 2829 |
+
.sidebar-group-label::after {
|
| 2830 |
+
content: "";
|
| 2831 |
+
flex: 1;
|
| 2832 |
+
height: 1px;
|
| 2833 |
+
background: rgba(30, 34, 53, 0.4);
|
| 2834 |
+
}
|
| 2835 |
+
.light-theme .sidebar-group-label::after {
|
| 2836 |
+
background: rgba(203, 213, 225, 0.6);
|
| 2837 |
+
}
|
| 2838 |
+
.chat-history-item {
|
| 2839 |
+
position: relative;
|
| 2840 |
+
border-left: 3px solid transparent !important;
|
| 2841 |
+
transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
|
| 2842 |
+
}
|
| 2843 |
+
.chat-history-item:hover {
|
| 2844 |
+
background: rgba(30, 34, 53, 0.3) !important;
|
| 2845 |
+
border-color: rgba(255, 255, 255, 0.03) !important;
|
| 2846 |
+
color: var(--text-primary) !important;
|
| 2847 |
+
}
|
| 2848 |
+
.chat-history-item.active {
|
| 2849 |
+
background: rgba(0, 229, 255, 0.05) !important;
|
| 2850 |
+
border: 1px solid rgba(0, 229, 255, 0.15) !important;
|
| 2851 |
+
border-left: 3px solid var(--accent-cyan) !important;
|
| 2852 |
+
color: var(--text-primary) !important;
|
| 2853 |
+
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
|
| 2854 |
+
}
|
| 2855 |
+
.light-theme .chat-history-item:hover {
|
| 2856 |
+
background: rgba(203, 213, 225, 0.3) !important;
|
| 2857 |
+
}
|
| 2858 |
+
.light-theme .chat-history-item.active {
|
| 2859 |
+
background: rgba(2, 132, 199, 0.05) !important;
|
| 2860 |
+
border: 1px solid rgba(2, 132, 199, 0.15) !important;
|
| 2861 |
+
border-left: 3px solid var(--accent-cyan) !important;
|
| 2862 |
+
box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
|
| 2863 |
+
}
|
| 2864 |
+
|
| 2865 |
|
cypher-chat-app/server.js
CHANGED
|
@@ -330,9 +330,9 @@ app.post("/api/chat", async (req, res) => {
|
|
| 330 |
app.get("/api/models", (req, res) => {
|
| 331 |
res.json([
|
| 332 |
{ id: "Qwen/Qwen2.5-Coder-7B-Instruct", name: "Qwen 2.5 Coder 7B (Par défaut)" },
|
| 333 |
-
{ id: "
|
| 334 |
-
{ id: "
|
| 335 |
-
{ id: "
|
| 336 |
]);
|
| 337 |
});
|
| 338 |
|
|
|
|
| 330 |
app.get("/api/models", (req, res) => {
|
| 331 |
res.json([
|
| 332 |
{ id: "Qwen/Qwen2.5-Coder-7B-Instruct", name: "Qwen 2.5 Coder 7B (Par défaut)" },
|
| 333 |
+
{ id: "meta-llama/Llama-3.2-3B-Instruct", name: "Llama 3.2 3B (Gratuit CPU)" },
|
| 334 |
+
{ id: "mistralai/Mistral-7B-Instruct-v0.3", name: "Mistral 7B (Gratuit CPU)" },
|
| 335 |
+
{ id: "microsoft/Phi-3-mini-4k-instruct", name: "Phi-3 Mini 4K (Gratuit CPU)" }
|
| 336 |
]);
|
| 337 |
});
|
| 338 |
|