feat: batch import/export for prompts (Issue #28 Debug B)
Dev→Prod Sync in 2 Klicks: Export → Import Backend: - GET /api/prompts/export-all → JSON mit allen Prompts - POST /api/prompts/import?overwrite=true/false → Import + Create/Update - Returns: created, updated, skipped counts - Validates JSON structure - Handles stages JSON conversion Frontend AdminPromptsPage: - Button "📦 Alle exportieren" → downloads all-prompts-{date}.json - Button "📥 Importieren" → file upload dialog - User-Prompt: Überschreiben? Ja/Nein - Success-Message mit Statistik (created/updated/skipped) Frontend api.js: - exportAllPrompts() - importPrompts(data, overwrite) Use Cases: 1. Backup: Prompts als JSON sichern 2. Dev→Prod: Auf dev.mitai entwickeln → exportieren → auf mitai.jinkendo importieren 3. Versionierung: Prompts in Git speichern Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
8b287ca6c9
commit
7f94a41965
3 files changed
+235
-6
No files matched your search
@@ -318,4 +318,12 @@ export const api = {
|
||||
},
|
||||
createUnifiedPrompt: (d) => req('/prompts/unified', json(d)),
|
||||
updateUnifiedPrompt: (id,d) => req(`/prompts/unified/${id}`, jput(d)),
|
||||
|
||||
// Batch Import/Export
|
||||
exportAllPrompts: () => req('/prompts/export-all'),
|
||||
importPrompts: (data, overwrite=false) => {
|
||||
const params = new URLSearchParams()
|
||||
if (overwrite) params.append('overwrite', 'true')
|
||||
return req(`/prompts/import?${params}`, json(data))
|
||||
},
|
||||
}
|
||||
Reference in new issue
Block a user