Quelltext des aktuellen Standes
<?php $this->layout('layouts/main', [
'page_title' => 'KI-Assistent',
'hide_ai_bubble' => true, // verhindert doppelte Element-IDs (Bubble) auf dieser Seite
]); ?>
<!-- ===== KI-ASSISTENT VOLLBILD ===== -->
<div id="aiAssistantPage" class="ai-assistant-page">
<div class="ai-chat-panel" id="aiChatPanel" role="region" aria-label="<?= $this->te('KI-Assistent') ?>">
<!-- Header -->
<div class="ai-chat-header">
<span class="ai-chat-header-icon">🤖</span>
<div class="ai-chat-header-info">
<div class="ai-chat-header-title"><?= $this->te('KI-Assistent') ?></div>
<div class="ai-chat-header-subtitle"><?= $this->te('Fragen zu Doku, Assets, Tickets & mehr – oder direkt etwas anlegen lassen.') ?></div>
</div>
<div class="ai-chat-header-actions">
<button type="button" class="ai-chat-header-btn" id="aiChatNewSessionBtn" title="<?= $this->te('Neues Gespräch starten') ?>">
<?= $this->te('➕ Neu') ?>
</button>
<button type="button" class="ai-chat-header-btn" id="aiChatSessionToggleBtn" title="<?= $this->te('Gesprächsverlauf') ?>">
<?= $this->te('🕐 Verlauf') ?>
</button>
<button type="button" class="ai-chat-header-btn" id="aiChatClearBtn" title="<?= $this->te('Aktuellen Verlauf löschen') ?>">
🗑
</button>
</div>
</div>
<!-- Session-Drawer -->
<div class="ai-session-drawer hidden" id="aiChatSessionDrawer">
<div class="ai-session-drawer-header">
<span><?= $this->te('Gesprächsverläufe') ?></span>
</div>
<div class="ai-session-list" id="aiChatSessionList"></div>
</div>
<!-- Fehler-Bar -->
<div class="ai-error-bar" id="aiChatErrorBar" style="display:none">
<span id="aiChatErrorText"></span>
<button aria-label="<?= $this->te('Schließen') ?>" type="button" class="ai-error-close" id="aiChatErrorClose">×</button>
</div>
<!-- Nachrichten -->
<div class="ai-chat-messages" id="aiChatMessages">
<div class="ai-chat-welcome" id="aiChatWelcome">
<span class="ai-chat-welcome-icon">🤖</span>
<h3><?= $this->te('Hallo! Wie kann ich helfen?') ?></h3>
<p><?= $this->te('Ich kenne die Inhalte dieses IT-Tools und helfe auch bei allgemeinen IT-Fragen. Frag mich zu Assets, Tickets, Verträgen, VMs und mehr – oder lass mich direkt etwas anlegen.') ?></p>
<div class="ai-chat-welcome-hints">
<button type="button" class="ai-chat-hint-btn" data-hint="Wie viel freier RAM ist auf den Hypervisor-Hosts?">
<?= $this->te('📊 Freier RAM auf den Hosts?') ?>
</button>
<button type="button" class="ai-chat-hint-btn" data-hint="Wie viele Assets haben wir im Inventar? Bitte nach Modell aufschlüsseln.">
<?= $this->te('📦 Inventar-Übersicht nach Modell') ?>
</button>
<button type="button" class="ai-chat-hint-btn" data-hint="Welche Tickets sind aktuell offen?">
<?= $this->te('🎫 Offene Tickets anzeigen') ?>
</button>
<button type="button" class="ai-chat-hint-btn" data-hint="Leg eine neue Bestellung an: 2x Dell Laptop E5540, 1x Dockingstation">
<?= $this->te('🛒 Neue Bestellung anlegen') ?>
</button>
</div>
</div>
</div>
<!-- Eingabe -->
<div class="ai-chat-input-area">
<div class="ai-chat-input-row">
<textarea
class="ai-chat-textarea"
id="aiChatTextarea"
placeholder="<?= $this->te('Nachricht eingeben... (Enter zum Senden, Shift+Enter = Zeilenumbruch)') ?>"
rows="1"
maxlength="2000"
aria-label="<?= $this->te('Nachricht') ?>"
></textarea>
<button type="button" class="ai-chat-send-btn" id="aiChatSendBtn" title="<?= $this->te('Senden') ?>" aria-label="<?= $this->te('Senden') ?>">
➤
</button>
</div>
</div>
</div>
</div>
<script src="<?= $this->asset('/assets/js/ai-chat.js') ?>"></script>