- 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>
52 lines
2.2 KiB
HTML
52 lines
2.2 KiB
HTML
{% extends "base.html" %}
|
|
{% block title %}Playground — Gogo Admin{% endblock %}
|
|
{% block nav %}{% include "admin/_nav.html" %}{% endblock %}
|
|
{% block content %}
|
|
<h1>Test playground (§11)</h1>
|
|
<p class="muted">Tekstualni razgovor s asistentom pojedinog salona — koristi njegov sastavljeni
|
|
prompt, usluge i provajdera termina. Zahtjevi kreirani ovdje se <b>zaista</b> šalju (koristite
|
|
demo salon za igranje).</p>
|
|
|
|
<div class="card">
|
|
<form method="post" action="/admin/playground">
|
|
<label>Salon</label>
|
|
<select name="tenant_id" {{ 'disabled' if history_json != '[]' }}>
|
|
{% for tn in tenants %}
|
|
<option value="{{ tn.id }}" {{ 'selected' if selected_tenant and tn.id==selected_tenant.id }}>{{ tn.name }} ({{ tn.scheduling_provider }})</option>
|
|
{% endfor %}
|
|
</select>
|
|
{% if history_json != '[]' %}<input type="hidden" name="tenant_id" value="{{ selected_tenant.id }}">{% endif %}
|
|
<label>Kanal</label>
|
|
<select name="channel">
|
|
<option value="voice" {{ 'selected' if channel=='voice' }}>voice (telefon)</option>
|
|
<option value="chat" {{ 'selected' if channel=='chat' }}>chat</option>
|
|
</select>
|
|
|
|
{% if transcript %}
|
|
<div class="transcript" style="margin:16px 0">
|
|
{% for t in transcript %}
|
|
<div class="t {{ t.role }}">{{ t.text }}</div>
|
|
{% if t.tool_calls %}<div class="tools">⚙ {% for tc in t.tool_calls %}{{ tc.name }}({{ tc.input | tojson }}) {% endfor %}</div>{% endif %}
|
|
{% endfor %}
|
|
</div>
|
|
{% endif %}
|
|
|
|
<input type="hidden" name="history" value="{{ history_json | e }}">
|
|
<label>Poruka klijenta</label>
|
|
<input type="text" name="message" placeholder="npr. Htjela bih zakazati šišanje u srijedu" autofocus>
|
|
<div style="margin-top:12px">
|
|
<button>Pošalji</button>
|
|
<a class="btn ghost" href="/admin/playground">Novi razgovor</a>
|
|
</div>
|
|
</form>
|
|
{% if error %}<div class="msg error" style="margin-top:12px">{{ error }}</div>{% endif %}
|
|
</div>
|
|
|
|
{% if system_prompt %}
|
|
<details class="card">
|
|
<summary style="cursor:pointer;font-weight:600">Sastavljeni system prompt</summary>
|
|
<pre style="white-space:pre-wrap">{{ system_prompt }}</pre>
|
|
</details>
|
|
{% endif %}
|
|
{% endblock %}
|