fix: add plugin activation check and corresponding messages in Knowledge Base
This commit is contained in:
@@ -101,6 +101,7 @@
|
||||
},
|
||||
"messages": {
|
||||
"pluginNotAvailable": "Plugin not installed or unavailable",
|
||||
"pluginNotActivated": "astrbot_plugin_knowledge_base plugin not activated, please activate it in the plugin management page and restart AstrBot",
|
||||
"checkPluginFailed": "Failed to check plugin",
|
||||
"installFailed": "Installation failed",
|
||||
"installPluginFailed": "Failed to install plugin",
|
||||
|
||||
@@ -101,6 +101,7 @@
|
||||
},
|
||||
"messages": {
|
||||
"pluginNotAvailable": "插件未安装或不可用",
|
||||
"pluginNotActivated": "astrbot_plugin_knowledge_base 插件未启用,请前往插件管理页面启用,然后重启 AstrBot。",
|
||||
"checkPluginFailed": "检查插件失败",
|
||||
"installFailed": "安装失败",
|
||||
"installPluginFailed": "安装插件失败",
|
||||
|
||||
@@ -603,6 +603,11 @@ export default {
|
||||
.then(response => {
|
||||
if (response.data.status !== 'ok') {
|
||||
this.showSnackbar(this.tm('messages.pluginNotAvailable'), 'error');
|
||||
return
|
||||
}
|
||||
if (!response.data.data.activated) {
|
||||
this.showSnackbar(this.tm('messages.pluginNotActivated'), 'error');
|
||||
return
|
||||
}
|
||||
if (response.data.data.length > 0) {
|
||||
this.installed = true;
|
||||
@@ -708,6 +713,10 @@ export default {
|
||||
getKBCollections() {
|
||||
axios.get('/api/plug/alkaid/kb/collections')
|
||||
.then(response => {
|
||||
if (response.data.status !== 'ok') {
|
||||
this.showSnackbar(response.data.message || this.tm('messages.getKnowledgeBaseListFailed'), 'error');
|
||||
return;
|
||||
}
|
||||
this.kbCollections = response.data.data;
|
||||
})
|
||||
.catch(error => {
|
||||
|
||||
Reference in New Issue
Block a user