This commit is contained in:
Saifeddine ALOUI 2023-12-15 02:52:37 +01:00
parent f8945db22f
commit baf88a7e45
13 changed files with 167 additions and 144 deletions

View File

@ -359,7 +359,7 @@ class LoLLMsAPI(LollmsApplication):
progress = 0 progress = 0
installation_dir = self.binding.searchModelParentFolder(model_path.split('/')[-1], model_type) installation_dir = self.binding.searchModelParentFolder(model_path.split('/')[-1], model_type)
if model_type=="gptq" or model_type=="awq": if model_type=="gptq" or model_type=="awq" or model_type=="transformers":
parts = model_path.split("/") parts = model_path.split("/")
if len(parts)==2: if len(parts)==2:
filename = parts[1] filename = parts[1]

2
app.py
View File

@ -13,7 +13,7 @@ __github__ = "https://github.com/ParisNeo/lollms-webui"
__copyright__ = "Copyright 2023, " __copyright__ = "Copyright 2023, "
__license__ = "Apache 2.0" __license__ = "Apache 2.0"
__version__ ="8.0 (Alpha)" __version__ ="8.0 (Beta)"
main_repo = "https://github.com/ParisNeo/lollms-webui.git" main_repo = "https://github.com/ParisNeo/lollms-webui.git"
import os import os

@ -1 +1 @@
Subproject commit dcd80a126c6232c3a9ed82b5c877200999308ebc Subproject commit 691af56f46f4318f21975dff4aea5c1922ad2eb7

@ -1 +1 @@
Subproject commit a203e1087771a23770c3080b37822b14555e5f4b Subproject commit d6e7fb63f4480723b27746104b1a5b9ed5e31d92

File diff suppressed because one or more lines are too long

2
web/dist/index.html vendored
View File

@ -6,7 +6,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>LoLLMS WebUI - Welcome</title> <title>LoLLMS WebUI - Welcome</title>
<script type="module" crossorigin src="/assets/index-f86549f0.js"></script> <script type="module" crossorigin src="/assets/index-020fb736.js"></script>
<link rel="stylesheet" href="/assets/index-2a99fe15.css"> <link rel="stylesheet" href="/assets/index-2a99fe15.css">
</head> </head>
<body> <body>

View File

@ -172,12 +172,11 @@
<b>License:&nbsp;</b> <b>License:&nbsp;</b>
{{ model.license }} {{ model.license }}
</div> </div>
<div v-if="model.quantizer!='None'" class="flex items-center"> <div v-if="model.quantizer!='None' && model.type != 'transformers'" class="flex items-center">
<i data-feather="user" class="w-5 m-1"></i> <i data-feather="user" class="w-5 m-1"></i>
<b>quantizer:&nbsp;</b> <b>quantizer:&nbsp;</b>
<a :href="'https://huggingface.co/'+model.quantizer" target="_blank" rel="noopener noreferrer" @click.stop <a :href="'https://huggingface.co/'+model.quantizer" target="_blank" rel="noopener noreferrer" @click.stop
class="flex hover:text-secondary duration-75 active:scale-90" title="quantizer's profile"> class="flex hover:text-secondary duration-75 active:scale-90" title="quantizer's profile">
{{ model.quantizer }} {{ model.quantizer }}
</a> </a>
</div> </div>
@ -203,7 +202,8 @@
{{ model.category }} {{ model.category }}
</a> </a>
</div> </div>
<!--
<div class="flex items-center"> <div class="flex items-center">
<i data-feather="user" class="w-5 m-1"></i> <i data-feather="user" class="w-5 m-1"></i>
<b>Hugging face rank:&nbsp;</b> <b>Hugging face rank:&nbsp;</b>
@ -213,6 +213,8 @@
{{ model.rank }} {{ model.rank }}
</a> </a>
</div> </div>
-->
</div> </div>

View File

