:gem: [Feature] New ClearChatHistoryButtonBinder: clear chat history
Browse files- components/buttons_binder.js +14 -0
- index.html +5 -0
components/buttons_binder.js
CHANGED
@@ -32,6 +32,9 @@ export class ButtonsBinder {
|
|
32 |
let chat_history_sidebar_toggle_button_binder =
|
33 |
new ChatHistorySidebarToggleButtonBinder();
|
34 |
chat_history_sidebar_toggle_button_binder.bind();
|
|
|
|
|
|
|
35 |
let available_models_select_binder = new AvailableModelsSelectBinder();
|
36 |
available_models_select_binder.bind();
|
37 |
}
|
@@ -269,6 +272,17 @@ class ChatHistorySidebarToggleButtonBinder {
|
|
269 |
}
|
270 |
}
|
271 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
272 |
class AvailableModelsSelectBinder {
|
273 |
constructor() { }
|
274 |
bind() {
|
|
|
32 |
let chat_history_sidebar_toggle_button_binder =
|
33 |
new ChatHistorySidebarToggleButtonBinder();
|
34 |
chat_history_sidebar_toggle_button_binder.bind();
|
35 |
+
let clear_chat_history_button_binder =
|
36 |
+
new ClearChatHistoryButtonBinder();
|
37 |
+
clear_chat_history_button_binder.bind();
|
38 |
let available_models_select_binder = new AvailableModelsSelectBinder();
|
39 |
available_models_select_binder.bind();
|
40 |
}
|
|
|
272 |
}
|
273 |
}
|
274 |
|
275 |
+
class ClearChatHistoryButtonBinder {
|
276 |
+
constructor() { }
|
277 |
+
bind() {
|
278 |
+
const button = $("#clear-chat-history-button");
|
279 |
+
button.attr("title", "Clear chat history");
|
280 |
+
button.click(() => {
|
281 |
+
chat_history_storer.clear_database();
|
282 |
+
});
|
283 |
+
}
|
284 |
+
}
|
285 |
+
|
286 |
class AvailableModelsSelectBinder {
|
287 |
constructor() { }
|
288 |
bind() {
|
index.html
CHANGED
@@ -37,6 +37,11 @@
|
|
37 |
<ul id="chat-history-sidebar-items" class="navbar-nav justify-content-end flex-grow-1">
|
38 |
</ul>
|
39 |
</div>
|
|
|
|
|
|
|
|
|
|
|
40 |
</div>
|
41 |
<div id="chat-session-container" class="container">
|
42 |
<div id="messagers-container" class="container my-3 py-1"></div>
|
|
|
37 |
<ul id="chat-history-sidebar-items" class="navbar-nav justify-content-end flex-grow-1">
|
38 |
</ul>
|
39 |
</div>
|
40 |
+
<div class="d-flex justify-content-start mb-3">
|
41 |
+
<button id="clear-chat-history-button" class="btn">
|
42 |
+
<i class="fa fa-trash"></i>
|
43 |
+
</button>
|
44 |
+
</div>
|
45 |
</div>
|
46 |
<div id="chat-session-container" class="container">
|
47 |
<div id="messagers-container" class="container my-3 py-1"></div>
|