- Embeddable vanilla-JS chat widget (one script tag + tenant public key):
WebSocket, resumable sessions (24h localStorage token), honeypot + per-IP
and per-message rate limits, Bosnian UI (§7)
- Session auth (bcrypt + signed cookies), owner accounts + super-admins,
admin impersonation ('otvori kao salon', §11)
- Owner dashboard (§10, Bosnian): requests with same actions as email,
call/chat history with transcripts, usage bar; settings for profile,
working hours (manual + LLM paste-to-parse), services CRUD + 'Zalijepi
cjenovnik' LLM import with review step, scheduling (Google OAuth free/busy
read-only + calendar mappings + buffers, partner status), telephony
(forwarding MMI codes per operator, ring group, worker SIP creds + QR),
agent voice/price-mode/notes + widget snippet, notifications/SMS templates
- Super-admin panel (§11): tenant CRUD incl. plan/minutes/paid-until,
partner API config (encrypted secrets), number/SIM registry + assignment,
connectivity test (live availability + dry-run push), versioned prompt
template editor with publish/rollback, playground, usage overview, health
- Fixes: WAL + busy_timeout for sqlite tests, no awaits in WS disconnect
path (deadlock), template publish autoflush bug
- 76 tests green (incl. widget WS e2e booking flow); dashboard, widget and
admin verified live in a browser against Postgres
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
47 lines
1.9 KiB
HTML
47 lines
1.9 KiB
HTML
{% extends "base.html" %}
|
|
{% block title %}Prompt šablon — Gogo Admin{% endblock %}
|
|
{% block nav %}{% include "admin/_nav.html" %}{% endblock %}
|
|
{% block content %}
|
|
<h1>Globalni prompt šablon (§6.3)</h1>
|
|
<p class="muted">Šablon vrijedi za sve salone odjednom. Dostupne oznake:
|
|
<code>{salon_profile}</code> <code>{working_hours}</code> <code>{services_table}</code>
|
|
<code>{notes}</code> <code>{price_mode}</code> <code>{greeting}</code>
|
|
<code>{current_datetime}</code></p>
|
|
|
|
<div class="card">
|
|
<h2>Nova verzija</h2>
|
|
<form method="post" action="/admin/templates">
|
|
<textarea name="body" style="min-height:340px;font-family:monospace">{{ draft_body }}</textarea>
|
|
<label>Bilješka o izmjeni</label>
|
|
<input type="text" name="notes" placeholder="npr. dodano pravilo o kućnim posjetama">
|
|
<label><input type="checkbox" name="publish" checked style="width:auto"> Objavi odmah (postaje aktivna verzija)</label>
|
|
<button style="margin-top:12px">Sačuvaj verziju</button>
|
|
</form>
|
|
</div>
|
|
|
|
<div class="card">
|
|
<h2>Verzije</h2>
|
|
<table>
|
|
<tr><th>Verzija</th><th>Datum</th><th>Bilješka</th><th>Status</th><th></th></tr>
|
|
{% for v in versions %}
|
|
<tr>
|
|
<td>v{{ v.version }}</td>
|
|
<td class="muted">{{ v.created_at.strftime('%d.%m.%Y. %H:%M') }}</td>
|
|
<td>{{ v.notes }}</td>
|
|
<td>{% if v.published %}<span class="badge confirmed">aktivna</span>{% endif %}</td>
|
|
<td style="white-space:nowrap">
|
|
<a class="btn small ghost" href="/admin/templates?load={{ v.version }}">Učitaj u editor</a>
|
|
{% if not v.published %}
|
|
<form method="post" action="/admin/templates/{{ v.version }}/publish" style="display:inline">
|
|
<button class="small green">Objavi (rollback)</button>
|
|
</form>
|
|
{% endif %}
|
|
</td>
|
|
</tr>
|
|
{% else %}
|
|
<tr><td colspan="5" class="muted">Nema sačuvanih verzija — koristi se ugrađeni zadani šablon.</td></tr>
|
|
{% endfor %}
|
|
</table>
|
|
</div>
|
|
{% endblock %}
|