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:
86
gogo/templates/dashboard/scheduling.html
Normal file
86
gogo/templates/dashboard/scheduling.html
Normal file
@@ -0,0 +1,86 @@
|
||||
{% extends "base.html" %}
|
||||
{% block title %}Kalendar — {{ owner.tenant.name }}{% endblock %}
|
||||
{% block nav %}{% include "dashboard/_nav.html" %}{% endblock %}
|
||||
{% block content %}
|
||||
<h1>Kalendar i termini</h1>
|
||||
|
||||
{% if t.scheduling_provider == 'partner_api' %}
|
||||
<div class="card">
|
||||
<h2>Vaš booking softver</h2>
|
||||
<p>Gogo je povezan direktno s vašim booking softverom — slobodni termini se čitaju iz njega,
|
||||
a zahtjevi stižu u njega. Tu ih vaše osoblje potvrđuje kao i inače.</p>
|
||||
<table>
|
||||
<tr><td class="muted">Status veze</td>
|
||||
<td>{% if partner_ok is none %}<span class="badge pending">nije testirano</span>
|
||||
{% elif partner_ok %}<span class="badge confirmed">povezano</span>
|
||||
{% else %}<span class="badge rejected">greška veze</span>{% endif %}</td></tr>
|
||||
<tr><td class="muted">Zadnja sinhronizacija usluga</td><td>{{ last_sync or '—' }}</td></tr>
|
||||
</table>
|
||||
<p class="muted">Podešavanje veze vrši Gogo tim — javite nam se ako nešto ne radi.</p>
|
||||
</div>
|
||||
|
||||
{% elif t.scheduling_provider == 'google_calendar' %}
|
||||
<div class="card">
|
||||
<h2>Google kalendar</h2>
|
||||
{% if connection %}
|
||||
<p>Povezan nalog: <b>{{ connection.google_account }}</b>
|
||||
<span class="badge confirmed">aktivno</span></p>
|
||||
<p class="muted">Gogo čita samo zauzetost (slobodno/zauzeto) — nikad sadržaj vaših
|
||||
događaja i nikad ne upisuje u kalendar.</p>
|
||||
<form method="post" action="/dash/scheduling/google/disconnect"
|
||||
onsubmit="return confirm('Prekinuti vezu s Google kalendarom?')">
|
||||
<button class="red small">Prekini vezu</button>
|
||||
</form>
|
||||
{% else %}
|
||||
<p class="muted">Povežite Google nalog da bi asistent nudio termine samo kad ste zaista
|
||||
slobodni. Gogo traži <b>samo</b> pristup zauzetosti (free/busy) — ne vidi sadržaj vaših
|
||||
događaja i ne može ništa upisivati.</p>
|
||||
{% if google_configured %}
|
||||
<a class="btn" href="/dash/scheduling/google/start">Poveži Google kalendar</a>
|
||||
{% else %}
|
||||
<p class="banner">Google prijava još nije podešena na ovom serveru — javite se Gogo timu.</p>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<h2>Kalendari po uslugama</h2>
|
||||
<p class="muted">Ako vodite više kalendara (npr. po radnicama ili vrstama usluga), ovdje
|
||||
odredite koji kalendar vrijedi za koju uslugu. ID kalendara nađete u Google Calendar
|
||||
postavkama („Integrate calendar" → Calendar ID); glavni kalendar je <code>primary</code>.</p>
|
||||
<form method="post" action="/dash/scheduling/mappings">
|
||||
<table>
|
||||
<tr><th>Usluga</th><th>Google Calendar ID</th></tr>
|
||||
<tr><td><i>Zadani kalendar (sve usluge)</i></td>
|
||||
<td><input type="text" name="default" value="{{ mappings.get('default','primary') }}"></td></tr>
|
||||
{% for s in services %}
|
||||
<tr><td>{{ s.name }}</td>
|
||||
<td><input type="text" name="svc_{{ s.id }}" value="{{ mappings.get(s.id|string, '') }}"
|
||||
placeholder="(zadani)"></td></tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
<button style="margin-top:12px">Sačuvaj</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<h2>Pravila nuđenja termina</h2>
|
||||
<form method="post" action="/dash/scheduling/buffers">
|
||||
<div class="grid2">
|
||||
<div>
|
||||
<label>Najranije nuđenje <small>(sati od trenutka poziva)</small></label>
|
||||
<input type="number" name="min_notice_hours" value="{{ t.min_notice_hours }}" min="0" max="72">
|
||||
</div>
|
||||
<div>
|
||||
<label>Najdalje nuđenje <small>(dana unaprijed)</small></label>
|
||||
<input type="number" name="max_days_ahead" value="{{ t.max_days_ahead }}" min="1" max="60">
|
||||
</div>
|
||||
</div>
|
||||
<button style="margin-top:12px">Sačuvaj</button>
|
||||
</form>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="card"><p class="muted">Demo režim (mock kalendar) — termini se računaju samo iz
|
||||
radnog vremena.</p></div>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user