From 4063b3ab3bbabc377e5f53f554134ac407110f0e Mon Sep 17 00:00:00 2001 From: Henry Date: Mon, 5 Jun 2023 00:49:22 +0100 Subject: [PATCH] add embed code customization --- .../src/ui-component/dialog/APICodeDialog.js | 66 +++++++++++++++++++ 1 file changed, 66 insertions(+) diff --git a/packages/ui/src/ui-component/dialog/APICodeDialog.js b/packages/ui/src/ui-component/dialog/APICodeDialog.js index 94001528199..55aeca75c73 100644 --- a/packages/ui/src/ui-component/dialog/APICodeDialog.js +++ b/packages/ui/src/ui-component/dialog/APICodeDialog.js @@ -129,6 +129,51 @@ const embedCode = (chatflowid) => { ` } +const embedCodeCustomization = (chatflowid) => { + return `` +} + const APICodeDialog = ({ show, dialogProps, onCancel }) => { const portalElement = document.getElementById('portal') const navigate = useNavigate() @@ -140,6 +185,7 @@ const APICodeDialog = ({ show, dialogProps, onCancel }) => { const [chatflowApiKeyId, setChatflowApiKeyId] = useState('') const [selectedApiKey, setSelectedApiKey] = useState({}) const [checkboxVal, setCheckbox] = useState(false) + const [embedChatCheckboxVal, setEmbedChatCheckbox] = useState(false) const getAllAPIKeysApi = useApi(apiKeyApi.getAllAPIKeys) const updateChatflowApi = useApi(chatflowsApi.updateChatflow) @@ -152,6 +198,10 @@ const APICodeDialog = ({ show, dialogProps, onCancel }) => { } } + const onCheckBoxEmbedChatChanged = (newVal) => { + setEmbedChatCheckbox(newVal) + } + const onApiKeySelected = (keyValue) => { if (keyValue === 'addnewkey') { navigate('/apikey') @@ -588,6 +638,22 @@ query({ /> )} + {value === 0 && ( + + )} + {value === 0 && embedChatCheckboxVal && ( + + )} ))}