zhlajiex
commited on
Commit
·
b7e2ca7
1
Parent(s):
b15efb5
UI: Restore full settings menu with sliders and toggles
Browse files- backend/public/chat.html +71 -11
backend/public/chat.html
CHANGED
|
@@ -74,8 +74,28 @@
|
|
| 74 |
|
| 75 |
/* PREVIEW STYLING */
|
| 76 |
.preview-container { position: relative; width: 32px; height: 32px; flex-shrink: 0; }
|
| 77 |
-
.preview-img { width: 100%; height: 100%; border-radius: 8px; object-
|
| 78 |
-
.preview-remove { position: absolute;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 79 |
|
| 80 |
@keyframes node-up { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
|
| 81 |
|
|
@@ -147,7 +167,7 @@
|
|
| 147 |
</div>
|
| 148 |
</main>
|
| 149 |
|
| 150 |
-
<!-- SETTINGS MODAL -->
|
| 151 |
<div id="settings-modal" class="hidden fixed inset-0 z-[200] flex items-center justify-center p-4 backdrop-blur-3xl overflow-y-auto">
|
| 152 |
<div class="max-w-4xl w-full p-10 bg-zinc-950 border border-white/10 rounded-[3rem] space-y-10 shadow-[0_50px_150px_#000] my-auto">
|
| 153 |
<div class="flex justify-between items-center">
|
|
@@ -156,24 +176,54 @@
|
|
| 156 |
</div>
|
| 157 |
|
| 158 |
<div class="settings-grid">
|
|
|
|
| 159 |
<div class="setting-card">
|
| 160 |
<label class="setting-label">Active Neural Core</label>
|
| 161 |
<div class="select-group" id="model-group">
|
| 162 |
-
<button class="select-item" data-value="codex-thinking">Codex Thinking</button>
|
| 163 |
-
<button class="select-item" data-value="codex-code">Codex Code</button>
|
| 164 |
-
<button class="select-item" data-value="codex-
|
| 165 |
-
<button class="select-item" data-value="
|
|
|
|
| 166 |
</div>
|
| 167 |
</div>
|
|
|
|
|
|
|
| 168 |
<div class="setting-card">
|
| 169 |
<label class="setting-label">Reasoning Strategy</label>
|
| 170 |
<div class="select-group" id="cot-group">
|
| 171 |
-
<button class="select-item" data-value="none">Direct</button>
|
| 172 |
-
<button class="select-item" data-value="summary">Explain</button>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 173 |
</div>
|
| 174 |
</div>
|
| 175 |
</div>
|
| 176 |
-
|
|
|
|
| 177 |
</div>
|
| 178 |
</div>
|
| 179 |
|
|
@@ -228,6 +278,12 @@
|
|
| 228 |
const p = data.data.preferences || {};
|
| 229 |
setActive('model-group', p.preferredModel || 'codex-thinking');
|
| 230 |
setActive('cot-group', p.cotMode || 'none');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 231 |
document.getElementById('usage-count').innerText = `${String(data.data.usage.requestsToday).padStart(2, '0')}/75`;
|
| 232 |
if (data.data.isOwner) document.getElementById('owner-tag').classList.remove('hidden');
|
| 233 |
}
|
|
@@ -310,7 +366,7 @@
|
|
| 310 |
} finally {
|
| 311 |
isProcessing = false;
|
| 312 |
document.getElementById('send-btn').innerHTML = '<i class="fas fa-arrow-up text-sm"></i>';
|
| 313 |
-
}
|
| 314 |
}
|
| 315 |
|
| 316 |
function appendMessage(role, text, model = '', attachmentUrl = '') {
|
|
@@ -357,6 +413,10 @@
|
|
| 357 |
const config = {
|
| 358 |
preferredModel: document.querySelector('#model-group .active')?.dataset.value,
|
| 359 |
cotMode: document.querySelector('#cot-group .active')?.dataset.value,
|
|
|
|
|
|
|
|
|
|
|
|
|
| 360 |
};
|
| 361 |
await fetch(`${API_BASE}/api/users/preferences`, {
|
| 362 |
method: 'PUT', headers: { 'Content-Type': 'application/json', 'Authorization': `Bearer ${token}` },
|
|
|
|
| 74 |
|
| 75 |
/* PREVIEW STYLING */
|
| 76 |
.preview-container { position: relative; width: 32px; height: 32px; flex-shrink: 0; }
|
| 77 |
+
.preview-img { width: 100%; height: 100%; border-radius: 8px; object-fit: cover; border: 1px solid var(--border); }
|
| 78 |
+
.preview-remove { position: absolute; top: -5px; right: -5px; background: #ff4444; color: white; border-radius: 50%; width: 12px; height: 12px; font-size: 8px; display: flex; align-items: center; justify-content: center; cursor: pointer; border: 1px solid #000; }
|
| 79 |
+
|
| 80 |
+
/* SETTINGS GRID */
|
| 81 |
+
.settings-grid { display: grid; grid-template-cols: 1fr 1fr; gap: 1.2rem; }
|
| 82 |
+
@media (max-width: 600px) { .settings-grid { grid-template-cols: 1fr; } }
|
| 83 |
+
.setting-card { background: rgba(255,255,255,0.03); border: 1px solid var(--border); padding: 1.5rem; border-radius: 1.5rem; }
|
| 84 |
+
.setting-label { font-size: 8px; font-weight: 900; text-transform: uppercase; letter-spacing: 0.3em; color: #444; margin-bottom: 1rem; display: block; }
|
| 85 |
+
.select-group { display: flex; flex-direction: column; gap: 8px; }
|
| 86 |
+
.select-item { width: 100%; padding: 12px; background: rgba(0,0,0,0.4); border: 1px solid #111; border-radius: 10px; font-family: 'JetBrains Mono'; font-size: 10px; font-weight: 700; color: #555; text-align: left; transition: 0.2s; cursor: pointer; text-transform: uppercase; }
|
| 87 |
+
.select-item:hover { border-color: #333; color: #aaa; }
|
| 88 |
+
.select-item.active { background: #fff; color: #000; border-color: #fff; box-shadow: 0 5px 20px rgba(255,255,255,0.1); }
|
| 89 |
+
|
| 90 |
+
.switch-box { display: flex; align-items: center; justify-content: space-between; background: rgba(0,0,0,0.4); padding: 12px; border-radius: 10px; border: 1px solid #111; cursor: pointer; transition: 0.2s; }
|
| 91 |
+
.switch-box.active { border-color: #444; background: rgba(255,255,255,0.02); }
|
| 92 |
+
.switch-box span { font-family: 'JetBrains Mono'; font-size: 10px; font-weight: 700; color: #444; text-transform: uppercase; }
|
| 93 |
+
.switch-box.active span { color: #fff; }
|
| 94 |
+
.switch-indicator { width: 10px; height: 10px; border-radius: 50%; background: #222; }
|
| 95 |
+
.active .switch-indicator { background: #22c55e; box-shadow: 0 0 10px #22c55e; }
|
| 96 |
+
|
| 97 |
+
input[type="range"] { -webkit-appearance: none; background: #111; height: 4px; border-radius: 5px; width: 100%; }
|
| 98 |
+
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 15px; height: 15px; background: #fff; border-radius: 50%; cursor: pointer; box-shadow: 0 0 10px rgba(255,255,255,0.5); }
|
| 99 |
|
| 100 |
@keyframes node-up { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
|
| 101 |
|
|
|
|
| 167 |
</div>
|
| 168 |
</main>
|
| 169 |
|
| 170 |
+
<!-- SETTINGS MODAL FULL RESTORATION -->
|
| 171 |
<div id="settings-modal" class="hidden fixed inset-0 z-[200] flex items-center justify-center p-4 backdrop-blur-3xl overflow-y-auto">
|
| 172 |
<div class="max-w-4xl w-full p-10 bg-zinc-950 border border-white/10 rounded-[3rem] space-y-10 shadow-[0_50px_150px_#000] my-auto">
|
| 173 |
<div class="flex justify-between items-center">
|
|
|
|
| 176 |
</div>
|
| 177 |
|
| 178 |
<div class="settings-grid">
|
| 179 |
+
<!-- MODEL SELECTION -->
|
| 180 |
<div class="setting-card">
|
| 181 |
<label class="setting-label">Active Neural Core</label>
|
| 182 |
<div class="select-group" id="model-group">
|
| 183 |
+
<button class="select-item" data-value="codex-thinking">Codex Thinking (Titan)</button>
|
| 184 |
+
<button class="select-item" data-value="codex-code">Codex Code (Architect)</button>
|
| 185 |
+
<button class="select-item" data-value="codex-reasoning">Codex Reasoning (Deep)</button>
|
| 186 |
+
<button class="select-item" data-value="codex-v3-2">Codex V3.2 (DeepSeek)</button>
|
| 187 |
+
<button class="select-item" data-value="qwen3-coder">Qwen3 Coder (Elite)</button>
|
| 188 |
</div>
|
| 189 |
</div>
|
| 190 |
+
|
| 191 |
+
<!-- COT MODE -->
|
| 192 |
<div class="setting-card">
|
| 193 |
<label class="setting-label">Reasoning Strategy</label>
|
| 194 |
<div class="select-group" id="cot-group">
|
| 195 |
+
<button class="select-item" data-value="none">Direct Response</button>
|
| 196 |
+
<button class="select-item" data-value="summary">Explain Logic</button>
|
| 197 |
+
<button class="select-item" data-value="internal">Deep Trace</button>
|
| 198 |
+
</div>
|
| 199 |
+
</div>
|
| 200 |
+
|
| 201 |
+
<!-- SLIDERS -->
|
| 202 |
+
<div class="setting-card space-y-8">
|
| 203 |
+
<div>
|
| 204 |
+
<label class="setting-label">Reasoning Budget: <span id="budget-val" class="text-white">1024</span>t</label>
|
| 205 |
+
<input type="range" id="reasoning-budget" min="256" max="4096" step="256" value="1024" oninput="document.getElementById('budget-val').innerText = this.value">
|
| 206 |
+
</div>
|
| 207 |
+
<div>
|
| 208 |
+
<label class="setting-label">Cognitive Temp: <span id="temp-val" class="text-white">0.7</span></label>
|
| 209 |
+
<input type="range" id="temp-slider" min="0" max="1" step="0.1" value="0.7" oninput="document.getElementById('temp-val').innerText = this.value">
|
| 210 |
+
</div>
|
| 211 |
+
</div>
|
| 212 |
+
|
| 213 |
+
<!-- TOGGLES -->
|
| 214 |
+
<div class="setting-card space-y-4">
|
| 215 |
+
<div class="switch-box" id="critique-toggle" onclick="this.classList.toggle('active')">
|
| 216 |
+
<span>Self Critique Pass</span>
|
| 217 |
+
<div class="switch-indicator"></div>
|
| 218 |
+
</div>
|
| 219 |
+
<div class="switch-box" id="debug-toggle" onclick="this.classList.toggle('active')">
|
| 220 |
+
<span>Deep Debug Mode</span>
|
| 221 |
+
<div class="switch-indicator"></div>
|
| 222 |
</div>
|
| 223 |
</div>
|
| 224 |
</div>
|
| 225 |
+
|
| 226 |
+
<button onclick="saveSettings()" class="w-full py-6 bg-white text-black rounded-3xl font-black text-[10px] uppercase tracking-[0.4em] shadow-xl active:scale-95 transition">Apply Neural Protocols</button>
|
| 227 |
</div>
|
| 228 |
</div>
|
| 229 |
|
|
|
|
| 278 |
const p = data.data.preferences || {};
|
| 279 |
setActive('model-group', p.preferredModel || 'codex-thinking');
|
| 280 |
setActive('cot-group', p.cotMode || 'none');
|
| 281 |
+
if (p.selfCritique) document.getElementById('critique-toggle').classList.add('active');
|
| 282 |
+
if (p.debugMode) document.getElementById('debug-toggle').classList.add('active');
|
| 283 |
+
document.getElementById('reasoning-budget').value = p.reasoningBudget || 1024;
|
| 284 |
+
document.getElementById('budget-val').innerText = p.reasoningBudget || 1024;
|
| 285 |
+
document.getElementById('temp-slider').value = p.temperature || 0.7;
|
| 286 |
+
document.getElementById('temp-val').innerText = p.temperature || 0.7;
|
| 287 |
document.getElementById('usage-count').innerText = `${String(data.data.usage.requestsToday).padStart(2, '0')}/75`;
|
| 288 |
if (data.data.isOwner) document.getElementById('owner-tag').classList.remove('hidden');
|
| 289 |
}
|
|
|
|
| 366 |
} finally {
|
| 367 |
isProcessing = false;
|
| 368 |
document.getElementById('send-btn').innerHTML = '<i class="fas fa-arrow-up text-sm"></i>';
|
| 369 |
+
}
|
| 370 |
}
|
| 371 |
|
| 372 |
function appendMessage(role, text, model = '', attachmentUrl = '') {
|
|
|
|
| 413 |
const config = {
|
| 414 |
preferredModel: document.querySelector('#model-group .active')?.dataset.value,
|
| 415 |
cotMode: document.querySelector('#cot-group .active')?.dataset.value,
|
| 416 |
+
reasoningBudget: parseInt(document.getElementById('reasoning-budget').value),
|
| 417 |
+
temperature: parseFloat(document.getElementById('temp-slider').value),
|
| 418 |
+
selfCritique: document.getElementById('critique-toggle').classList.contains('active'),
|
| 419 |
+
debugMode: document.getElementById('debug-toggle').classList.contains('active')
|
| 420 |
};
|
| 421 |
await fetch(`${API_BASE}/api/users/preferences`, {
|
| 422 |
method: 'PUT', headers: { 'Content-Type': 'application/json', 'Authorization': `Bearer ${token}` },
|