Skip to content

Commit

Permalink
add remove all button
Browse files Browse the repository at this point in the history
  • Loading branch information
asyncButNeverAwaits authored and sunner committed Apr 13, 2024
1 parent 3493bf1 commit da5257b
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 9 deletions.
11 changes: 10 additions & 1 deletion src/components/Footer/FooterBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,11 @@
$t("footer.enableAll")
}}</v-list-item-title>
</v-list-item>
<v-list-item @click="removeAllBots">
<v-list-item-title>{{
$t("footer.removeAll")
}}</v-list-item-title>
</v-list-item>
</v-list>
</v-menu>
<BotLogo
Expand Down Expand Up @@ -424,7 +429,7 @@ const x = ref(0);
const y = ref(0);
function show(e) {
x.value = e.clientX;
y.value = e.clientY - 72;
y.value = e.clientY - 160;
showMenu.value = true;
}
Expand Down Expand Up @@ -459,6 +464,10 @@ async function enableAllBots() {
}
}
function removeAllBots() {
store.commit("setFavoriteBot", []);
}
defineExpose({
focusPromptTextarea,
});
Expand Down
15 changes: 8 additions & 7 deletions src/i18n/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@
"paid": "Paid",
"api": "API",
"enableAll": "Enable All",
"disableAll": "Disable All"
"disableAll": "Disable All",
"removeAll": "Remove All"
},
"error": {
"error": "Error",
Expand Down Expand Up @@ -120,14 +121,14 @@
"gemini-pro": "Gemini",
"gemini-ultra": "Gemini Advanced"
},
"claudeApi":{
"claudeApi": {
"name": "Claude API",
"claude-3-opus-20240229" : "claude-3-opus",
"claude-3-opus-20240229": "claude-3-opus",
"claude-3-sonnet-20240229": "claude-3-sonnet",
"claude-3-haiku-20240307": "claude-3-haiku",
"claude-21":"claude-2.1",
"claude-20":"claude-2.0",
"claude-instant-12":"claude-instant"
"claude-21": "claude-2.1",
"claude-20": "claude-2.0",
"claude-instant-12": "claude-instant"
},
"bingChat": {
"name": "Copilot",
Expand Down Expand Up @@ -359,4 +360,4 @@
"25": "25",
"50": "50",
"100": "100"
}
}
3 changes: 2 additions & 1 deletion src/i18n/locales/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@
"free": "免费",
"paid": "付费",
"enableAll": "全部启用",
"disableAll": "全部禁用"
"disableAll": "全部禁用",
"removeAll": "全部删除"
},
"error": {
"error": "错误",
Expand Down
6 changes: 6 additions & 0 deletions src/store/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,12 @@ export default createStore({
favBots,
});
},
async setFavoriteBot(state, favBots) {
const currentChat = await Chats.getCurrentChat();
Chats.table.update(currentChat.index, {
favBots,
});
},
async removeFavoriteBot(state, botClassname) {
const currentChat = await Chats.getCurrentChat();
for (let i = 0; i < currentChat.favBots.length; i++) {
Expand Down

0 comments on commit da5257b

Please sign in to comment.