feat: global placeholder export with values (Settings page)
Zentraler Export aller verfügbaren Platzhalter mit aktuellen Werten. Backend: - GET /api/prompts/placeholders/export-values - Returns all placeholders organized by category - Includes resolved values for current profile - Includes metadata (description, example) - Flat list + categorized structure Frontend SettingsPage: - Button "📊 Platzhalter exportieren" - Downloads: placeholders-{profile}-{date}.json - Shows all 38+ placeholders with current values - Useful for: - Understanding available data - Debugging prompt templates - Verifying placeholder resolution Frontend api.js: - exportPlaceholderValues() Export Format: { "export_date": "2026-03-26T...", "profile_id": "...", "count": 38, "all_placeholders": { "name": "Lars", ... }, "placeholders_by_category": { "Profil": [...], "Körper": [...], ... } } Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
7f94a41965
commit
555ff62b56
3 files changed
+78
No files matched your search
@@ -251,6 +251,23 @@ export default function SettingsPage() {
|
||||
setEditingId(null)
|
||||
}
|
||||
|
||||
const handleExportPlaceholders = async () => {
|
||||
try {
|
||||
const data = await api.exportPlaceholderValues()
|
||||
const blob = new Blob([JSON.stringify(data, null, 2)], { type: 'application/json' })
|
||||
const url = URL.createObjectURL(blob)
|
||||
const a = document.createElement('a')
|
||||
a.href = url
|
||||
a.download = `placeholders-${activeProfile?.name || 'profile'}-${new Date().toISOString().split('T')[0]}.json`
|
||||
document.body.appendChild(a)
|
||||
a.click()
|
||||
document.body.removeChild(a)
|
||||
URL.revokeObjectURL(url)
|
||||
} catch (e) {
|
||||
alert('Fehler beim Export: ' + e.message)
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<div>
|
||||
<h1 className="page-title">Einstellungen</h1>
|
||||
@@ -409,6 +426,16 @@ export default function SettingsPage() {
|
||||
<span className="badge-button-description">maschinenlesbar, alles in einer Datei</span>
|
||||
</div>
|
||||
</button>
|
||||
<button className="btn btn-full"
|
||||
onClick={handleExportPlaceholders}
|
||||
style={{ background: 'var(--surface2)', border: '1px solid var(--border)' }}>
|
||||
<div className="badge-button-layout">
|
||||
<div className="badge-button-header">
|
||||
<span><BarChart3 size={14}/> Platzhalter exportieren</span>
|
||||
</div>
|
||||
<span className="badge-button-description">alle verfügbaren Platzhalter mit aktuellen Werten</span>
|
||||
</div>
|
||||
</button>
|
||||
</>}
|
||||
</div>
|
||||
<p style={{fontSize:11,color:'var(--text3)',marginTop:8}}>
|
||||
|
||||
Reference in new issue
Block a user