conditional copy button save, if have engine params changes value button should be save & reload
This commit is contained in:
parent
bf9cd4443c
commit
0f333c35f5
@ -187,6 +187,10 @@ const Sidebar: React.FC = () => {
|
|||||||
return changedFieldValues
|
return changedFieldValues
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const isEngineParamsChanges = componentDataEngineSetting.some((x) =>
|
||||||
|
Object.keys(form.formState.dirtyFields).includes(x.name)
|
||||||
|
)
|
||||||
|
|
||||||
const onSubmit = async (values: any) => {
|
const onSubmit = async (values: any) => {
|
||||||
if (!threadId) return
|
if (!threadId) return
|
||||||
if (!activeThread) return
|
if (!activeThread) return
|
||||||
@ -334,19 +338,19 @@ const Sidebar: React.FC = () => {
|
|||||||
</div>
|
</div>
|
||||||
{/* Temporary disabled */}
|
{/* Temporary disabled */}
|
||||||
{/* <div>
|
{/* <div>
|
||||||
<label
|
<label
|
||||||
id="tool-title"
|
id="tool-title"
|
||||||
className="mb-2 inline-block font-bold text-zinc-500 dark:text-gray-300"
|
className="mb-2 inline-block font-bold text-zinc-500 dark:text-gray-300"
|
||||||
>
|
>
|
||||||
Tools
|
Tools
|
||||||
</label>
|
|
||||||
<div className="flex items-center justify-between">
|
|
||||||
<label className="font-medium text-zinc-500 dark:text-gray-300">
|
|
||||||
Retrieval
|
|
||||||
</label>
|
</label>
|
||||||
<Switch name="retrieval" />
|
<div className="flex items-center justify-between">
|
||||||
</div>
|
<label className="font-medium text-zinc-500 dark:text-gray-300">
|
||||||
</div> */}
|
Retrieval
|
||||||
|
</label>
|
||||||
|
<Switch name="retrieval" />
|
||||||
|
</div>
|
||||||
|
</div> */}
|
||||||
</div>
|
</div>
|
||||||
</CardSidebar>
|
</CardSidebar>
|
||||||
<CardSidebar
|
<CardSidebar
|
||||||
@ -401,7 +405,7 @@ const Sidebar: React.FC = () => {
|
|||||||
<Tooltip open={currentPrompt.length !== 0}>
|
<Tooltip open={currentPrompt.length !== 0}>
|
||||||
<TooltipTrigger asChild>
|
<TooltipTrigger asChild>
|
||||||
<Button type="submit" block>
|
<Button type="submit" block>
|
||||||
Save
|
{isEngineParamsChanges ? 'Save & Reload' : 'Save'}
|
||||||
</Button>
|
</Button>
|
||||||
</TooltipTrigger>
|
</TooltipTrigger>
|
||||||
<TooltipPortal>
|
<TooltipPortal>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user