small fixex and toast box fixes

This commit is contained in:
AndzejsP 2023-05-20 13:27:41 +03:00
parent 162c79718b
commit 76520f6cb5
2 changed files with 29 additions and 6 deletions

View File

@ -14,7 +14,7 @@
<i data-feather="x"></i>
<span class="sr-only">Cross icon</span>
</div>
<div class="ml-3 text-sm font-normal">{{ message }}</div>
<span class="ml-3 text-sm font-normal whitespace-pre">{{ message }}</span>
</slot>
</div>
@ -58,6 +58,7 @@ export default {
this.success = success;
this.message = message;
this.show = true;
setTimeout(() => {
this.$emit('close')
this.show = false
@ -72,7 +73,9 @@ export default {
this.$emit('close')
this.show = false
}, 3000);
}
}
}
}

View File

@ -81,7 +81,7 @@
class="text-2xl hover:text-primary duration-75 p-2 -m-2 w-full text-left active:translate-y-1 flex items-center">
<i :data-feather="mzc_collapsed ? 'chevron-right' : 'chevron-down'" class="mr-2"></i>
<h3 class="text-lg font-semibold cursor-pointer select-none">
Models configuration</h3>
Model configuration</h3>
</button>
</div>
<div :class="{ 'hidden': mzc_collapsed }" class="flex flex-col mb-2 px-3 pb-0">
@ -432,8 +432,17 @@ export default {
console.log("Selected model")
// eslint-disable-next-line no-unused-vars
if (model_object) {
this.update_model(model_object.title)
this.configFile.model = model_object.title
if (model_object.isInstalled) {
this.update_model(model_object.title)
this.configFile.model = model_object.title
this.$refs.toast.showToast("Model:\n" + model_object.title + "\nselected", 4, true)
} else {
this.$refs.toast.showToast("Model:\n" + model_object.title + "\nis not installed", 4, false)
}
nextTick(() => {
feather.replace()
})
}
//this.update_setting('model', model_object.title, (res)=>{console.log("Model selected"); })
@ -576,7 +585,16 @@ export default {
if (res.data.status === "succeeded") {
console.log("applying configuration succeeded")
this.$refs.toast.showToast("Configuration changed successfully.", 4, true)
}else{
console.log("applying configuration failed")
this.$refs.toast.showToast("Configuration changed failed.", 4, false)
}
nextTick(() => {
feather.replace()
})
})
},
save_configuration() {
@ -651,7 +669,8 @@ export default {
})
this.configFile = await this.api_get_req("get_config")
this.fetchModels();
this.models = await this.api_get_req("get_available_models")
//this.fetchModels();
this.backendsArr = await this.api_get_req("list_backends")
this.modelsArr = await this.api_get_req("list_models")
this.persLangArr = await this.api_get_req("list_personalities_languages")
@ -729,4 +748,5 @@ export default {
100% {
transform: rotate(360deg);
}
}</style>
}
</style>