M3: chat widget, owner dashboard, super-admin panel

- 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>
This commit is contained in:
2026-07-11 10:51:57 +02:00
parent 0d0838e6e2
commit 646917c322
46 changed files with 4402 additions and 8 deletions

View File

@@ -0,0 +1,43 @@
{% extends "base.html" %}
{% block title %}Salon — {{ owner.tenant.name }}{% endblock %}
{% block nav %}{% include "dashboard/_nav.html" %}{% endblock %}
{% block content %}
<h1>Profil salona</h1>
<form method="post" action="/dash/settings">
<div class="grid2">
<div class="card">
<h2>Osnovni podaci</h2>
<label>Naziv salona</label>
<input type="text" name="name" value="{{ t.name }}" required>
<label>Adresa</label>
<input type="text" name="address" value="{{ t.address }}">
<label>Grad</label>
<input type="text" name="city" value="{{ t.city }}">
<label>Telefon salona <small>(vaš postojeći broj)</small></label>
<input type="text" name="phone" value="{{ t.phone }}">
<label>Web stranica</label>
<input type="text" name="website" value="{{ t.website }}">
</div>
<div class="card">
<h2>Radno vrijeme</h2>
<p class="muted">Format: <code>09:00-13:00, 14:00-18:00</code> (pauza = dva intervala).
Prazno = neradni dan.</p>
{% for key, label in day_labels %}
<label>{{ label }}</label>
<input type="text" name="wh_{{ key }}" value="{{ hours_text[key] }}" placeholder="npr. 09:00-18:00">
{% endfor %}
</div>
</div>
<button>Sačuvaj</button>
</form>
<div class="card" style="margin-top:20px">
<h2>Zalijepi radno vrijeme</h2>
<p class="muted">Zalijepite radno vrijeme kako god ga imate zapisano (sa web stranice,
Facebooka…) — Gogo će ga pročitati, a vi samo provjerite i sačuvate.</p>
<form method="post" action="/dash/settings/parse-hours">
<textarea name="text" placeholder="npr. pon-pet 9-18 (pauza 13-14), subota 9-14, nedjelja ne radimo"></textarea>
<button class="ghost" style="margin-top:8px">Pročitaj radno vrijeme</button>
</form>
</div>
{% endblock %}