fixed database loading error

This commit is contained in:
Saifeddine ALOUI 2024-03-03 20:12:33 +01:00
parent 1aaa4e320a
commit 97ab6c62a3
5 changed files with 209 additions and 192 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 @@
<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-5d830b39.js"></script> <script type="module" crossorigin src="/assets/index-d69a2aee.js"></script>
<link rel="stylesheet" href="/assets/index-8e397dc7.css"> <link rel="stylesheet" href="/assets/index-ea2ac17b.css">
</head> </head>
<body> <body>
<div id="app"></div> <div id="app"></div>

View File

@ -1,13 +1,13 @@
<template> <template>
<transition name="fade"> <transition name="fade">
<div v-if="showPopup" class="fixed inset-0 flex items-center justify-center z-50"> <div v-if="showPopup" class="fixed inset-0 flex items-center justify-center z-50 mt-15">
<div class="bg-white dark:bg-gray-800 rounded shadow p-6 m-4 w-full h-full text-center overflow-auto relative"> <div class="bg-white dark:bg-gray-800 rounded shadow p-6 m-4 w-full h-full text-center overflow-auto relative">
<button @click="hide" class="absolute top-0 right-0 m-4 bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded"> <button @click="hide" class="absolute top-0 right-0 m-4 bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded">
X X
</button> </button>
<iframe :src="webpageUrl" class="w-full h-full"></iframe> <iframe :src="webpageUrl" class="m-15 w-full h-full"></iframe>
<div class="absolute bottom-0 mb-4 w-full text-center"> <div class="absolute bottom-0 mb-4 w-full text-center">
<input type="checkbox" id="startup" name="startup" value="startup"> <input type="checkbox" id="startup" v-model="this.$store.state.config.show_news_panel" @change="save_configuration">
<label for="startup" class="m-5">Show at startup</label> <label for="startup" class="m-5">Show at startup</label>
</div> </div>
</div> </div>
@ -18,6 +18,8 @@
<script> <script>
import axios from "axios";
export default { export default {
data() { data() {
return { return {
@ -32,6 +34,20 @@ export default {
hide() { hide() {
this.showPopup = false; this.showPopup = false;
}, },
save_configuration() {
axios.post('/apply_settings', {"config":this.$store.state.config}).then((res) => {
this.isLoading = false;
if (res.data.status) {
this.$store.state.toast.showToast("Configuration changed successfully.", 4, true)
this.settingsChanged = false
} else {
this.$store.state.toast.showToast("Configuration change failed.", 4, false)
}
})
},
}, },
}; };
</script> </script>

View File

@ -535,7 +535,7 @@ export default {
onclosedatabase_selectorDialog(){this.database_selectorDialogVisible=false;}, onclosedatabase_selectorDialog(){this.database_selectorDialogVisible=false;},
async onvalidatedatabase_selectorChoice(choice){ async onvalidatedatabase_selectorChoice(choice){
this.database_selectorDialogVisible=false; this.database_selectorDialogVisible=false;
const res = await axios.post("/select_database", {"name": choice}, {headers: this.posts_headers}); const res = await axios.post("/select_database", {"client_id":this.client_id, "name": choice}, {headers: this.posts_headers});
if(res.status){ if(res.status){
console.log("Selected database") console.log("Selected database")
this.$store.state.config = await axios.get("/get_config"); this.$store.state.config = await axios.get("/get_config");
@ -2012,7 +2012,8 @@ export default {
}) })
} }
if (this.$store.state.config.show_news_panel)
this.$store.state.news.show()
}, },
components: { components: {
Discussion, Discussion,