Feature/add rendering html tags for share chatbot (#3343)
add rendering html tags for share chatbot
This commit is contained in:
parent
4a9ffe7b99
commit
a0d93f910f
|
|
@ -56,6 +56,7 @@ const ShareChatbot = ({ isSessionMemory, isAgentCanvas }) => {
|
||||||
|
|
||||||
const [isPublicChatflow, setChatflowIsPublic] = useState(chatflow.isPublic ?? false)
|
const [isPublicChatflow, setChatflowIsPublic] = useState(chatflow.isPublic ?? false)
|
||||||
const [generateNewSession, setGenerateNewSession] = useState(chatbotConfig?.generateNewSession ?? false)
|
const [generateNewSession, setGenerateNewSession] = useState(chatbotConfig?.generateNewSession ?? false)
|
||||||
|
const [renderHTML, setRenderHTML] = useState(chatbotConfig?.renderHTML ?? false)
|
||||||
|
|
||||||
const [title, setTitle] = useState(chatbotConfig?.title ?? '')
|
const [title, setTitle] = useState(chatbotConfig?.title ?? '')
|
||||||
const [titleAvatarSrc, setTitleAvatarSrc] = useState(chatbotConfig?.titleAvatarSrc ?? '')
|
const [titleAvatarSrc, setTitleAvatarSrc] = useState(chatbotConfig?.titleAvatarSrc ?? '')
|
||||||
|
|
@ -138,6 +139,12 @@ const ShareChatbot = ({ isSessionMemory, isAgentCanvas }) => {
|
||||||
|
|
||||||
if (isSessionMemory) obj.overrideConfig.generateNewSession = generateNewSession
|
if (isSessionMemory) obj.overrideConfig.generateNewSession = generateNewSession
|
||||||
|
|
||||||
|
if (renderHTML) {
|
||||||
|
obj.overrideConfig.renderHTML = true
|
||||||
|
} else {
|
||||||
|
obj.overrideConfig.renderHTML = false
|
||||||
|
}
|
||||||
|
|
||||||
if (chatbotConfig?.starterPrompts) obj.starterPrompts = chatbotConfig.starterPrompts
|
if (chatbotConfig?.starterPrompts) obj.starterPrompts = chatbotConfig.starterPrompts
|
||||||
|
|
||||||
if (isAgentCanvas) {
|
if (isAgentCanvas) {
|
||||||
|
|
@ -312,6 +319,9 @@ const ShareChatbot = ({ isSessionMemory, isAgentCanvas }) => {
|
||||||
case 'showAgentMessages':
|
case 'showAgentMessages':
|
||||||
setShowAgentMessages(value)
|
setShowAgentMessages(value)
|
||||||
break
|
break
|
||||||
|
case 'renderHTML':
|
||||||
|
setRenderHTML(value)
|
||||||
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -480,6 +490,13 @@ const ShareChatbot = ({ isSessionMemory, isAgentCanvas }) => {
|
||||||
{textField(textInputPlaceholder, 'textInputPlaceholder', 'TextInput Placeholder', 'string', `Type question..`)}
|
{textField(textInputPlaceholder, 'textInputPlaceholder', 'TextInput Placeholder', 'string', `Type question..`)}
|
||||||
{colorField(textInputSendButtonColor, 'textInputSendButtonColor', 'TextIntput Send Button Color')}
|
{colorField(textInputSendButtonColor, 'textInputSendButtonColor', 'TextIntput Send Button Color')}
|
||||||
|
|
||||||
|
<>
|
||||||
|
<Typography variant='h4' sx={{ mb: 1, mt: 2 }}>
|
||||||
|
Render HTML
|
||||||
|
</Typography>
|
||||||
|
{booleanField(renderHTML, 'renderHTML', 'Render HTML on the chat')}
|
||||||
|
</>
|
||||||
|
|
||||||
{/*Session Memory Input*/}
|
{/*Session Memory Input*/}
|
||||||
{isSessionMemory && (
|
{isSessionMemory && (
|
||||||
<>
|
<>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue