This commit is contained in:
Saifeddine ALOUI 2023-07-15 20:02:06 +02:00
commit 27a8872308

View File

@ -51,10 +51,17 @@
<i data-feather="database"></i>
</button>
<input type="file" ref="fileDialog" style="display: none" @change="importDiscussions" />
<button class="text-2xl hover:text-secondary duration-75 active:scale-90 rotate-90"
title="Import discussions" type="button" @click.stop="$refs.fileDialog.click()">
<div @click="toggleDropdown" class="text-2xl hover:text-secondary duration-75">
<i data-feather="import"></i>
</div>
<div @click="toggleDropdown" class="text-2xl hover:text-secondary duration-75">
<i data-feather="log-in"></i>
</button>
</div>
<div v-if="isOpen" class="dropdown">
<button @click="importDiscussions">LOLLMS</button>
<button @click="importChatGPT">ChatGPT</button>
</div>
<button class="text-2xl hover:text-secondary duration-75 active:scale-90" title="Filter discussions"
type="button" @click="isSearch = !isSearch" :class="isSearch ? 'text-secondary' : ''">
<i data-feather="search"></i>
@ -355,6 +362,11 @@ export default {
panelCollapsed: false // left panel collapse
}
},
data() {
return {
isOpen: false
}
},
methods: {
showToastMessage(text){
console.log("sending",text)
@ -363,6 +375,12 @@ export default {
togglePanel() {
this.panelCollapsed = !this.panelCollapsed;
},
toggleDropdown() {
this.isOpen = !this.isOpen;
},
importChatGPT() {
// handle ChatGPT import
},
async api_get_req(endpoint) {
try {
const res = await axios.get("/" + endpoint);
@ -376,8 +394,6 @@ export default {
console.log(error.message, 'api_get_req')
return
}
},
async list_discussions() {
try {