Added auto discussion renaming

This commit is contained in:
Saifeddine ALOUI 2023-11-26 02:51:51 +01:00
parent b4c8953598
commit 652b4f0df8
6 changed files with 19 additions and 15 deletions

View File

@ -3621,9 +3621,9 @@ class LoLLMsAPI(LollmsApplication):
d.rename(title)
self.socketio.emit('disucssion_renamed',{
'status': True,
'discussion_id':d.id,
'discussion_id':d.discussion_id,
'title':title
}, room=request.sid)
}, room=client_id)
self.busy=False

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

4
web/dist/index.html vendored
View File

@ -6,8 +6,8 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>LoLLMS WebUI - Welcome</title>
<script type="module" crossorigin src="/assets/index-d475a66e.js"></script>
<link rel="stylesheet" href="/assets/index-941c6b8c.css">
<script type="module" crossorigin src="/assets/index-b227e912.js"></script>
<link rel="stylesheet" href="/assets/index-3e99714b.css">
</head>
<body>
<div id="app"></div>

View File

@ -22,8 +22,8 @@
</div>
</pre>
<span v-if="executionOutput">Execution output</span>
<pre class="hljs mt-4 p-1 rounded-md break-all grid grid-cols-1" v-if="executionOutput">
<span v-if="executionOutput" class="text-2xl text-red-500">Execution output</span>
<pre class="hljs mt-0 p-1 rounded-md break-all grid grid-cols-1" v-if="executionOutput">
<div class="overflow-x-auto break-all scrollbar-thin scrollbar-track-bg-light-tone scrollbar-thumb-bg-light-tone-panel hover:scrollbar-thumb-primary dark:scrollbar-track-bg-dark-tone dark:scrollbar-thumb-bg-dark-tone-panel dark:hover:scrollbar-thumb-primary active:scrollbar-thumb-secondary">
<div ref="execution_output" v-html="executionOutput"></div>
</div>

View File

@ -1786,17 +1786,21 @@ export default {
this.$nextTick(() => {
feather.replace();
});
socket.on('disucssion_renamed',()=>{
})
socket.onclose = (event) => {
console.log('Received new title', event.id, event.title);
socket.on('disucssion_renamed',(event)=>{
console.log('Received new title', event.discussion_id, event.title);
const index = this.list.findIndex((x) => x.id == event.discussion_id)
const discussionItem = this.list[index]
discussionItem.title = event.title
/*
{
'status': True,
'discussion_id':d.id,
'title':title
}*/
})
socket.onclose = (event) => {
console.log('WebSocket connection closed:', event.code, event.reason);
this.socketIODisconnected();
};
socket.on("connect_error", (error) => {
if (error.message === "ERR_CONNECTION_REFUSED") {