@ -82,6 +82,12 @@
</nav> </nav>
<!-- NAVIGATION BUTTONS --> <!-- NAVIGATION BUTTONS -->
<Navigation /> <Navigation />
<Toast ref="toast" />
<MessageBox ref="messageBox" />
<div v-show="progress_visibility" role="status" class="fixed m-0 p-2 left-2 bottom-2 min-w-[24rem] max-w-[24rem] h-20 flex flex-col justify-center items-center pb-4 bg-blue-500 rounded-lg shadow-lg z-50 background-a">
<ProgressBar ref="progress" :progress="progress_value" class="w-full h-4"></ProgressBar>
<p class="text-2xl animate-pulse mt-2 text-white">{{ loading_infos }} ...</p>
</div>
</header> </header>
<body> <body>
@ -90,6 +96,11 @@
</template> </template>
<script setup> <script setup>
import Discussion from '../components/Discussion.vue'
import Toast from '../components/Toast.vue'
import MessageBox from "@/components/MessageBox.vue";
import ProgressBar from "@/components/ProgressBar.vue";
import { RouterLink } from 'vue-router' import { RouterLink } from 'vue-router'
import Navigation from './Navigation.vue' import Navigation from './Navigation.vue'
import { nextTick } from 'vue' import { nextTick } from 'vue'
@ -101,6 +112,9 @@ import { mapState } from 'vuex';
export default { export default {
name: 'TopBar', name: 'TopBar',
computed:{ computed:{
loading_infos(){
return this.$store.state.loading_infos;
},
isModelOK(){ isModelOK(){
return this.$store.state.isModelOk; return this.$store.state.isModelOk;
}, },
@ -111,6 +125,12 @@ export default {
return this.$store.state.isConnected; return this.$store.state.isConnected;
} }
}, },
components: {
Discussion,
Toast,
MessageBox,
ProgressBar
},
watch:{ watch:{
isConnected(){ isConnected(){
nextTick(() => { nextTick(() => {
@ -121,6 +141,9 @@ export default {
}, },
data() { data() {
return { return {
database_selectorDialogVisible:false,
progress_visibility:false,
progress_value:0,
codeBlockStylesheet:'', codeBlockStylesheet:'',
sunIcon: document.querySelector(".sun"), sunIcon: document.querySelector(".sun"),
moonIcon: document.querySelector(".moon"), moonIcon: document.querySelector(".moon"),
@ -129,6 +152,7 @@ export default {
} }
}, },
mounted() { mounted() {
this.$store.state.toast = this.$refs.toast
this.sunIcon = document.querySelector(".sun"); this.sunIcon = document.querySelector(".sun");
this.moonIcon = document.querySelector(".moon"); this.moonIcon = document.querySelector(".moon");
this.userTheme = localStorage.getItem("theme"); this.userTheme = localStorage.getItem("theme");

View File

@ -275,7 +275,6 @@
</div> </div>
</div> </div>
<Toast ref="toast" />
<MessageBox ref="messageBox" /> <MessageBox ref="messageBox" />
<ChoiceDialog reference="database_selector" class="z-20" <ChoiceDialog reference="database_selector" class="z-20"
:show="database_selectorDialogVisible" :show="database_selectorDialogVisible"
@ -472,17 +471,17 @@ export default {
if (response && response.data) { if (response && response.data) {
console.log('binding set with new settings', response.data) console.log('binding set with new settings', response.data)
this.$refs.toast.showToast("Binding settings updated successfully!", 4, true) this.$store.state.toast.showToast("Binding settings updated successfully!", 4, true)
} else { } else {
this.$refs.toast.showToast("Did not get binding settings responses.\n" + response, 4, false) this.$store.state.toast.showToast("Did not get binding settings responses.\n" + response, 4, false)
this.isLoading = false this.isLoading = false
} }
}) })
} catch (error) { } catch (error) {
this.$refs.toast.showToast("Did not get binding settings responses.\n Endpoint error: " + error.message, 4, false) this.$store.state.toast.showToast("Did not get binding settings responses.\n Endpoint error: " + error.message, 4, false)
this.isLoading = false this.isLoading = false
} }
@ -490,7 +489,7 @@ export default {
}) })
} else { } else {
this.$refs.toast.showToast("Binding has no settings", 4, false) this.$store.state.toast.showToast("Binding has no settings", 4, false)
this.isLoading = false this.isLoading = false
} }
@ -499,7 +498,7 @@ export default {
} catch (error) { } catch (error) {
this.isLoading = false this.isLoading = false
this.$refs.toast.showToast("Could not open binding settings. Endpoint error: " + error.message, 4, false) this.$store.state.toast.showToast("Could not open binding settings. Endpoint error: " + error.message, 4, false)
} }
}, },
showDatabaseSelector() { showDatabaseSelector() {
@ -536,10 +535,11 @@ export default {
this.loading = false; this.loading = false;
//console.log('apply-res',res) //console.log('apply-res',res)
if (res.data.status) { if (res.data.status) {
this.$refs.toast.showToast("Configuration changed successfully.", 4, true)
this.$store.state.toast.showToast("Configuration changed successfully.", 4, true)
//this.save_configuration() //this.save_configuration()
} else { } else {
this.$refs.toast.showToast("Configuration change failed.", 4, false) this.$store.state.toast.showToast("Configuration change failed.", 4, false)
} }
nextTick(() => { nextTick(() => {
feather.replace() feather.replace()
@ -551,7 +551,7 @@ export default {
.then((res) => { .then((res) => {
if (res) { if (res) {
if (res.status) { if (res.status) {
this.$refs.toast.showToast("Settings saved!",4,true) this.$store.state.toast.showToast("Settings saved!",4,true)
} }
else else
this.$refs.messageBox.showMessage("Error: Couldn't save settings!") this.$refs.messageBox.showMessage("Error: Couldn't save settings!")
@ -567,7 +567,7 @@ export default {
}, },
showToastMessage(text, duration, isok){ showToastMessage(text, duration, isok){
console.log("sending",text) console.log("sending",text)
this.$refs.toast.showToast(text, duration, isok) this.$store.state.toast.showToast(text, duration, isok)
}, },
togglePanel() { togglePanel() {
this.panelCollapsed = !this.panelCollapsed; this.panelCollapsed = !this.panelCollapsed;
@ -869,7 +869,7 @@ export default {
}, },
async selectDiscussion(item) { async selectDiscussion(item) {
if(this.isGenerating){ if(this.isGenerating){
this.$refs.toast.showToast("You are currently generating a text. Please wait for text generation to finish or stop it before trying to select another discussion", 4, false) this.$store.state.toast.showToast("You are currently generating a text. Please wait for text generation to finish or stop it before trying to select another discussion", 4, false)
return; return;
} }
@ -1092,7 +1092,7 @@ export default {
/* /*
} }
else { else {
this.$refs.toast.showToast("It seems that no model has been loaded. Please download and install a model first, then try again.", 4, false) this.$store.state.toast.showToast("It seems that no model has been loaded. Please download and install a model first, then try again.", 4, false)
this.isGenerating = false this.isGenerating = false
this.setDiscussionLoading(this.currentDiscussion.id, this.isGenerating) this.setDiscussionLoading(this.currentDiscussion.id, this.isGenerating)
this.chime.play() this.chime.play()
@ -1131,7 +1131,7 @@ export default {
sendMsg(msg) { sendMsg(msg) {
// Sends message to binding // Sends message to binding
if (!msg) { if (!msg) {
this.$refs.toast.showToast("Message contains no content!", 4, false) this.$store.state.toast.showToast("Message contains no content!", 4, false)
return return
} }
this.isGenerating = true; this.isGenerating = true;
@ -1203,7 +1203,7 @@ export default {
this.scrollBottom(msgList) this.scrollBottom(msgList)
}) })
if(notif.display_type==0){ if(notif.display_type==0){
this.$refs.toast.showToast(notif.content, notif.duration, notif.notification_type) this.$store.state.toast.showToast(notif.content, notif.duration, notif.notification_type)
} }
else if(notif.display_type==1){ else if(notif.display_type==1){
this.$refs.messageBox.showMessage(notif.content) this.$refs.messageBox.showMessage(notif.content)
@ -1257,7 +1257,7 @@ export default {
messageItem.ui = msgObj.ui messageItem.ui = msgObj.ui
console.log(messageItem.ui) console.log(messageItem.ui)
} else if (msgObj.message_type == this.msgTypes.MSG_TYPE_EXCEPTION) { } else if (msgObj.message_type == this.msgTypes.MSG_TYPE_EXCEPTION) {
this.$refs.toast.showToast(msgObj.content, 5, false) this.$store.state.toast.showToast(msgObj.content, 5, false)
} }
// // Disables as per request // // Disables as per request
// nextTick(() => { // nextTick(() => {
@ -1305,7 +1305,7 @@ export default {
} }
}, },
onCopyPersonalityName(personality) { onCopyPersonalityName(personality) {
this.$refs.toast.showToast("Copied name to clipboard!", 4, true) this.$store.state.toast.showToast("Copied name to clipboard!", 4, true)
navigator.clipboard.writeText(personality.name); navigator.clipboard.writeText(personality.name);
}, },
async deleteDiscussion(id) { async deleteDiscussion(id) {
@ -1339,7 +1339,7 @@ export default {
} }
this.tempList = this.list this.tempList = this.list
this.isCheckbox = false this.isCheckbox = false
this.$refs.toast.showToast("Removed (" + deleteList.length + ") items", 4, true) this.$store.state.toast.showToast("Removed (" + deleteList.length + ") items", 4, true)
this.showConfirmation = false this.showConfirmation = false
console.log("Multi delete done") console.log("Multi delete done")
}, },
@ -1350,7 +1350,7 @@ export default {
this.discussionArr.splice(this.discussionArr.findIndex(item => item.id == msgId), 1) this.discussionArr.splice(this.discussionArr.findIndex(item => item.id == msgId), 1)
}).catch(() => { }).catch(() => {
this.$refs.toast.showToast("Could not remove message", 4, false) this.$store.state.toast.showToast("Could not remove message", 4, false)
console.log("Error: Could not delete message") console.log("Error: Could not delete message")
}) })
@ -1437,7 +1437,7 @@ export default {
const message = this.discussionArr[this.discussionArr.findIndex(item => item.id == msgId)] const message = this.discussionArr[this.discussionArr.findIndex(item => item.id == msgId)]
message.rank = res.new_rank message.rank = res.new_rank
}).catch(() => { }).catch(() => {
this.$refs.toast.showToast("Could not rank up message", 4, false) this.$store.state.toast.showToast("Could not rank up message", 4, false)
console.log("Error: Could not rank up message") console.log("Error: Could not rank up message")
}) })
@ -1448,7 +1448,7 @@ export default {
const message = this.discussionArr[this.discussionArr.findIndex(item => item.id == msgId)] const message = this.discussionArr[this.discussionArr.findIndex(item => item.id == msgId)]
message.rank = res.new_rank message.rank = res.new_rank
}).catch(() => { }).catch(() => {
this.$refs.toast.showToast("Could not rank down message", 4, false) this.$store.state.toast.showToast("Could not rank down message", 4, false)
console.log("Error: Could not rank down message") console.log("Error: Could not rank down message")
}) })
@ -1461,7 +1461,7 @@ export default {
message.content = msg message.content = msg
}).catch(() => { }).catch(() => {
this.$refs.toast.showToast("Could not update message", 4, false) this.$store.state.toast.showToast("Could not update message", 4, false)
console.log("Error: Could not update message") console.log("Error: Could not update message")
}) })
@ -1481,7 +1481,7 @@ export default {
socket.emit('generate_msg_from', { prompt: msg, id: msgId, msg_type: msg_type }); socket.emit('generate_msg_from', { prompt: msg, id: msgId, msg_type: msg_type });
} }
else { else {
this.$refs.toast.showToast("The server is busy. Wait", 4, false) this.$store.state.toast.showToast("The server is busy. Wait", 4, false)
console.log("Already generating"); console.log("Already generating");
} }
} }
@ -1549,7 +1549,7 @@ export default {
this.chime.play() this.chime.play()
}, },
copyToClipBoard(messageEntry) { copyToClipBoard(messageEntry) {
this.$refs.toast.showToast("Copied to clipboard successfully", 4, true) this.$store.state.toast.showToast("Copied to clipboard successfully", 4, true)
let binding = "" let binding = ""
if (messageEntry.message.binding) { if (messageEntry.message.binding) {
@ -1621,7 +1621,7 @@ export default {
const ret = JSON.parse(obj) const ret = JSON.parse(obj)
return ret return ret
} catch (error) { } catch (error) {
this.$refs.toast.showToast("Could not parse JSON. \n" + error.message, 4, false) this.$store.state.toast.showToast("Could not parse JSON. \n" + error.message, 4, false)
return null return null
} }
@ -1672,10 +1672,10 @@ export default {
if (res) { if (res) {
this.saveMarkdowntoFile(res, filename) this.saveMarkdowntoFile(res, filename)
this.$refs.toast.showToast("Successfully exported", 4, true) this.$store.state.toast.showToast("Successfully exported", 4, true)
this.isCheckbox = false this.isCheckbox = false
} else { } else {
this.$refs.toast.showToast("Failed to export discussions", 4, false) this.$store.state.toast.showToast("Failed to export discussions", 4, false)
} }
this.loading = false this.loading = false
} }
@ -1717,10 +1717,10 @@ export default {
if (res) { if (res) {
this.saveJSONtoFile(res, filename) this.saveJSONtoFile(res, filename)
this.$refs.toast.showToast("Successfully exported", 4, true) this.$store.state.toast.showToast("Successfully exported", 4, true)
this.isCheckbox = false this.isCheckbox = false
} else { } else {
this.$refs.toast.showToast("Failed to export discussions", 4, false) this.$store.state.toast.showToast("Failed to export discussions", 4, false)
} }
this.loading = false this.loading = false
} }
@ -1731,10 +1731,10 @@ export default {
const res = await this.import_multiple_discussions(obj) const res = await this.import_multiple_discussions(obj)
if (res) { if (res) {
this.$refs.toast.showToast("Successfully imported (" + obj.length + ")", 4, true) this.$store.state.toast.showToast("Successfully imported (" + obj.length + ")", 4, true)
await this.list_discussions() await this.list_discussions()
} else { } else {
this.$refs.toast.showToast("Failed to import discussions", 4, false) this.$store.state.toast.showToast("Failed to import discussions", 4, false)
} }
@ -1773,7 +1773,7 @@ export default {
try { try {
this.$refs.chatBox.fileList = this.$refs.chatBox.fileList.concat(files) this.$refs.chatBox.fileList = this.$refs.chatBox.fileList.concat(files)
} catch (error) { } catch (error) {
this.$refs.toast.showToast("Failed to set filelist in chatbox\n" + error.message, 4, false) this.$store.state.toast.showToast("Failed to set filelist in chatbox\n" + error.message, 4, false)
} }
@ -1785,17 +1785,17 @@ export default {
async setFileListDiscussion(files) { async setFileListDiscussion(files) {
if (files.length > 1) { if (files.length > 1) {
this.$refs.toast.showToast("Failed to import discussions. Too many files", 4, false) this.$store.state.toast.showToast("Failed to import discussions. Too many files", 4, false)
return return
} }
const obj = await this.parseJsonFile(files[0]) const obj = await this.parseJsonFile(files[0])
const res = await this.import_multiple_discussions(obj) const res = await this.import_multiple_discussions(obj)
if (res) { if (res) {
this.$refs.toast.showToast("Successfully imported (" + obj.length + ")", 4, true) this.$store.state.toast.showToast("Successfully imported (" + obj.length + ")", 4, true)
await this.list_discussions() await this.list_discussions()
} else { } else {
this.$refs.toast.showToast("Failed to import discussions", 4, false) this.$store.state.toast.showToast("Failed to import discussions", 4, false)
} }
@ -1928,7 +1928,6 @@ export default {
Message, Message,
ChatBox, ChatBox,
WelcomeComponent, WelcomeComponent,
Toast,
ChoiceDialog, ChoiceDialog,
MessageBox, MessageBox,
ProgressBar ProgressBar
@ -2062,12 +2061,14 @@ export default {
<script setup> <script setup>
import Discussion from '../components/Discussion.vue' import Discussion from '../components/Discussion.vue'
import ChoiceDialog from '@/components/ChoiceDialog.vue'
import MessageBox from "@/components/MessageBox.vue";
import ProgressBar from "@/components/ProgressBar.vue";
import Message from '../components/Message.vue' import Message from '../components/Message.vue'
import ChatBox from '../components/ChatBox.vue' import ChatBox from '../components/ChatBox.vue'
import WelcomeComponent from '../components/WelcomeComponent.vue' import WelcomeComponent from '../components/WelcomeComponent.vue'
import Toast from '../components/Toast.vue'
import MessageBox from "@/components/MessageBox.vue";
import ProgressBar from "@/components/ProgressBar.vue";
import feather from 'feather-icons' import feather from 'feather-icons'
import axios from 'axios' import axios from 'axios'
@ -2080,7 +2081,6 @@ import { onMounted } from 'vue'
import { initFlowbite } from 'flowbite' import { initFlowbite } from 'flowbite'
import { store } from '../main' import { store } from '../main'
import ChoiceDialog from '@/components/ChoiceDialog.vue'
// initialize components based on data attribute selectors // initialize components based on data attribute selectors

View File

@ -34,21 +34,21 @@
<button <button
title="Clear uploads" title="Clear uploads"
class="text-2xl hover:text-secondary duration-75 active:scale-90" class="text-2xl hover:text-secondary duration-75 active:scale-90"
@click="api_get_req('clear_uploads').then((res)=>{if(res.status){this.$refs.toast.showToast('Success!', 4, true)}else{this.$refs.toast.showToast(['failed!'], 4, false)}})" @click="api_get_req('clear_uploads').then((res)=>{if(res.status){this.$store.state.toast.showToast('Success!', 4, true)}else{this.$store.state.toast.showToast(['failed!'], 4, false)}})"
> >
<i data-feather="trash-2"></i> <i data-feather="trash-2"></i>
</button> </button>
<button <button
title="Restart program" title="Restart program"
class="text-2xl hover:text-secondary duration-75 active:scale-90" class="text-2xl hover:text-secondary duration-75 active:scale-90"
@click="api_get_req('restart_program').then((res)=>{if(res.status){this.$refs.toast.showToast('Success!', 4, true)}else{this.$refs.toast.showToast(['failed!'], 4, false)}})" @click="api_get_req('restart_program').then((res)=>{if(res.status){this.$store.state.toast.showToast('Success!', 4, true)}else{this.$store.state.toast.showToast(['failed!'], 4, false)}})"
> >
<i data-feather="refresh-ccw"></i> <i data-feather="refresh-ccw"></i>
</button> </button>
<button <button
title="Upgrade program " title="Upgrade program "
class="text-2xl hover:text-secondary duration-75 active:scale-90" class="text-2xl hover:text-secondary duration-75 active:scale-90"
@click="api_get_req('update_software').then((res)=>{if(res.status){this.$refs.toast.showToast('Success!', 4, true)}else{this.$refs.toast.showToast('Success!', 4, true)}})" @click="api_get_req('update_software').then((res)=>{if(res.status){this.$store.state.toast.showToast('Success!', 4, true)}else{this.$store.state.toast.showToast('Success!', 4, true)}})"
> >
<i data-feather="arrow-up-circle"></i> <i data-feather="arrow-up-circle"></i>
@ -1650,7 +1650,6 @@
</div> </div>
</div> </div>
</div> </div>
<Toast ref="toast" />
<YesNoDialog ref="yesNoDialog" class="z-20" /> <YesNoDialog ref="yesNoDialog" class="z-20" />
<AddModelDialog ref="addmodeldialog" /> <AddModelDialog ref="addmodeldialog" />
<MessageBox ref="messageBox" /> <MessageBox ref="messageBox" />
@ -1751,7 +1750,6 @@ import feather from 'feather-icons'
import { nextTick, TransitionGroup } from 'vue' import { nextTick, TransitionGroup } from 'vue'
import MessageBox from "@/components/MessageBox.vue"; import MessageBox from "@/components/MessageBox.vue";
import YesNoDialog from "@/components/YesNoDialog.vue"; import YesNoDialog from "@/components/YesNoDialog.vue";
import Toast from '../components/Toast.vue'
import ModelEntry from '@/components/ModelEntry.vue'; import ModelEntry from '@/components/ModelEntry.vue';
import PersonalityViewer from '@/components/PersonalityViewer.vue'; import PersonalityViewer from '@/components/PersonalityViewer.vue';
import PersonalityEntry from "@/components/PersonalityEntry.vue"; import PersonalityEntry from "@/components/PersonalityEntry.vue";
@ -1785,7 +1783,6 @@ export default {
ModelEntry, ModelEntry,
// eslint-disable-next-line vue/no-unused-components // eslint-disable-next-line vue/no-unused-components
PersonalityViewer, PersonalityViewer,
Toast,
PersonalityEntry, PersonalityEntry,
BindingEntry, BindingEntry,
UniversalForm, UniversalForm,
@ -1895,7 +1892,7 @@ export default {
this.scrollBottom(msgList) this.scrollBottom(msgList)
}) })
if(notif.display_type==0){ if(notif.display_type==0){
this.$refs.toast.showToast(notif.content, notif.duration, notif.notification_type) this.$store.state.toast.showToast(notif.content, notif.duration, notif.notification_type)
} }
else if(notif.display_type==1){ else if(notif.display_type==1){
this.$refs.messageBox.showMessage(notif.content) this.$refs.messageBox.showMessage(notif.content)
@ -1967,7 +1964,7 @@ export default {
let model_object = this.currenModelToInstall; let model_object = this.currenModelToInstall;
if (model_object.linkNotValid) { if (model_object.linkNotValid) {
model_object.installing = false model_object.installing = false
this.$refs.toast.showToast("Link is not valid, file does not exist", 4, false) this.$store.state.toast.showToast("Link is not valid, file does not exist", 4, false)
return return
} }
let path = 'https://huggingface.co/'+model_object.model.quantizer+'/'+model_object.model.name+'/resolve/main/'+this.selected_variant.name; let path = 'https://huggingface.co/'+model_object.model.quantizer+'/'+model_object.model.name+'/resolve/main/'+this.selected_variant.name;
@ -2003,7 +2000,7 @@ export default {
console.log("Installed successfully") console.log("Installed successfully")
// Update the isInstalled property of the corresponding model // Update the isInstalled property of the corresponding model
this.$refs.toast.showToast("Model:\n" + model_object.model.name + "\ninstalled!", 4, true) this.$store.state.toast.showToast("Model:\n" + model_object.model.name + "\ninstalled!", 4, true)
this.$store.dispatch('refreshDiskUsage'); this.$store.dispatch('refreshDiskUsage');
} }
} else { } else {
@ -2014,7 +2011,7 @@ export default {
this.showProgress = false; this.showProgress = false;
console.error('Installation failed:', response.error); console.error('Installation failed:', response.error);
this.$refs.toast.showToast("Model:\n" + model_object.model.name + "\nfailed to install!", 4, false) this.$store.state.toast.showToast("Model:\n" + model_object.model.name + "\nfailed to install!", 4, false)
this.$store.dispatch('refreshDiskUsage'); this.$store.dispatch('refreshDiskUsage');
} }
console.log("Here") console.log("Here")
@ -2036,7 +2033,7 @@ export default {
axios.post('/upload_avatar', formData) axios.post('/upload_avatar', formData)
.then(response => { .then(response => {
console.log("Avatar uploaded successfully") console.log("Avatar uploaded successfully")
this.$refs.toast.showToast("Avatar uploaded successfully!", 4, true) this.$store.state.toast.showToast("Avatar uploaded successfully!", 4, true)
// Assuming the server responds with the file name after successful upload // Assuming the server responds with the file name after successful upload
const fileName = response.data.fileName; const fileName = response.data.fileName;
console.log("response",response); console.log("response",response);
@ -2052,10 +2049,10 @@ export default {
const res = await this.api_get_req('update_software') const res = await this.api_get_req('update_software')
console.log("Posting done") console.log("Posting done")
if(res.status){ if(res.status){
this.$refs.toast.showToast("Success!", 4, true) this.$store.state.toast.showToast("Success!", 4, true)
} }
else{ else{
this.$refs.toast.showToast("Failure!", 4, false) this.$store.state.toast.showToast("Failure!", 4, false)
} }
}, },
@ -2064,10 +2061,10 @@ export default {
const res = await this.api_get_req('restart_program') const res = await this.api_get_req('restart_program')
console.log("Posting done") console.log("Posting done")
if(res.status){ if(res.status){
this.$refs.toast.showToast("Success!", 4, true) this.$store.state.toast.showToast("Success!", 4, true)
} }
else{ else{
this.$refs.toast.showToast("Failure!", 4, false) this.$store.state.toast.showToast("Failure!", 4, false)
} }
}, },
on_loading_text(text){ on_loading_text(text){
@ -2195,7 +2192,7 @@ export default {
} }
this.$refs.toast.showToast("Model:\n" + model_object.name + "\ninstalled!", 4, true) this.$store.state.toast.showToast("Model:\n" + model_object.name + "\ninstalled!", 4, true)
this.$store.dispatch('refreshDiskUsage'); this.$store.dispatch('refreshDiskUsage');
} else if (response.status === 'failed') { } else if (response.status === 'failed') {
@ -2213,7 +2210,7 @@ export default {
} }
console.error('Installation failed:', response.error); console.error('Installation failed:', response.error);
this.$refs.toast.showToast("Model:\n" + model_object.name + "\nfailed to install!", 4, false) this.$store.state.toast.showToast("Model:\n" + model_object.name + "\nfailed to install!", 4, false)
this.$store.dispatch('refreshDiskUsage'); this.$store.dispatch('refreshDiskUsage');
} }
} }
@ -2282,14 +2279,14 @@ export default {
console.log('on pers', pers) console.log('on pers', pers)
// eslint-disable-next-line no-unused-vars // eslint-disable-next-line no-unused-vars
if (this.isLoading) { if (this.isLoading) {
this.$refs.toast.showToast("Loading... please wait", 4, false) this.$store.state.toast.showToast("Loading... please wait", 4, false)
} }
this.isLoading = true this.isLoading = true
console.log('selecting ', pers) console.log('selecting ', pers)
if (pers) { if (pers) {
if (pers.selected) { if (pers.selected) {
this.$refs.toast.showToast("Personality already selected", 4, true) this.$store.state.toast.showToast("Personality already selected", 4, true)
this.isLoading = false this.isLoading = false
return return
} }
@ -2302,10 +2299,10 @@ export default {
const res = await this.select_personality(pers) const res = await this.select_personality(pers)
console.log('pers is mounted', res) console.log('pers is mounted', res)
if (res && res.status && res.active_personality_id > -1) { if (res && res.status && res.active_personality_id > -1) {
this.$refs.toast.showToast("Selected personality:\n" + pers.name, 4, true) this.$store.state.toast.showToast("Selected personality:\n" + pers.name, 4, true)
} else { } else {
this.$refs.toast.showToast("Error on select personality:\n" + pers.name, 4, false) this.$store.state.toast.showToast("Error on select personality:\n" + pers.name, 4, false)
} }
this.isLoading = false this.isLoading = false
@ -2328,7 +2325,7 @@ export default {
onModelSelected(model_object, force=false) { onModelSelected(model_object, force=false) {
// eslint-disable-next-line no-unused-vars // eslint-disable-next-line no-unused-vars
if (this.isLoading) { if (this.isLoading) {
this.$refs.toast.showToast("Loading... please wait", 4, false) this.$store.state.toast.showToast("Loading... please wait", 4, false)
return return
} }
if (model_object) { if (model_object) {
@ -2338,7 +2335,7 @@ export default {
console.log("update_model",res) console.log("update_model",res)
this.configFile.model_name = model_object.model.name this.configFile.model_name = model_object.model.name
if(res.status){ if(res.status){
this.$refs.toast.showToast("Selected model:\n" + model_object.name, 4, true) this.$store.state.toast.showToast("Selected model:\n" + model_object.name, 4, true)
nextTick(() => { nextTick(() => {
feather.replace() feather.replace()
this.is_loading_zoo = false this.is_loading_zoo = false
@ -2348,7 +2345,7 @@ export default {
this.$store.commit('setIsModelOk', res); this.$store.commit('setIsModelOk', res);
}) })
}else{ }else{
this.$refs.toast.showToast("Couldn't select model:\n" + model_object.name, 4, false) this.$store.state.toast.showToast("Couldn't select model:\n" + model_object.name, 4, false)
nextTick(() => { nextTick(() => {
feather.replace() feather.replace()
}) })
@ -2359,7 +2356,7 @@ export default {
} }
} else { } else {
this.$refs.toast.showToast("Model:\n" + model_object.model.name + "\nis not installed", 4, false) this.$store.state.toast.showToast("Model:\n" + model_object.model.name + "\nis not installed", 4, false)
} }
nextTick(() => { nextTick(() => {
@ -2377,15 +2374,15 @@ export default {
content = `Model name: ${modelEntry.name}\nFile size: ${modelEntry.fileSize}\nManually downloaded model ` content = `Model name: ${modelEntry.name}\nFile size: ${modelEntry.fileSize}\nManually downloaded model `
} }
this.$refs.toast.showToast("Copied model info to clipboard!", 4, true) this.$store.state.toast.showToast("Copied model info to clipboard!", 4, true)
navigator.clipboard.writeText(content.trim()); navigator.clipboard.writeText(content.trim());
}, },
onCopyLink(modelEntry) { onCopyLink(modelEntry) {
this.$refs.toast.showToast("Copied link to clipboard!", 4, true) this.$store.state.toast.showToast("Copied link to clipboard!", 4, true)
navigator.clipboard.writeText('https://huggingface.co/'+modelEntry.model.quantizer+'/'+modelEntry.model.name); navigator.clipboard.writeText('https://huggingface.co/'+modelEntry.model.quantizer+'/'+modelEntry.model.name);
}, },
onCopyPersonalityName(personality) { onCopyPersonalityName(personality) {
this.$refs.toast.showToast("Copied name to clipboard!", 4, true) this.$store.state.toast.showToast("Copied name to clipboard!", 4, true)
navigator.clipboard.writeText(personality.name); navigator.clipboard.writeText(personality.name);
}, },
onCancelInstall() { onCancelInstall() {
@ -2399,7 +2396,7 @@ export default {
this.modelDownlaodInProgress = false this.modelDownlaodInProgress = false
this.addModel = {} this.addModel = {}
socket.emit('cancel_install', { model_name: modelEntry.model_name, binding_folder: modelEntry.binding_folder, model_url: modelEntry.model_url, patreon: model.patreon?model.patreon:"None"}); socket.emit('cancel_install', { model_name: modelEntry.model_name, binding_folder: modelEntry.binding_folder, model_url: modelEntry.model_url, patreon: model.patreon?model.patreon:"None"});
this.$refs.toast.showToast("Model installation aborted", 4, false) this.$store.state.toast.showToast("Model installation aborted", 4, false)
}, },
// Model installation // Model installation
@ -2415,12 +2412,12 @@ export default {
onCreateReference() { onCreateReference() {
axios.post("/add_reference_to_local_model",{"path": this.reference_path}).then((resp)=>{ axios.post("/add_reference_to_local_model",{"path": this.reference_path}).then((resp)=>{
if(resp.status){ if(resp.status){
this.$refs.toast.showToast("Reference created", 4, true) this.$store.state.toast.showToast("Reference created", 4, true)
this.is_loading_zoo = true; this.is_loading_zoo = true;
this.refreshModelsZoo().then(()=>{this.updateModelsZoo(); this.is_loading_zoofalse;}) this.refreshModelsZoo().then(()=>{this.updateModelsZoo(); this.is_loading_zoofalse;})
} }
else{ else{
this.$refs.toast.showToast("Couldn't create reference", 4, false) this.$store.state.toast.showToast("Couldn't create reference", 4, false)
} }
}) })
}, },
@ -2430,7 +2427,7 @@ export default {
if (!this.addModel.url) { if (!this.addModel.url) {
this.$refs.toast.showToast("Link is empty", 4, false) this.$store.state.toast.showToast("Link is empty", 4, false)
return return
} }
let path = this.addModel.url; let path = this.addModel.url;
@ -2455,7 +2452,7 @@ export default {
console.log("Installed successfully") console.log("Installed successfully")
// Update the isInstalled property of the corresponding model // Update the isInstalled property of the corresponding model
this.addModel = {} this.addModel = {}
this.$refs.toast.showToast("Model:\n" + this.addModel.model_name + "\ninstalled!", 4, true) this.$store.state.toast.showToast("Model:\n" + this.addModel.model_name + "\ninstalled!", 4, true)
this.$store.dispatch('refreshDiskUsage'); this.$store.dispatch('refreshDiskUsage');
} }
} else { } else {
@ -2464,7 +2461,7 @@ export default {
// Installation failed or encountered an error // Installation failed or encountered an error
this.modelDownlaodInProgress = false; this.modelDownlaodInProgress = false;
console.error('Installation failed:', response.error); console.error('Installation failed:', response.error);
this.$refs.toast.showToast("Model:\n" + this.addModel.model_name + "\nfailed to install!", 4, false) this.$store.state.toast.showToast("Model:\n" + this.addModel.model_name + "\nfailed to install!", 4, false)
this.$store.dispatch('refreshDiskUsage'); this.$store.dispatch('refreshDiskUsage');
} }
}; };
@ -2479,7 +2476,7 @@ export default {
if (this.uploadData.length == 0) { if (this.uploadData.length == 0) {
this.$refs.toast.showToast("No files to upload", 4, false) this.$store.state.toast.showToast("No files to upload", 4, false)
return return
} }
let path = this.addModel.url; let path = this.addModel.url;
@ -2509,7 +2506,7 @@ export default {
console.log("Installed successfully") console.log("Installed successfully")
// Update the isInstalled property of the corresponding model // Update the isInstalled property of the corresponding model
this.addModel = {} this.addModel = {}
this.$refs.toast.showToast("Model:\n" + this.addModel.model_name + "\ninstalled!", 4, true) this.$store.state.toast.showToast("Model:\n" + this.addModel.model_name + "\ninstalled!", 4, true)
this.$store.dispatch('refreshDiskUsage'); this.$store.dispatch('refreshDiskUsage');
} }
} else { } else {
@ -2520,7 +2517,7 @@ export default {
console.error('Installation failed:', response.error); console.error('Installation failed:', response.error);
this.$refs.toast.showToast("Model:\n" + this.addModel.model_name + "\nfailed to install!", 4, false) this.$store.state.toast.showToast("Model:\n" + this.addModel.model_name + "\nfailed to install!", 4, false)
this.$store.dispatch('refreshDiskUsage'); this.$store.dispatch('refreshDiskUsage');
} }
}; };
@ -2556,7 +2553,7 @@ export default {
this.refreshModelsZoo().then(()=>{this.updateModelsZoo(); this.is_loading_zoo = false;}) this.refreshModelsZoo().then(()=>{this.updateModelsZoo(); this.is_loading_zoo = false;})
this.modelsFiltered = this.models_zoo this.modelsFiltered = this.models_zoo
this.$refs.toast.showToast("Model:\n" + model_object.model.name + "\nwas uninstalled!", 4, true) this.$store.state.toast.showToast("Model:\n" + model_object.model.name + "\nwas uninstalled!", 4, true)
this.$store.dispatch('refreshDiskUsage'); this.$store.dispatch('refreshDiskUsage');
} else { } else {
console.log("uninstalling failed", response) console.log("uninstalling failed", response)
@ -2566,7 +2563,7 @@ export default {
socket.off('uninstall_progress', progressListener); socket.off('uninstall_progress', progressListener);
// eslint-disable-next-line no-undef // eslint-disable-next-line no-undef
console.error('Uninstallation failed:', response.error); console.error('Uninstallation failed:', response.error);
this.$refs.toast.showToast("Model:\n" + model_object.model.name + "\nfailed to uninstall!", 4, false) this.$store.state.toast.showToast("Model:\n" + model_object.model.name + "\nfailed to uninstall!", 4, false)
this.$store.dispatch('refreshDiskUsage'); this.$store.dispatch('refreshDiskUsage');
} }
}; };
@ -2586,7 +2583,7 @@ export default {
onBindingSelected(binding_object) { onBindingSelected(binding_object) {
console.log("Binding selected") console.log("Binding selected")
if (!binding_object.binding.installed) { if (!binding_object.binding.installed) {
this.$refs.toast.showToast("Binding is not installed:\n" + binding_object.binding.name, 4, false) this.$store.state.toast.showToast("Binding is not installed:\n" + binding_object.binding.name, 4, false)
return return
} }
this.mzc_collapsed=true; this.mzc_collapsed=true;
@ -2604,7 +2601,7 @@ export default {
// disabled for now // disabled for now
// if (binding_object.binding.folder === 'backend_template' || binding_object.binding.folder === 'binding_template') { // if (binding_object.binding.folder === 'backend_template' || binding_object.binding.folder === 'binding_template') {
// this.$refs.toast.showToast("Cannot select template", 4, false) // this.$store.state.toast.showToast("Cannot select template", 4, false)
// return // return
// } // }
@ -2619,10 +2616,10 @@ export default {
this.isLoading = false this.isLoading = false
console.log('install_binding', res) console.log('install_binding', res)
if (res.data.status) { if (res.data.status) {
this.$refs.toast.showToast("Installed binding successfully!", 4, true) this.$store.state.toast.showToast("Installed binding successfully!", 4, true)
this.update_binding(binding_object.binding.folder); this.update_binding(binding_object.binding.folder);
} else { } else {
this.$refs.toast.showToast("Could not reinstall binding", 4, false) this.$store.state.toast.showToast("Could not reinstall binding", 4, false)
} }
this.isLoading = false this.isLoading = false
@ -2634,7 +2631,7 @@ export default {
.catch(error => { .catch(error => {
this.isLoading = false this.isLoading = false
this.$refs.toast.showToast("Could not reinstall binding\n" + error.message, 4, false) this.$store.state.toast.showToast("Could not reinstall binding\n" + error.message, 4, false)
return { 'status': false } return { 'status': false }
}); //console.log('lol',binding_object) }); //console.log('lol',binding_object)
} }
@ -2662,9 +2659,9 @@ export default {
this.settingsChanged = true this.settingsChanged = true
this.binding_changed = true; this.binding_changed = true;
this.$refs.toast.showToast("Binding uninstalled successfully!", 4, true) this.$store.state.toast.showToast("Binding uninstalled successfully!", 4, true)
} else { } else {
this.$refs.toast.showToast("Could not uninstall binding", 4, false) this.$store.state.toast.showToast("Could not uninstall binding", 4, false)
} }
return res.data; return res.data;
} }
@ -2676,7 +2673,7 @@ export default {
.catch(error => { .catch(error => {
this.isLoading = false this.isLoading = false
this.$refs.toast.showToast("Could not uninstall binding\n" + error.message, 4, false) this.$store.state.toast.showToast("Could not uninstall binding\n" + error.message, 4, false)
return { 'status': false } return { 'status': false }
}); });
}, },
@ -2688,9 +2685,9 @@ export default {
this.isLoading = false this.isLoading = false
console.log('reinstall_binding', res) console.log('reinstall_binding', res)
if (res.data.status) { if (res.data.status) {
this.$refs.toast.showToast("Reinstalled binding successfully!", 4, true) this.$store.state.toast.showToast("Reinstalled binding successfully!", 4, true)
} else { } else {
this.$refs.toast.showToast("Could not reinstall binding", 4, false) this.$store.state.toast.showToast("Could not reinstall binding", 4, false)
} }
return res.data; return res.data;
} }
@ -2700,7 +2697,7 @@ export default {
.catch(error => { .catch(error => {
this.isLoading = false this.isLoading = false
this.$refs.toast.showToast("Could not reinstall binding\n" + error.message, 4, false) this.$store.state.toast.showToast("Could not reinstall binding\n" + error.message, 4, false)
return { 'status': false } return { 'status': false }
}); });
}, },
@ -2711,18 +2708,18 @@ export default {
this.isLoading = false this.isLoading = false
if (res) { if (res) {
if(res.status){ if(res.status){
this.$refs.toast.showToast("Upgraded to GPU", 4, true) this.$store.state.toast.showToast("Upgraded to GPU", 4, true)
this.configFile.enable_gpu=true this.configFile.enable_gpu=true
} }
else{ else{
this.$refs.toast.showToast("Could not upgrade to GPU. Endpoint error: " + res.error, 4, false) this.$store.state.toast.showToast("Could not upgrade to GPU. Endpoint error: " + res.error, 4, false)
} }
} }
}) })
} }
catch (error) { catch (error) {
this.isLoading = false this.isLoading = false
this.$refs.toast.showToast("Could not open binding settings. Endpoint error: " + error.message, 4, false) this.$store.state.toast.showToast("Could not open binding settings. Endpoint error: " + error.message, 4, false)
} }
}, },
onSettingsExtension(extensionEntry){ onSettingsExtension(extensionEntry){
@ -2743,23 +2740,23 @@ export default {
if (response && response.data) { if (response && response.data) {
console.log('extension set with new settings', response.data) console.log('extension set with new settings', response.data)
this.$refs.toast.showToast("Extension settings updated successfully!", 4, true) this.$store.state.toast.showToast("Extension settings updated successfully!", 4, true)
} else { } else {
this.$refs.toast.showToast("Did not get Extension settings responses.\n" + response, 4, false) this.$store.state.toast.showToast("Did not get Extension settings responses.\n" + response, 4, false)
this.isLoading = false this.isLoading = false
} }
}) })
} catch (error) { } catch (error) {
this.$refs.toast.showToast("Did not get Extension settings responses.\n Endpoint error: " + error.message, 4, false) this.$store.state.toast.showToast("Did not get Extension settings responses.\n Endpoint error: " + error.message, 4, false)
this.isLoading = false this.isLoading = false
} }
}) })
} else { } else {
this.$refs.toast.showToast("Extension has no settings", 4, false) this.$store.state.toast.showToast("Extension has no settings", 4, false)
this.isLoading = false this.isLoading = false
} }
@ -2768,7 +2765,7 @@ export default {
} catch (error) { } catch (error) {
this.isLoading = false this.isLoading = false
this.$refs.toast.showToast("Could not open personality settings. Endpoint error: " + error.message, 4, false) this.$store.state.toast.showToast("Could not open personality settings. Endpoint error: " + error.message, 4, false)
} }
}, },
@ -2793,17 +2790,17 @@ export default {
if (response && response.data) { if (response && response.data) {
console.log('binding set with new settings', response.data) console.log('binding set with new settings', response.data)
this.$refs.toast.showToast("Binding settings updated successfully!", 4, true) this.$store.state.toast.showToast("Binding settings updated successfully!", 4, true)
} else { } else {
this.$refs.toast.showToast("Did not get binding settings responses.\n" + response, 4, false) this.$store.state.toast.showToast("Did not get binding settings responses.\n" + response, 4, false)
this.isLoading = false this.isLoading = false
} }
}) })
} catch (error) { } catch (error) {
this.$refs.toast.showToast("Did not get binding settings responses.\n Endpoint error: " + error.message, 4, false) this.$store.state.toast.showToast("Did not get binding settings responses.\n Endpoint error: " + error.message, 4, false)
this.isLoading = false this.isLoading = false
} }
@ -2811,7 +2808,7 @@ export default {
}) })
} else { } else {
this.$refs.toast.showToast("Binding has no settings", 4, false) this.$store.state.toast.showToast("Binding has no settings", 4, false)
this.isLoading = false this.isLoading = false
} }
@ -2820,7 +2817,7 @@ export default {
} catch (error) { } catch (error) {
this.isLoading = false this.isLoading = false
this.$refs.toast.showToast("Could not open binding settings. Endpoint error: " + error.message, 4, false) this.$store.state.toast.showToast("Could not open binding settings. Endpoint error: " + error.message, 4, false)
} }
}, },
onReloadBinding(binding_object){ onReloadBinding(binding_object){
@ -2832,9 +2829,9 @@ export default {
this.isLoading = false this.isLoading = false
console.log('reload_binding', res) console.log('reload_binding', res)
if (res.data.status) { if (res.data.status) {
this.$refs.toast.showToast("Binding reloaded successfully!", 4, true) this.$store.state.toast.showToast("Binding reloaded successfully!", 4, true)
} else { } else {
this.$refs.toast.showToast("Could not reinstall binding", 4, false) this.$store.state.toast.showToast("Could not reinstall binding", 4, false)
} }
return res.data; return res.data;
} }
@ -2844,7 +2841,7 @@ export default {
.catch(error => { .catch(error => {
this.isLoading = false this.isLoading = false
this.$refs.toast.showToast("Could not reinstall binding\n" + error.message, 4, false) this.$store.state.toast.showToast("Could not reinstall binding\n" + error.message, 4, false)
return { 'status': false } return { 'status': false }
}); });
}, },
@ -2867,23 +2864,23 @@ export default {
if (response && response.data) { if (response && response.data) {
console.log('personality set with new settings', response.data) console.log('personality set with new settings', response.data)
this.$refs.toast.showToast("Personality settings updated successfully!", 4, true) this.$store.state.toast.showToast("Personality settings updated successfully!", 4, true)
} else { } else {
this.$refs.toast.showToast("Did not get Personality settings responses.\n" + response, 4, false) this.$store.state.toast.showToast("Did not get Personality settings responses.\n" + response, 4, false)
this.isLoading = false this.isLoading = false
} }
}) })
} catch (error) { } catch (error) {
this.$refs.toast.showToast("Did not get Personality settings responses.\n Endpoint error: " + error.message, 4, false) this.$store.state.toast.showToast("Did not get Personality settings responses.\n Endpoint error: " + error.message, 4, false)
this.isLoading = false this.isLoading = false
} }
}) })
} else { } else {
this.$refs.toast.showToast("Personality has no settings", 4, false) this.$store.state.toast.showToast("Personality has no settings", 4, false)
this.isLoading = false this.isLoading = false
} }
@ -2892,7 +2889,7 @@ export default {
} catch (error) { } catch (error) {
this.isLoading = false this.isLoading = false
this.$refs.toast.showToast("Could not open personality settings. Endpoint error: " + error.message, 4, false) this.$store.state.toast.showToast("Could not open personality settings. Endpoint error: " + error.message, 4, false)
} }
}, },
@ -2958,10 +2955,10 @@ export default {
this.isLoading = false this.isLoading = false
console.log('update_setting', res) console.log('update_setting', res)
if(res['status']){ if(res['status']){
this.$refs.toast.showToast("Setting updated successfully.\n", 4, true) this.$store.state.toast.showToast("Setting updated successfully.\n", 4, true)
} }
else{ else{
this.$refs.toast.showToast("Setting update failed.\nPlease view the console for more details.", 4, false) this.$store.state.toast.showToast("Setting update failed.\nPlease view the console for more details.", 4, false)
} }
if (next !== undefined) { if (next !== undefined) {
next(res) next(res)
@ -3152,12 +3149,12 @@ export default {
//console.log('apply-res',res) //console.log('apply-res',res)
if (res.data.status) { if (res.data.status) {
this.$refs.toast.showToast("Configuration changed successfully.", 4, true) this.$store.state.toast.showToast("Configuration changed successfully.", 4, true)
this.settingsChanged = false this.settingsChanged = false
//this.save_configuration() //this.save_configuration()
} else { } else {
this.$refs.toast.showToast("Configuration change failed.", 4, false) this.$store.state.toast.showToast("Configuration change failed.", 4, false)
} }
nextTick(() => { nextTick(() => {
@ -3485,7 +3482,7 @@ export default {
if (this.configFile.personalities.includes(pers.personality.full_path)) { if (this.configFile.personalities.includes(pers.personality.full_path)) {
this.isLoading = false this.isLoading = false
this.$refs.toast.showToast("Personality already mounted", 4, false) this.$store.state.toast.showToast("Personality already mounted", 4, false)
return return
} }
@ -3495,18 +3492,18 @@ export default {
if (res && res.status && res.active_personality_id > -1 && res.personalities.includes(pers.personality.full_path)) { if (res && res.status && res.active_personality_id > -1 && res.personalities.includes(pers.personality.full_path)) {
this.configFile.personalities = res.personalities this.configFile.personalities = res.personalities
this.$refs.toast.showToast("Personality mounted", 4, true) this.$store.state.toast.showToast("Personality mounted", 4, true)
pers.isMounted = true pers.isMounted = true
const res2 = await this.select_personality(pers.personality) const res2 = await this.select_personality(pers.personality)
if (res2.status) { if (res2.status) {
this.$refs.toast.showToast("Selected personality:\n" + pers.personality.name, 4, true) this.$store.state.toast.showToast("Selected personality:\n" + pers.personality.name, 4, true)
} }
this.$store.dispatch('refreshMountedPersonalities'); this.$store.dispatch('refreshMountedPersonalities');
} else { } else {
pers.isMounted = false pers.isMounted = false
this.$refs.toast.showToast("Could not mount personality\nError: " + res.error + "\nResponse:\n" + res, 4, false) this.$store.state.toast.showToast("Could not mount personality\nError: " + res.error + "\nResponse:\n" + res, 4, false)
} }
this.isLoading = false this.isLoading = false
@ -3520,7 +3517,7 @@ export default {
if (res.status) { if (res.status) {
this.configFile.personalities = res.personalities this.configFile.personalities = res.personalities
this.$refs.toast.showToast("Personality unmounted", 4, true) this.$store.state.toast.showToast("Personality unmounted", 4, true)
const persId = this.personalities.findIndex(item => item.full_path == pers.full_path) const persId = this.personalities.findIndex(item => item.full_path == pers.full_path)
const persFilteredId = this.personalitiesFiltered.findIndex(item => item.full_path == pers.full_path) const persFilteredId = this.personalitiesFiltered.findIndex(item => item.full_path == pers.full_path)
const persIdZoo = this.$refs.personalitiesZoo.findIndex(item => item.full_path == pers.full_path) const persIdZoo = this.$refs.personalitiesZoo.findIndex(item => item.full_path == pers.full_path)
@ -3548,13 +3545,13 @@ export default {
// const res2 = await this.select_personality(lastPers.personality) // const res2 = await this.select_personality(lastPers.personality)
const res2 = await this.select_personality(pers.personality) const res2 = await this.select_personality(pers.personality)
if (res2.status) { if (res2.status) {
this.$refs.toast.showToast("Selected personality:\n" + lastPers.name, 4, true) this.$store.state.toast.showToast("Selected personality:\n" + lastPers.name, 4, true)
} }
} else { } else {
this.$refs.toast.showToast("Could not unmount personality\nError: " + res.error, 4, false) this.$store.state.toast.showToast("Could not unmount personality\nError: " + res.error, 4, false)
} }
this.isLoading = false this.isLoading = false
@ -3571,7 +3568,7 @@ export default {
if (this.configFile.personalities.includes(ext.extension.full_path)) { if (this.configFile.personalities.includes(ext.extension.full_path)) {
this.isLoading = false this.isLoading = false
this.$refs.toast.showToast("Extension already mounted", 4, false) this.$store.state.toast.showToast("Extension already mounted", 4, false)
return return
} }
@ -3581,12 +3578,12 @@ export default {
if (res && res.status && res.extensions.includes(ext.extension.full_path)) { if (res && res.status && res.extensions.includes(ext.extension.full_path)) {
this.configFile.extensions = res.extensions this.configFile.extensions = res.extensions
this.$refs.toast.showToast("Extension mounted", 4, true) this.$store.state.toast.showToast("Extension mounted", 4, true)
ext.isMounted = true ext.isMounted = true
this.$store.dispatch('refreshMountedExtensions'); this.$store.dispatch('refreshMountedExtensions');
} else { } else {
ext.isMounted = false ext.isMounted = false
this.$refs.toast.showToast("Could not mount extension\nError: " + res.error + "\nResponse:\n" + res, 4, false) this.$store.state.toast.showToast("Could not mount extension\nError: " + res.error + "\nResponse:\n" + res, 4, false)
} }
this.isLoading = false this.isLoading = false
@ -3600,7 +3597,7 @@ export default {
if (res.status) { if (res.status) {
this.configFile.extensions = res.extensions this.configFile.extensions = res.extensions
this.$refs.toast.showToast("Extension unmounted", 4, true) this.$store.state.toast.showToast("Extension unmounted", 4, true)
const extId = this.extensions.findIndex(item => item.full_path == ext.full_path) const extId = this.extensions.findIndex(item => item.full_path == ext.full_path)
const persFilteredId = this.extensionsFiltered.findIndex(item => item.full_path == ext.full_path) const persFilteredId = this.extensionsFiltered.findIndex(item => item.full_path == ext.full_path)
const extIdZoo = this.$refs.extensionsZoo.findIndex(item => item.full_path == ext.full_path) const extIdZoo = this.$refs.extensionsZoo.findIndex(item => item.full_path == ext.full_path)
@ -3628,7 +3625,7 @@ export default {
} else { } else {
this.$refs.toast.showToast("Could not unmount extension\nError: " + res.error, 4, false) this.$store.state.toast.showToast("Could not unmount extension\nError: " + res.error, 4, false)
} }
this.isLoading = false this.isLoading = false
@ -3647,9 +3644,9 @@ export default {
this.isLoading = false this.isLoading = false
console.log('reinstall_extension', res) console.log('reinstall_extension', res)
if (res.data.status) { if (res.data.status) {
this.$refs.toast.showToast("Extension reinstalled successfully!", 4, true) this.$store.state.toast.showToast("Extension reinstalled successfully!", 4, true)
} else { } else {
this.$refs.toast.showToast("Could not reinstall extension", 4, false) this.$store.state.toast.showToast("Could not reinstall extension", 4, false)
} }
return res.data; return res.data;
} }
@ -3659,7 +3656,7 @@ export default {
.catch(error => { .catch(error => {
this.isLoading = false this.isLoading = false
this.$refs.toast.showToast("Could not reinstall personality\n" + error.message, 4, false) this.$store.state.toast.showToast("Could not reinstall personality\n" + error.message, 4, false)
return { 'status': false } return { 'status': false }
}); });
}, },
@ -3673,9 +3670,9 @@ export default {
this.isLoading = false this.isLoading = false
console.log('reinstall_personality', res) console.log('reinstall_personality', res)
if (res.data.status) { if (res.data.status) {
this.$refs.toast.showToast("Personality reinstalled successfully!", 4, true) this.$store.state.toast.showToast("Personality reinstalled successfully!", 4, true)
} else { } else {
this.$refs.toast.showToast("Could not reinstall personality", 4, false) this.$store.state.toast.showToast("Could not reinstall personality", 4, false)
} }
return res.data; return res.data;
} }
@ -3685,7 +3682,7 @@ export default {
.catch(error => { .catch(error => {
this.isLoading = false this.isLoading = false
this.$refs.toast.showToast("Could not reinstall personality\n" + error.message, 4, false) this.$store.state.toast.showToast("Could not reinstall personality\n" + error.message, 4, false)
return { 'status': false } return { 'status': false }
}); });
}, },

@ -1 +1 @@
Subproject commit b024a4ac7e11d105e730431bb776628772ee910e Subproject commit 7ac68c7e29775c79d97f3d1bd1aa2c7b5a46151f

@ -1 +1 @@
Subproject commit 2f6f4ca2fd8b5b8889c792095ba5b65b920c175e Subproject commit 4107557398450addb7500e06d80f26b37f572805

@ -1 +1 @@
Subproject commit ed82b8044a4913359e33d7e587209c1b46eb2514 Subproject commit d878a3f015abab65019ee84098852168190d31cd