From 0eabcc0d0a5f2034259c198068229fefc08dc561 Mon Sep 17 00:00:00 2001
From: heimoshuiyu
Date: Tue, 16 Jan 2024 17:48:41 +0800
Subject: [PATCH] show all saved apis
---
src/chatbox.tsx | 123 ++++++++++++++++---------------------
src/listToolsTemplates.tsx | 13 +++-
2 files changed, 64 insertions(+), 72 deletions(-)
diff --git a/src/chatbox.tsx b/src/chatbox.tsx
index 435ec62..4fc5952 100644
--- a/src/chatbox.tsx
+++ b/src/chatbox.tsx
@@ -464,81 +464,62 @@ export default function ChatBOX(props: {
{Tr("Please click above to set")} API Endpoint
)}
- {templateAPIs.length > 0 &&
- (chatStore.develop_mode ||
- chatStore.history.filter((msg) => !msg.example).length == 0 ||
- !chatStore.apiEndpoint ||
- !chatStore.apiKey) && (
-
- )}
+ {templateAPIs.length > 0 && (
+
+ )}
- {templateAPIsWhisper.length > 0 &&
- (chatStore.develop_mode ||
- chatStore.history.filter((msg) => !msg.example).length == 0 ||
- !chatStore.whisper_api ||
- !chatStore.whisper_key) && (
-
- )}
+ {templateAPIsWhisper.length > 0 && (
+
+ )}
- {templateAPIsTTS.length > 0 &&
- (chatStore.develop_mode ||
- chatStore.history.filter((msg) => !msg.example).length == 0 ||
- !chatStore.tts_api ||
- !chatStore.tts_key) && (
-
- )}
+ {templateAPIsTTS.length > 0 && (
+
+ )}
- {templateAPIsImageGen.length > 0 &&
- (chatStore.develop_mode ||
- chatStore.history.filter((msg) => !msg.example).length == 0 ||
- !chatStore.image_gen_api ||
- !chatStore.image_gen_key) && (
-
- )}
+ {templateAPIsImageGen.length > 0 && (
+
+ )}
- {toolsTemplates.length > 0 &&
- (chatStore.develop_mode ||
- chatStore.history.filter((msg) => !msg.example).length == 0 ||
- !chatStore.toolsString) && (
-
- )}
+ {toolsTemplates.length > 0 && (
+
+ )}
{chatStore.history.filter((msg) => !msg.example).length == 0 && (
diff --git a/src/listToolsTemplates.tsx b/src/listToolsTemplates.tsx
index 41591a5..580208f 100644
--- a/src/listToolsTemplates.tsx
+++ b/src/listToolsTemplates.tsx
@@ -15,7 +15,18 @@ export function ListToolsTempaltes({
}: Props) {
return (
-
{Tr(`Saved tools templates`)}
+
+ {Tr(`Saved tools templates`)}
+
+
{templateTools.map((t, index) => (