gestion chatbot avec api
This commit is contained in:
@ -270,6 +270,12 @@ body {
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.status-badge.default {
|
||||
background: linear-gradient(135deg, #f6d365 0%, #fda085 100%);
|
||||
color: #744210;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.status-badge.active {
|
||||
background: #c6f6d5;
|
||||
color: #22543d;
|
||||
|
||||
@ -21,6 +21,20 @@ $db = Database::getInstance();
|
||||
// Récupérer les clés API de l'enseignant
|
||||
$api_keys = APIKeyManager::listKeys($user['id_utilisateur']);
|
||||
|
||||
// Déterminer le provider par défaut (premier actif ou ollama)
|
||||
$default_provider = null;
|
||||
foreach ($api_keys as $key) {
|
||||
if ($key['is_active']) {
|
||||
$default_provider = $key['provider'];
|
||||
break; // Premier actif trouvé
|
||||
}
|
||||
}
|
||||
// Si aucune clé active, Ollama par défaut
|
||||
if (!$default_provider) {
|
||||
$default_provider = 'ollama';
|
||||
}
|
||||
|
||||
|
||||
// Récupérer les modèles disponibles groupés par provider
|
||||
$models_by_provider = [];
|
||||
$all_models = $db->fetchAll(
|
||||
@ -152,6 +166,9 @@ $stats_detail = $db->fetchAll(
|
||||
<div class="key-status">
|
||||
<?php if ($is_active): ?>
|
||||
<span class="status-badge active">🟢 Active</span>
|
||||
<?php if ($default_provider === $provider_id): ?>
|
||||
<span class="status-badge default">✨ Par défaut</span>
|
||||
<?php endif; ?>
|
||||
<?php elseif ($is_configured): ?>
|
||||
<span class="status-badge inactive">🟠 Désactivée</span>
|
||||
<?php else: ?>
|
||||
|
||||
Reference in New Issue
Block a user