Backup #1742

ID1742
Dateipfad/var/www/dev.campus.systemische-tools.de/src/View/chat/partials/session-list.php
Version2
Typ modified
Größe1.7 KB
Hash0e11549f7f1726590dc2ab975ffae7227f474c9fde628117f5a9ee3f3baabc05
Datum2025-12-27 12:44:14
Geändert vonclaude-code-hook
GrundClaude Code Pre-Hook Backup vor Edit-Operation
Datei existiert Ja

Dateiinhalt

<?php foreach ($sessions ?? [] as $s):
    $totalTokens = (int) ($s['total_input_tokens'] ?? 0) + (int) ($s['total_output_tokens'] ?? 0);
    $totalCost = ((int) ($s['total_input_tokens'] ?? 0) * 0.000015) + ((int) ($s['total_output_tokens'] ?? 0) * 0.000075);
    $isOllama = str_starts_with($s['model'] ?? '', 'ollama:');
    $createdAt = $s['created_at'] ?? null;
    $dateStr = $createdAt ? (new DateTime($createdAt))->format('d.m. H:i') : '';
    ?>
<a href="/chat/<?= $s['uuid'] ?>"
   class="chat-session <?= ($currentUuid ?? '') === $s['uuid'] ? 'chat-session--active' : '' ?>"
   data-uuid="<?= $s['uuid'] ?>">
    <div class="chat-session__title" id="title-<?= $s['uuid'] ?>"><?= htmlspecialchars($s['title'] ?? 'Neuer Chat') ?></div>
    <div class="chat-session__meta">
        <span class="chat-session__date"><?= $dateStr ?></span>
        <span><?= $s['message_count'] ?? 0 ?> Nachr.</span>
        <?php if (!$isOllama && $totalTokens > 0): ?>
        <span class="chat-session__cost">~$<?= number_format($totalCost, 2) ?></span>
        <?php elseif ($isOllama): ?>
        <span class="chat-session__local">lokal</span>
        <?php endif; ?>
    </div>
    <div class="chat-session__actions">
        <button class="chat-session__edit" onclick="event.preventDefault(); event.stopPropagation(); editTitle('<?= $s['uuid'] ?>');" title="Bearbeiten">&#9998;</button>
        <button class="chat-session__delete" hx-delete="/chat/<?= $s['uuid'] ?>" hx-confirm="Session löschen?" onclick="event.preventDefault(); event.stopPropagation();">&times;</button>
    </div>
</a>
<?php endforeach; ?>
<?php if (empty($sessions)): ?>
<div class="chat-session chat-session--empty">Keine Sessions</div>
<?php endif; ?>

Vollständig herunterladen

Aktionen

Herunterladen

Andere Versionen dieser Datei

ID Version Typ Größe Datum
1742 2 modified 1.7 KB 2025-12-27 12:44
1666 1 modified 1.7 KB 2025-12-27 11:24

← Zurück zur Übersicht