Fixed database loading and creation

This commit is contained in:
Saifeddine ALOUI 2024-09-22 15:15:34 +02:00
parent 45aa636d86
commit 70f86767aa
5 changed files with 23 additions and 9 deletions

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 @@
<script src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-svg.js"></script>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>LoLLMS WebUI</title>
<script type="module" crossorigin src="/assets/index-e60b333e.js"></script>
<link rel="stylesheet" href="/assets/index-f7ef3f13.css">
<script type="module" crossorigin src="/assets/index-10f963c7.js"></script>
<link rel="stylesheet" href="/assets/index-9cbc113c.css">
</head>
<body>
<div id="app"></div>

View File

@ -905,7 +905,13 @@ export default {
onclosedatabase_selectorDialog(){this.database_selectorDialogVisible=false;},
async onvalidatedatabase_selectorChoice(choice){
this.database_selectorDialogVisible=false;
const res = await axios.post("/select_database", {"client_id":this.client_id, "name": choice}, {headers: this.posts_headers});
const data = {
"client_id": this.client_id,
"name": typeof choice === 'string' ? choice : choice.name
};
console.log("data:")
console.log(data)
const res = await axios.post("/select_database", data, {headers: this.posts_headers});
if(res.status){
console.log("Selected database")
this.$store.state.config = await axios.post("/get_config",{"client_id":this.client_id});

View File

@ -466,6 +466,14 @@ export default {
}
this.$store.dispatch('refreshMountedPersonalities');
const hostnameParts = window.location.href.split('/');
if(hostnameParts.length > 4){
window.location.href='/'
}
else{
window.location.reload(true);
}
} else {
pers.isMounted = false
this.$store.state.toast.showToast("Could not mount personality\nError: " + res.error + "\nResponse:\n" + res, 4, false)