diff --git a/templates/admin/request.html b/templates/admin/request.html index 0b5d495..e19c8fb 100644 --- a/templates/admin/request.html +++ b/templates/admin/request.html @@ -53,12 +53,18 @@ pre{background:#111827;padding:.8rem;border-radius:.5rem;overflow:auto;white-spa

1. Generate Suno Prompt

-

Paste the result from Hermes into the box below, then click Apply to fill Style and Lyrics.

- - +

Paste the Style block and Lyrics block from Hermes into the boxes below, then click Apply.

+ + + + + + +
- +
+
@@ -121,31 +127,24 @@ function copyPromptForHermes() { style_genre: {{ req.style_genre | tojson }}, extra_requests: {{ req.extra_requests | tojson }} }; - const text = "Please write a Suno Custom Mode prompt for this customer. Return ONLY a JSON object with keys: title, style, lyrics.\n\nCustomer data:\n" + JSON.stringify(data, null, 2); - navigator.clipboard.writeText(text).then(() => alert("Copied! Paste into Hermes, then paste Hermes JSON result into the box above and click Apply.")); + const text = `Please write a Suno Custom Mode prompt for this customer.\n\nCustomer data:\nName: ${data.name}\nHobbies: ${data.hobbies || '-'}\nNotable facts: ${data.notable_facts || '-'}\nStyle / genre: ${data.style_genre || '-'}\nExtra requests: ${data.extra_requests || '-'}\n\nReply with exactly this format (no JSON):\n\nStyle:\n[the style description here]\n\nLyrics:\n[the lyrics here, with metatags]`; + navigator.clipboard.writeText(text).then(() => alert("Copied! Paste Hermes response into the Style and Lyrics boxes, then click Apply.")); } -function applyHermesJson() { - const raw = document.getElementById('hermes_json').value.trim(); - if (!raw) { - alert("Paste Hermes JSON first."); +function applyPastedBlocks() { + const styleBlock = document.getElementById('pasted_style').value.trim(); + const lyricsBlock = document.getElementById('pasted_lyrics').value.trim(); + if (!styleBlock && !lyricsBlock) { + alert("Paste Style and/or Lyrics first."); return; } - try { - const parsed = JSON.parse(raw); - if (parsed.style) { - document.getElementById('suno_style').value = parsed.style; - } - if (parsed.lyrics) { - document.getElementById('suno_lyrics').value = parsed.lyrics; - } - const msg = []; - if (parsed.title) msg.push('Title: ' + parsed.title); - msg.push('Style and lyrics applied.'); - alert(msg.join('\n')); - } catch (e) { - alert("Invalid JSON: " + e.message); + if (styleBlock) { + document.getElementById('suno_style').value = styleBlock; } + if (lyricsBlock) { + document.getElementById('suno_lyrics').value = lyricsBlock; + } + alert("Style and lyrics applied."); }