diff --git a/src/components/Footer/FooterBar.vue b/src/components/Footer/FooterBar.vue index 88379473f7..9717124536 100644 --- a/src/components/Footer/FooterBar.vue +++ b/src/components/Footer/FooterBar.vue @@ -53,7 +53,30 @@ > {{ $t("footer.sendPrompt") }} -
+
+ + + + {{ + $t("footer.disableAll") + }} + + + {{ + $t("footer.enableAll") + }} + + + bot.classname === botClassname); + if (bot && bot.instance && !bot.instance.isAvailable()) { + const availability = await bot.instance.checkAvailability(); + if (!availability) { + clickedBot.value = bot.instance; + // Open the bot's settings dialog + isMakeAvailableOpen.value = true; + } else { + updateActiveBots(); + } + } else { + await store.dispatch("setBotSelected", { + botClassname, + selected: true, + }); + } + } + } +} + defineExpose({ focusPromptTextarea, }); diff --git a/src/i18n/locales/en.json b/src/i18n/locales/en.json index b9b0810e3e..36c2f60b97 100644 --- a/src/i18n/locales/en.json +++ b/src/i18n/locales/en.json @@ -33,7 +33,9 @@ "openSource": "Open Source", "free": "Free", "paid": "Paid", - "api": "API" + "api": "API", + "enableAll": "Enable All", + "disableAll": "Disable All" }, "error": { "error": "Error", diff --git a/src/i18n/locales/zh.json b/src/i18n/locales/zh.json index 0c48c1ea6e..351177cb30 100644 --- a/src/i18n/locales/zh.json +++ b/src/i18n/locales/zh.json @@ -33,7 +33,8 @@ "openSource": "开源", "free": "免费", "paid": "付费", - "api": "API" + "enableAll": "全部启用", + "disableAll": "全部禁用" }, "error": { "error": "错误", @@ -335,4 +336,4 @@ "25": "25", "50": "50", "100": "100" -} \ No newline at end of file +} diff --git a/src/store/index.js b/src/store/index.js index 071f4fe05a..9a728914c7 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -413,6 +413,19 @@ export default createStore({ }, }, actions: { + async setBotSelected(_, { botClassname, selected }) { + const currentChat = await Chats.getCurrentChat(); + for (let i = 0; i < currentChat.favBots.length; i++) { + const bot = currentChat.favBots[i]; + if (bot.classname === botClassname) { + bot.selected = selected; + await Chats.table.update(currentChat.index, { + favBots: currentChat.favBots, + }); + return; + } + } + }, async sendPrompt({ commit, dispatch }, { prompt, bots, promptIndex }) { const currentChat = await Chats.getCurrentChat(); if (promptIndex === undefined) {