Add Cancelled status and cancel request button

This commit is contained in:
Troll (Hermes Agent) 2026-08-04 17:56:02 +00:00
parent fd58cf47da
commit 968a6fb43c
2 changed files with 20 additions and 1 deletions

6
app.py
View file

@ -87,6 +87,7 @@ STATUS_LABELS = {
'awaiting_payment': 'Awaiting Payment', 'awaiting_payment': 'Awaiting Payment',
'paid': 'Paid', 'paid': 'Paid',
'delivered': 'Delivered', 'delivered': 'Delivered',
'cancelled': 'Cancelled',
} }
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
@ -990,6 +991,11 @@ def admin_request(rid):
flash('Stems share link saved.', 'success') flash('Stems share link saved.', 'success')
return redirect(url_for('admin_request', rid=rid)) return redirect(url_for('admin_request', rid=rid))
elif action == 'cancel_request':
update_request(rid, status='cancelled')
flash('Request marked as cancelled.', 'success')
return redirect(url_for('admin_request', rid=rid))
elif action == 'save_prompt': elif action == 'save_prompt':
# Store the generated title/style/lyrics and mark prompt ready. # Store the generated title/style/lyrics and mark prompt ready.
update_request(rid, update_request(rid,

View file

@ -369,6 +369,19 @@
</form> </form>
</div> </div>
<!-- Request Actions -->
<div class="section">
<h2>Request Actions</h2>
{% if req.status != 'cancelled' %}
<form method="POST" onsubmit="return confirm('Mark request #{{ req.id }} as cancelled?')">
<input type="hidden" name="action" value="cancel_request">
<button type="submit" class="danger">Mark as Cancelled</button>
</form>
{% else %}
<p class="copy-hint">This request is cancelled.</p>
{% endif %}
</div>
<!-- Revision History --> <!-- Revision History -->
<div class="section"> <div class="section">
<h2>Revision History</h2> <h2>Revision History</h2>
@ -407,7 +420,7 @@
vocal_gender: {{ req.vocal_gender | tojson }}, vocal_gender: {{ req.vocal_gender | tojson }},
extra_requests: {{ req.extra_requests | tojson }} extra_requests: {{ req.extra_requests | tojson }}
}; };
const text = `Booth request: ${data.request_id}\nCustomer email: ${data.email}\nCallback URL: ${callbackUrl}\n\nGenerate a Suno Custom Mode prompt for this customer and POST it back to the Callback URL as JSON.\n\nCustomer data:\nName: ${data.name}\nHobbies: ${data.hobbies || '-'}\nNotable facts: ${data.notable_facts || '-'}\nStyle / genre: ${data.style_genre || '-'}\nPreferred singer voice / gender: ${data.vocal_gender || 'No preference'}\nExtra requests: ${data.extra_requests || '-'}\n\nExpected JSON response format:\n{\n \"request_id\": ${data.request_id},\n \"email\": \"${data.email}\",\n \"suno_title\": \"...\",\n \"suno_style\": \"...\",\n \"suno_lyrics\": \"...\"\n}`; const text = `Booth request: ${data.request_id}\\nCustomer email: ${data.email}\\nCallback URL: ${callbackUrl}\\n\\nGenerate a Suno Custom Mode prompt for this customer and POST it back to the Callback URL as JSON.\\n\\nCustomer data:\\nName: ${data.name}\\nHobbies: ${data.hobbies || '-'}\\nNotable facts: ${data.notable_facts || '-'}\\nStyle / genre: ${data.style_genre || '-'}\\nPreferred singer voice / gender: ${data.vocal_gender || 'No preference'}\\nExtra requests: ${data.extra_requests || '-'}\\n\\nExpected JSON response format:\\n{\\n \\"request_id\\": ${data.request_id},\\n \\"email\\": \\"${data.email}\\",\\n \\"suno_title\\": \\"...\\",\\n \\"suno_style\\": \\"...\\",\\n \\"suno_lyrics\\": \\"...\\"\\n}`;
navigator.clipboard.writeText(text).then(() => alert("Copied! Paste into Hermes. Hermes will POST the generated prompt back to the Callback URL.")); navigator.clipboard.writeText(text).then(() => alert("Copied! Paste into Hermes. Hermes will POST the generated prompt back to the Callback URL."));
} }