Feat/attachments (#9526)

Co-authored-by: Joel <iamjoel007@gmail.com>
Co-authored-by: JzoNg <jzongcode@gmail.com>
This commit is contained in:
zxhlyh
2024-10-21 10:32:37 +08:00
committed by GitHub
parent 4fd2743efa
commit 7a1d6fe509
445 changed files with 11759 additions and 6922 deletions

View File

@@ -109,6 +109,8 @@ type Shape = {
setEnvSecrets: (envSecrets: Record<string, string>) => void
showChatVariablePanel: boolean
setShowChatVariablePanel: (showChatVariablePanel: boolean) => void
showGlobalVariablePanel: boolean
setShowGlobalVariablePanel: (showGlobalVariablePanel: boolean) => void
conversationVariables: ConversationVariable[]
setConversationVariables: (conversationVariables: ConversationVariable[]) => void
selection: null | { x1: number; y1: number; x2: number; y2: number }
@@ -167,6 +169,12 @@ type Shape = {
}
export const createWorkflowStore = () => {
const hideAllPanel = {
showDebugAndPreviewPanel: false,
showEnvPanel: false,
showChatVariablePanel: false,
showGlobalVariablePanel: false,
}
return createStore<Shape>(set => ({
appId: '',
panelWidth: localStorage.getItem('workflow-node-panel-width') ? parseFloat(localStorage.getItem('workflow-node-panel-width')!) : 420,
@@ -227,6 +235,13 @@ export const createWorkflowStore = () => {
setEnvSecrets: envSecrets => set(() => ({ envSecrets })),
showChatVariablePanel: false,
setShowChatVariablePanel: showChatVariablePanel => set(() => ({ showChatVariablePanel })),
showGlobalVariablePanel: false,
setShowGlobalVariablePanel: showGlobalVariablePanel => set(() => {
if (showGlobalVariablePanel)
return { ...hideAllPanel, showGlobalVariablePanel: true }
else
return { showGlobalVariablePanel: false }
}),
conversationVariables: [],
setConversationVariables: conversationVariables => set(() => ({ conversationVariables })),
selection: null,