mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-06-01 16:03:38 +08:00
feat(logAndAnn): add control option for question editing feature (#19117)
This commit is contained in:
parent
d70fa2847b
commit
5088ab5061
@ -429,6 +429,7 @@ function DetailPanel({ detail, onFeedback }: IDetailPanel) {
|
|||||||
text_to_speech: {
|
text_to_speech: {
|
||||||
enabled: true,
|
enabled: true,
|
||||||
},
|
},
|
||||||
|
questionEditEnable: false,
|
||||||
supportAnnotation: true,
|
supportAnnotation: true,
|
||||||
annotation_reply: {
|
annotation_reply: {
|
||||||
enabled: true,
|
enabled: true,
|
||||||
@ -484,6 +485,7 @@ function DetailPanel({ detail, onFeedback }: IDetailPanel) {
|
|||||||
text_to_speech: {
|
text_to_speech: {
|
||||||
enabled: true,
|
enabled: true,
|
||||||
},
|
},
|
||||||
|
questionEditEnable: false,
|
||||||
supportAnnotation: true,
|
supportAnnotation: true,
|
||||||
annotation_reply: {
|
annotation_reply: {
|
||||||
enabled: true,
|
enabled: true,
|
||||||
|
@ -265,6 +265,7 @@ const Chat: FC<ChatProps> = ({
|
|||||||
item={item}
|
item={item}
|
||||||
questionIcon={questionIcon}
|
questionIcon={questionIcon}
|
||||||
theme={themeBuilder?.theme}
|
theme={themeBuilder?.theme}
|
||||||
|
enableEdit={config?.questionEditEnable}
|
||||||
switchSibling={switchSibling}
|
switchSibling={switchSibling}
|
||||||
/>
|
/>
|
||||||
)
|
)
|
||||||
|
@ -28,6 +28,7 @@ type QuestionProps = {
|
|||||||
item: ChatItem
|
item: ChatItem
|
||||||
questionIcon?: ReactNode
|
questionIcon?: ReactNode
|
||||||
theme: Theme | null | undefined
|
theme: Theme | null | undefined
|
||||||
|
enableEdit?: boolean
|
||||||
switchSibling?: (siblingMessageId: string) => void
|
switchSibling?: (siblingMessageId: string) => void
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -35,6 +36,7 @@ const Question: FC<QuestionProps> = ({
|
|||||||
item,
|
item,
|
||||||
questionIcon,
|
questionIcon,
|
||||||
theme,
|
theme,
|
||||||
|
enableEdit = true,
|
||||||
switchSibling,
|
switchSibling,
|
||||||
}) => {
|
}) => {
|
||||||
const { t } = useTranslation()
|
const { t } = useTranslation()
|
||||||
@ -87,9 +89,9 @@ const Question: FC<QuestionProps> = ({
|
|||||||
}}>
|
}}>
|
||||||
<RiClipboardLine className='h-4 w-4' />
|
<RiClipboardLine className='h-4 w-4' />
|
||||||
</ActionButton>
|
</ActionButton>
|
||||||
<ActionButton onClick={handleEdit}>
|
{enableEdit && <ActionButton onClick={handleEdit}>
|
||||||
<RiEditLine className='h-4 w-4' />
|
<RiEditLine className='h-4 w-4' />
|
||||||
</ActionButton>
|
</ActionButton>}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
|
@ -46,6 +46,7 @@ export type EnableType = {
|
|||||||
export type ChatConfig = Omit<ModelConfig, 'model'> & {
|
export type ChatConfig = Omit<ModelConfig, 'model'> & {
|
||||||
supportAnnotation?: boolean
|
supportAnnotation?: boolean
|
||||||
appId?: string
|
appId?: string
|
||||||
|
questionEditEnable?: boolean
|
||||||
supportFeedback?: boolean
|
supportFeedback?: boolean
|
||||||
supportCitationHitInfo?: boolean
|
supportCitationHitInfo?: boolean
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user