mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-30 10:28:42 +00:00
Support simpleApp select workflow (#2772)
* fix: share page id error * feat: simple workflow support childApp tool * perf: aichat box animation
This commit is contained in:
@@ -378,7 +378,23 @@ export function form2AppWorkflow(
|
||||
y: 545
|
||||
},
|
||||
version: tool.version,
|
||||
inputs: tool.inputs,
|
||||
inputs: tool.inputs.map((input) => {
|
||||
// Special key value
|
||||
if (input.key === NodeInputKeyEnum.forbidStream) {
|
||||
input.value = true;
|
||||
}
|
||||
// Special tool
|
||||
if (
|
||||
tool.flowNodeType === FlowNodeTypeEnum.appModule &&
|
||||
input.key === NodeInputKeyEnum.history
|
||||
) {
|
||||
return {
|
||||
...input,
|
||||
value: formData.aiSettings.maxHistories
|
||||
};
|
||||
}
|
||||
return input;
|
||||
}),
|
||||
outputs: tool.outputs
|
||||
}
|
||||
],
|
||||
|
@@ -1,25 +1,34 @@
|
||||
import { create } from 'zustand';
|
||||
import { devtools, persist } from 'zustand/middleware';
|
||||
import { immer } from 'zustand/middleware/immer';
|
||||
import { customAlphabet } from 'nanoid';
|
||||
const nanoid = customAlphabet(
|
||||
'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWSYZ1234567890_',
|
||||
24
|
||||
);
|
||||
|
||||
type State = {
|
||||
localUId: string;
|
||||
setLocalUId: (id: string) => void;
|
||||
loaded: boolean;
|
||||
};
|
||||
|
||||
export const useShareChatStore = create<State>()(
|
||||
devtools(
|
||||
persist(
|
||||
immer((set, get) => ({
|
||||
localUId: '',
|
||||
setLocalUId(id) {
|
||||
set((state) => {
|
||||
state.localUId = id;
|
||||
});
|
||||
}
|
||||
localUId: `shareChat-${Date.now()}-${nanoid()}`,
|
||||
loaded: false
|
||||
})),
|
||||
{
|
||||
name: 'shareChatStore'
|
||||
name: 'shareChatStore',
|
||||
onRehydrateStorage: () => (state) => {
|
||||
if (state) {
|
||||
state.loaded = true;
|
||||
}
|
||||
},
|
||||
partialize: (state) => ({
|
||||
localUId: state.localUId
|
||||
})
|
||||
}
|
||||
)
|
||||
)
|
||||
|
Reference in New Issue
Block a user