feat: Payload-Preview im Chat-Menü + Reminder von hinten gezählt
- Neuer Endpoint GET /api/sessions/{id}/payload-preview
Gibt den exakten Anthropic-API-Payload als JSON zurück (read-only)
- Chat-Menü: 'Payload anzeigen' öffnet Modal mit formatiertem JSON
- Reminder-Logik umgebaut: halbes Intervall (15) vor Ende,
dann volle Intervalle (30) rückwärts statt von vorne gezählt
- CSS: Payload-Modal Styling, kleine Variable-Fixes
This commit is contained in:
1 parent
229e6d9e53
commit
49ef6bedc6
7 files changed
+154
-21
No files matched your search
@@ -111,6 +111,11 @@ function apiGetSystemPromptBlocks(sessionId, planMode) {
|
||||
return _get(url);
|
||||
}
|
||||
|
||||
function apiGetPayloadPreview(sessionId, planMode) {
|
||||
var url = '/api/sessions/' + sessionId + '/payload-preview' + (planMode ? '?planMode=true' : '');
|
||||
return _get(url);
|
||||
}
|
||||
|
||||
function apiIsStreaming(sessionId) { return _get('/api/sessions/' + sessionId + '/streaming'); }
|
||||
function apiGitStatus(sessionId) { return _get('/api/sessions/' + sessionId + '/git-status', null); }
|
||||
|
||||
|
||||
@@ -76,6 +76,26 @@ async function showSystemPromptModal(sessionId) {
|
||||
}
|
||||
}
|
||||
|
||||
// ── Payload Preview Modal ──
|
||||
|
||||
async function showPayloadPreviewModal(sessionId) {
|
||||
const { body } = _createModal('Payload Preview', { modal: 'payload-preview-modal' });
|
||||
body.innerHTML = '<div class="sp-loading">Laden...</div>';
|
||||
|
||||
try {
|
||||
var planMode = typeof _planModeActive !== 'undefined' && _planModeActive;
|
||||
var payload = await apiGetPayloadPreview(sessionId, planMode);
|
||||
body.innerHTML = '';
|
||||
|
||||
var pre = document.createElement('pre');
|
||||
pre.className = 'payload-json';
|
||||
pre.textContent = JSON.stringify(payload, null, 2);
|
||||
body.appendChild(pre);
|
||||
} catch (e) {
|
||||
body.innerHTML = '<div class="sp-loading text-danger">Fehler beim Laden des Payloads</div>';
|
||||
}
|
||||
}
|
||||
|
||||
// ── Command Output Modal ──
|
||||
|
||||
function showCommandOutputModal(name, command, result) {
|
||||
|
||||
@@ -416,6 +416,13 @@ registerPage('chat', {
|
||||
showSystemPromptModal(sessionId);
|
||||
});
|
||||
|
||||
// Payload anzeigen
|
||||
const payloadPreviewBtn = document.getElementById('payloadPreviewBtn');
|
||||
if (payloadPreviewBtn) payloadPreviewBtn.addEventListener('click', () => {
|
||||
if (chatMenuDropdown) chatMenuDropdown.hidden = true;
|
||||
showPayloadPreviewModal(sessionId);
|
||||
});
|
||||
|
||||
// Archivieren
|
||||
const archiveBtn = document.getElementById('archiveBtn');
|
||||
if (archiveBtn) archiveBtn.addEventListener('click', () => {
|
||||
|
||||
Reference in new issue
Block a user