Translate into English
Browse files- index.html +12 -12
index.html
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
<head>
|
4 |
<meta charset="UTF-8">
|
5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6 |
-
<title>ChatBot
|
7 |
<style>
|
8 |
* {
|
9 |
margin: 0;
|
@@ -420,15 +420,15 @@
|
|
420 |
<!-- Login Page -->
|
421 |
<div id="loginPage" class="login-container">
|
422 |
<div class="login-form">
|
423 |
-
<h1>ChatBot
|
424 |
-
<p>
|
425 |
<div id="loginError"></div>
|
426 |
<form id="loginForm">
|
427 |
<div class="input-group">
|
428 |
-
<label for="apiKey">
|
429 |
<input type="password" id="apiKey" placeholder="Votre clé API..." required>
|
430 |
</div>
|
431 |
-
<button type="submit" class="btn-primary">
|
432 |
</form>
|
433 |
</div>
|
434 |
</div>
|
@@ -437,7 +437,7 @@
|
|
437 |
<div id="chatPage" class="chat-container">
|
438 |
<div class="chat-header">
|
439 |
<div class="header-left">
|
440 |
-
<div class="header-title">ChatBot
|
441 |
</div>
|
442 |
<div class="header-controls">
|
443 |
<select id="modelSelect" class="model-select">
|
@@ -449,7 +449,7 @@
|
|
449 |
<div class="toggle-slider"></div>
|
450 |
</div>
|
451 |
</div>
|
452 |
-
<button id="logoutBtn" class="logout-btn">
|
453 |
</div>
|
454 |
</div>
|
455 |
|
@@ -457,7 +457,7 @@
|
|
457 |
<div class="message assistant">
|
458 |
<div class="message-avatar">AI</div>
|
459 |
<div class="message-content">
|
460 |
-
|
461 |
</div>
|
462 |
</div>
|
463 |
</div>
|
@@ -556,7 +556,7 @@
|
|
556 |
const apiKey = this.apiKeyInput.value.trim();
|
557 |
|
558 |
if (!apiKey) {
|
559 |
-
this.showLoginError('
|
560 |
return;
|
561 |
}
|
562 |
|
@@ -581,10 +581,10 @@
|
|
581 |
this.showChatInterface();
|
582 |
this.loginError.innerHTML = '';
|
583 |
} else {
|
584 |
-
this.showLoginError(data.error || '
|
585 |
}
|
586 |
} catch (error) {
|
587 |
-
this.showLoginError('
|
588 |
console.error('Login error:', error);
|
589 |
}
|
590 |
}
|
@@ -751,7 +751,7 @@
|
|
751 |
const data = JSON.parse(saved);
|
752 |
if (data.sessionId) {
|
753 |
this.sessionId = data.sessionId;
|
754 |
-
this.currentModel = data.currentModel || '
|
755 |
this.toolsEnabled = data.toolsEnabled !== undefined ? data.toolsEnabled : true;
|
756 |
this.availableModels = data.availableModels || [];
|
757 |
|
|
|
3 |
<head>
|
4 |
<meta charset="UTF-8">
|
5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6 |
+
<title>ChatBot Gemini</title>
|
7 |
<style>
|
8 |
* {
|
9 |
margin: 0;
|
|
|
420 |
<!-- Login Page -->
|
421 |
<div id="loginPage" class="login-container">
|
422 |
<div class="login-form">
|
423 |
+
<h1>ChatBot Gemini</h1>
|
424 |
+
<p>Login with your API key</p>
|
425 |
<div id="loginError"></div>
|
426 |
<form id="loginForm">
|
427 |
<div class="input-group">
|
428 |
+
<label for="apiKey">API Key</label>
|
429 |
<input type="password" id="apiKey" placeholder="Votre clé API..." required>
|
430 |
</div>
|
431 |
+
<button type="submit" class="btn-primary">Log In</button>
|
432 |
</form>
|
433 |
</div>
|
434 |
</div>
|
|
|
437 |
<div id="chatPage" class="chat-container">
|
438 |
<div class="chat-header">
|
439 |
<div class="header-left">
|
440 |
+
<div class="header-title">ChatBot Gemini</div>
|
441 |
</div>
|
442 |
<div class="header-controls">
|
443 |
<select id="modelSelect" class="model-select">
|
|
|
449 |
<div class="toggle-slider"></div>
|
450 |
</div>
|
451 |
</div>
|
452 |
+
<button id="logoutBtn" class="logout-btn">Log Out</button>
|
453 |
</div>
|
454 |
</div>
|
455 |
|
|
|
457 |
<div class="message assistant">
|
458 |
<div class="message-avatar">AI</div>
|
459 |
<div class="message-content">
|
460 |
+
Hi ! I'm your AI assistant. How can I help you today ?
|
461 |
</div>
|
462 |
</div>
|
463 |
</div>
|
|
|
556 |
const apiKey = this.apiKeyInput.value.trim();
|
557 |
|
558 |
if (!apiKey) {
|
559 |
+
this.showLoginError('Please enter a valid API key');
|
560 |
return;
|
561 |
}
|
562 |
|
|
|
581 |
this.showChatInterface();
|
582 |
this.loginError.innerHTML = '';
|
583 |
} else {
|
584 |
+
this.showLoginError(data.error || 'Connection error.');
|
585 |
}
|
586 |
} catch (error) {
|
587 |
+
this.showLoginError('Server connection error. Please retry.');
|
588 |
console.error('Login error:', error);
|
589 |
}
|
590 |
}
|
|
|
751 |
const data = JSON.parse(saved);
|
752 |
if (data.sessionId) {
|
753 |
this.sessionId = data.sessionId;
|
754 |
+
this.currentModel = data.currentModel || 'models/gemini-2.0-flash';
|
755 |
this.toolsEnabled = data.toolsEnabled !== undefined ? data.toolsEnabled : true;
|
756 |
this.availableModels = data.availableModels || [];
|
757 |
|