fixed some bugs

This commit is contained in:
Saifeddine ALOUI 2023-10-21 20:48:12 +02:00
parent be5a720537
commit 0bd357bdf1
7 changed files with 56 additions and 35 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">
<title>LoLLMS WebUI - Welcome</title>
<script type="module" crossorigin src="/assets/index-fe322430.js"></script>
<link rel="stylesheet" href="/assets/index-19262763.css">
<script type="module" crossorigin src="/assets/index-0f920b17.js"></script>
<link rel="stylesheet" href="/assets/index-9dbe9b50.css">
</head>
<body>
<div id="app"></div>

View File

@ -76,20 +76,39 @@ export default {
const updateMarkdown = () => {
if (props.markdownText) {
let tokens = md.parse(props.markdownText, {});
markdownItems.value = tokens.map(token => {
if (token.type === 'fence') {
return {
type: 'code',
language: escapeHtml(token.info),
code: token.content,
};
} else {
return {
type: 'html',
html: md.renderer.render([token], md.options, {}),
};
let cumulated = [];
markdownItems.value = []
for (let i = 0; i < tokens.length; i++) {
if (tokens[i].type !== 'fence') {
cumulated.push(tokens[i]);
}
});
else{
if(cumulated.length>0){
markdownItems.value.push(
{
type: 'html',
html: md.renderer.render(cumulated, md.options, {}),
});
cumulated = []
}
markdownItems.value.push(
{
type: 'code',
language: escapeHtml(tokens[i].info),
code: tokens[i].content,
}
)
}
}
if(cumulated.length>0){
markdownItems.value.push(
{
type: 'html',
html: md.renderer.render(cumulated, md.options, {}),
});
cumulated = []
}
} else {
markdownItems.value = [];
}
@ -101,6 +120,7 @@ export default {
onMounted(updateMarkdown);
return { markdownItems };
},
};
</script>
<style>

View File

@ -96,7 +96,7 @@
</div>
<button v-if="!showBrainConfirmation" title="Activate Long term Memory" class="text-2xl hover:text-secondary duration-75 active:scale-90"
@click="toggleLTM()">
<img v-if="isLoading" :src="SVGOrangeBrain" width="25" height="25">
<img v-if="isLoading" :src="SVGOrangeBrain" width="25" height="25" class="animate-pulse" title="Applying config, please stand by...">
<img v-else-if="UseDiscussionHistory" :src="SVGGreenBrain" width="25" height="25">
<img v-else :src="SVGRedBrain" width="25" height="25">
</button>
@ -451,7 +451,6 @@ export default {
this.applyConfiguration();
},
applyConfiguration() {
this.isLoading = true;
axios.post('/apply_settings', {"config":this.$store.state.config}).then((res) => {
this.isLoading = false;
@ -464,8 +463,10 @@ export default {
}
nextTick(() => {
feather.replace()
})
}).catch((err)=>{
this.isLoading = false;
this.$refs.toast.showToast("Configuration change failed.", 4, false)
})
},
save_configuration() {

View File

@ -3169,7 +3169,7 @@ export default {
this.api_get_req("list_extensions_categories").then((cats)=>{
console.log("cats",cats)
this.persCatgArr = cats
this.extCatgArr = cats
this.extensionsFiltererd = this.$store.state.extensionsZoo.filter((item) => item.category === this.extension_category)
this.extensionsFiltererd.sort()

@ -1 +1 @@
Subproject commit 0ca465ff8137896994c4d02a522278bd01d34659
Subproject commit 49dd3fc22cdb9801c466c5674fe0441b23fe5af1