111 lines
6 KiB
HTML
111 lines
6 KiB
HTML
{% extends "base.html" %}
|
|
{% block title %}{{ workspace.name }}{% endblock %}
|
|
{% block content %}
|
|
<div class="aiw-page-head">
|
|
<div class="stack stack-sm flex-1 min-w-0">
|
|
<h1>{{ workspace.name }}</h1>
|
|
<p class="text-sm text-muted">Team {{ team.name }}{% if effective_model %} · Modell {{ effective_model.label }}{% endif %}
|
|
· <span class="badge {{ 'badge-primary' if membership.may_approve else 'badge-default' }}">{{ role_labels[membership.role] }}</span></p>
|
|
{% if workspace.description %}<p class="text-muted">{{ workspace.description }}</p>{% endif %}
|
|
</div>
|
|
{% if membership.is_admin %}<a class="btn btn-ghost btn-sm" href="/workspaces/{{ workspace.id }}/settings">Einstellungen</a>{% endif %}
|
|
</div>
|
|
|
|
{% if not ready %}
|
|
<section class="card"><div class="card-body stack">
|
|
<h2 class="text-lg">Erste Schritte</h2>
|
|
<ol class="aiw-steps">
|
|
<li class="{{ 'done' if sources or uploads }}">
|
|
<strong>Kontext anlegen.</strong>
|
|
{% if membership.is_admin %}Unter <a href="/workspaces/{{ workspace.id }}/data">Daten</a> ein Git-Repository oder eine Datenbank verbinden oder eine Datei hochladen.
|
|
{% else %}Ein Workspace-Admin verbindet ein Repository oder eine Datenbank. Dateien zur Analyse kannst du unter <a href="/workspaces/{{ workspace.id }}/data">Daten</a> selbst hochladen.{% endif %}
|
|
</li>
|
|
<li><strong>Verbindung testen.</strong> Der Chat startet, sobald eine Quelle erfolgreich getestet oder eine Datei verarbeitet ist.</li>
|
|
<li class="{{ 'done' if effective_model }}"><strong>Modell.</strong> {% if effective_model %}{{ effective_model.label }} ist eingestellt.{% else %}Noch kein Modell; das richtet der Plattform-Admin unter „Modelle und Zugänge“ ein.{% endif %}</li>
|
|
</ol>
|
|
</div></section>
|
|
{% endif %}
|
|
|
|
{% if sources or uploads or folders %}
|
|
<p class="aiw-context-line text-sm">
|
|
<span class="text-muted">Kontext:</span>
|
|
{% for s in sources %}<span class="badge badge-dot {{ 'badge-success' if s.status == 'ok' else 'badge-danger' if s.status == 'error' else 'badge-default' }}" title="{{ 'verbunden' if s.status == 'ok' else 'Fehler' if s.status == 'error' else 'ungetestet' }}">{{ s.name }}{% if s.status == 'ok' %} ✓{% elif s.status == 'error' %} !{% endif %}</span> {% endfor %}
|
|
{% set ok_files = uploads|selectattr('status', 'equalto', 'ok')|list %}
|
|
{% if ok_files %}<span class="badge badge-default">{{ ok_files|length }} Datei{{ 'en' if ok_files|length != 1 }}</span>{% endif %}
|
|
{% if folders %}<span class="badge badge-default">{{ folders|length }} Ordner</span>{% endif %}
|
|
<a href="/workspaces/{{ workspace.id }}/data">Daten verwalten</a>
|
|
</p>
|
|
{% endif %}
|
|
|
|
{% set new_chat %}
|
|
{% if ready %}
|
|
<form method="post" action="/workspaces/{{ workspace.id }}/chats">
|
|
<input type="hidden" name="_csrf" value="{{ p.csrf }}">
|
|
<button class="btn btn-primary btn-sm" type="submit">+ Neuer Chat</button>
|
|
</form>
|
|
{% endif %}
|
|
{% endset %}
|
|
{% if ready and examples %}
|
|
<section class="card" id="examples">
|
|
<div class="card-header"><h2 class="text-lg">Ausprobieren</h2></div>
|
|
<div class="card-body">
|
|
<ul class="aiw-examples">
|
|
{% for e in examples %}
|
|
<li><form method="post" action="/workspaces/{{ workspace.id }}/chats">
|
|
<input type="hidden" name="_csrf" value="{{ p.csrf }}">
|
|
<input type="hidden" name="question" value="{{ e }}">
|
|
<button class="aiw-example" type="submit">{{ e }}</button>
|
|
</form></li>
|
|
{% endfor %}
|
|
</ul>
|
|
</div>
|
|
</section>
|
|
{% endif %}
|
|
|
|
<section class="card" id="chats">
|
|
<div class="card-header aiw-chats-head">
|
|
<h2 class="text-lg">Chats{% if chats %} <span class="badge badge-default">{{ chats|length }}{% if q %} Treffer{% endif %}</span>{% endif %}</h2>
|
|
{% if chats or q %}
|
|
<form method="get" action="/workspaces/{{ workspace.id }}#chats" class="aiw-search-form" role="search">
|
|
<svg class="aiw-search-icon" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" aria-hidden="true"><circle cx="11" cy="11" r="7"/><line x1="21" y1="21" x2="16.65" y2="16.65"/></svg>
|
|
<input type="search" name="q" value="{{ q }}" placeholder="Chats durchsuchen" aria-label="Chats durchsuchen (Titel und Nachrichten)">
|
|
{% if q %}<a class="btn btn-ghost btn-xs" href="/workspaces/{{ workspace.id }}#chats" aria-label="Suche zurücksetzen">✕</a>{% endif %}
|
|
</form>
|
|
{% endif %}
|
|
{{ new_chat }}
|
|
</div>
|
|
<div class="card-body">
|
|
{% if chats %}
|
|
<ul class="aiw-chat-list">
|
|
{% for row in chats %}
|
|
<li class="aiw-chat-item">
|
|
<a href="/chats/{{ row.chat.id }}" class="aiw-chat-link">
|
|
<span class="aiw-chat-row">
|
|
<span class="aiw-chat-title">{{ row.chat.title }}</span>
|
|
<span class="text-xs text-muted aiw-chat-meta">{{ row.author }} · {{ row.messages }} Nachricht{{ 'en' if row.messages != 1 }} · {{ row.last.strftime('%d.%m.%Y %H:%M') }}</span>
|
|
</span>
|
|
{% if row.snippet %}<span class="text-sm text-muted aiw-snippet">{{ row.snippet }}</span>{% endif %}
|
|
</a>
|
|
{% if row.chat.created_by == p.user_id or membership.is_admin %}
|
|
<form method="post" action="/chats/{{ row.chat.id }}/delete" class="aiw-chat-delete" data-confirm="Chat „{{ row.chat.title }}“ mit allen Nachrichten löschen? Das lässt sich nicht rückgängig machen.">
|
|
<input type="hidden" name="_csrf" value="{{ p.csrf }}">
|
|
<button class="btn btn-ghost btn-xs" type="submit" aria-label="Chat {{ row.chat.title }} löschen" title="Chat löschen">Löschen</button>
|
|
</form>
|
|
{% endif %}
|
|
</li>
|
|
{% endfor %}
|
|
</ul>
|
|
{% elif q %}
|
|
<p class="text-muted">Kein Chat enthält „{{ q }}“.</p>
|
|
{% elif ready %}
|
|
<div class="empty">
|
|
<p class="empty-title">Noch kein Chat</p>
|
|
<p class="empty-description">Stelle eine Frage zu Repository, Datenbank oder Dateien. Die KI liest nur, Änderungen schlägt sie als Freigabeantrag vor.</p>
|
|
</div>
|
|
{% else %}
|
|
<p class="text-muted">Chats sind möglich, sobald eine Quelle oder Datei bereitsteht.</p>
|
|
{% endif %}
|
|
</div>
|
|
</section>
|
|
|
|
{% endblock %}
|