mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-26 00:46:52 +08:00
Iframe should support input variables (#5156)
### What problem does this PR solve? Right now we cannot embed a chat in website when it has variables in the begin component. This PR tries to read the variables values from the query string via a data_ prefixed variable. #5016 ### Type of change - [x] New Feature (non-breaking change which adds functionality) --------- Co-authored-by: gstrat88 <gstrat@innews.gr>
This commit is contained in:
@ -9,7 +9,7 @@ import { useCallback } from 'react';
|
||||
import { Link, useParams } from 'umi';
|
||||
import {
|
||||
useGetBeginNodeDataQuery,
|
||||
useGetBeginNodeDataQueryIsEmpty,
|
||||
useGetBeginNodeDataQueryIsSafe,
|
||||
} from '../hooks/use-get-begin-query';
|
||||
import {
|
||||
useSaveGraph,
|
||||
@ -35,7 +35,7 @@ const FlowHeader = ({ showChatDrawer, chatDrawerVisible }: IProps) => {
|
||||
const getBeginNodeDataQuery = useGetBeginNodeDataQuery();
|
||||
const { showEmbedModal, hideEmbedModal, embedVisible, beta } =
|
||||
useShowEmbedModal();
|
||||
const isBeginNodeDataQueryEmpty = useGetBeginNodeDataQueryIsEmpty();
|
||||
const isBeginNodeDataQuerySafe = useGetBeginNodeDataQueryIsSafe();
|
||||
|
||||
const handleShowEmbedModal = useCallback(() => {
|
||||
showEmbedModal();
|
||||
@ -79,7 +79,7 @@ const FlowHeader = ({ showChatDrawer, chatDrawerVisible }: IProps) => {
|
||||
<Button
|
||||
type="primary"
|
||||
onClick={handleShowEmbedModal}
|
||||
disabled={!isBeginNodeDataQueryEmpty}
|
||||
disabled={!isBeginNodeDataQuerySafe}
|
||||
>
|
||||
<b>{t('embedIntoSite', { keyPrefix: 'common' })}</b>
|
||||
</Button>
|
||||
|
||||
Reference in New Issue
Block a user