Commit 13174aac authored by StyleZhang's avatar StyleZhang

debug and preview

parent 74f02363
import UserInput from './user-input'
import Chat from '@/app/components/base/chat/chat' import Chat from '@/app/components/base/chat/chat'
import { useChat } from '@/app/components/base/chat/chat/hooks' import { useChat } from '@/app/components/base/chat/chat/hooks'
const ChatWrapper = () => { const ChatWrapper = () => {
const { const {
handleStop, handleStop,
isResponsing, isResponding,
suggestedQuestions, suggestedQuestions,
} = useChat() } = useChat()
return ( return (
<Chat <Chat
chatList={[]} chatList={[]}
isResponsing={isResponsing} isResponding={isResponding}
chatContainerclassName='px-4' chatContainerclassName='px-4'
chatContainerInnerClassName='px-4' chatContainerInnerClassName='px-4'
chatFooterClassName='pb-4' chatFooterClassName='pb-4'
chatFooterInnerClassName='px-4' chatFooterInnerClassName='px-4'
onSend={() => {}} onSend={() => {}}
onStopResponding={handleStop} onStopResponding={handleStop}
chatNode={( chatNode={<UserInput />}
<div className='h-[150px] rounded-xl bg-white shadow-xs'></div>
)}
allToolIcons={{}} allToolIcons={{}}
suggestedQuestions={suggestedQuestions} suggestedQuestions={suggestedQuestions}
/> />
......
import type { FC } from 'react' import type { FC } from 'react'
import { useTranslation } from 'react-i18next'
import ChatWrapper from './chat-wrapper' import ChatWrapper from './chat-wrapper'
const DebugAndPreview: FC = () => { const DebugAndPreview: FC = () => {
const { t } = useTranslation()
return ( return (
<div <div
className='flex flex-col w-[400px] h-full rounded-l-2xl border border-black/[0.02] shadow-xl' className='flex flex-col w-[400px] h-full rounded-l-2xl border border-black/[0.02] shadow-xl'
style={{ background: 'linear-gradient(156deg, rgba(242, 244, 247, 0.80) 0%, rgba(242, 244, 247, 0.00) 99.43%), var(--white, #FFF)' }} style={{ background: 'linear-gradient(156deg, rgba(242, 244, 247, 0.80) 0%, rgba(242, 244, 247, 0.00) 99.43%), var(--white, #FFF)' }}
> >
<div className='shrink-0 flex items-center justify-between px-4 pt-3 pb-2'> <div className='shrink-0 flex items-center justify-between px-4 pt-3 pb-2 font-semibold text-gray-900'>
Debug and Preview {t('workflow.common.debugAndPreview').toLocaleUpperCase()}
<div className='h-8' /> <div className='h-8' />
</div> </div>
<div className='grow rounded-b-2xl'> <div className='grow rounded-b-2xl'>
......
import {
memo,
useState,
} from 'react'
import { useTranslation } from 'react-i18next'
import { ChevronDown } from '@/app/components/base/icons/src/vender/line/arrows'
const UserInput = () => {
const { t } = useTranslation()
const [expanded, setExpanded] = useState(true)
return (
<div
className={`
rounded-xl border
${!expanded ? 'bg-indigo-25 border-indigo-100 shadow-none' : 'bg-white shadow-xs border-transparent'}
`}
>
<div
className={`
flex items-center px-2 pt-4 h-[18px] text-[13px] font-semibold cursor-pointer
${!expanded ? 'text-indigo-800' : 'text-gray-800'}
`}
onClick={() => setExpanded(!expanded)}
>
<ChevronDown
className={`mr-1 w-3 h-3 ${!expanded ? '-rotate-90 text-indigo-600' : 'text-gray-300'}`}
/>
{t('workflow.panel.userInputField').toLocaleUpperCase()}
</div>
<div className='px-2 pt-1 pb-3'>
{
expanded && (
<div className='py-2 text-[13px] text-gray-900'>
<div className='flex px-4 py-1'>
<div className='shrink-0 mr-4 leading-8'>Service Name</div>
<input className='grow px-3 h-8 appearance-none outline-none rounded-lg bg-gray-100' />
</div>
</div>
)
}
</div>
</div>
)
}
export default memo(UserInput)
import { memo } from 'react'
import Run from '../run' import Run from '../run'
import { useStore } from '../store'
import { XClose } from '@/app/components/base/icons/src/vender/line/general'
const Record = () => { const Record = () => {
return ( return (
<div className='flex flex-col w-[400px] h-full rounded-2xl border-[0.5px] border-gray-200 shadow-xl bg-white'> <div className='flex flex-col w-[400px] h-full rounded-2xl border-[0.5px] border-gray-200 shadow-xl bg-white'>
<div className='p-4 pb-1 text-base font-semibold text-gray-900'> <div className='flex items-center justify-between p-4 pb-1 text-base font-semibold text-gray-900'>
Test Run#5 Test Run#5
<div
className='flex items-center justify-center w-6 h-6 cursor-pointer'
onClick={() => useStore.setState({ runTaskId: '' })}
>
<XClose className='w-4 h-4 text-gray-500' />
</div>
</div> </div>
<Run activeTab='RESULT' appId='' /> <Run activeTab='RESULT' appId='' />
</div> </div>
) )
} }
export default Record export default memo(Record)
import { memo } from 'react' import { memo } from 'react'
import { useTranslation } from 'react-i18next'
import { XClose } from '@/app/components/base/icons/src/vender/line/general' import { XClose } from '@/app/components/base/icons/src/vender/line/general'
import { AlertCircle } from '@/app/components/base/icons/src/vender/line/alertsAndFeedback' import { AlertCircle } from '@/app/components/base/icons/src/vender/line/alertsAndFeedback'
import { useStore } from '@/app/components/workflow/store' import { useStore } from '@/app/components/workflow/store'
import { useStore as useAppStore } from '@/app/components/app/store' import { useStore as useAppStore } from '@/app/components/app/store'
const RunHistory = () => { const RunHistory = () => {
const { t } = useTranslation()
const appDetail = useAppStore(state => state.appDetail) const appDetail = useAppStore(state => state.appDetail)
return ( return (
<div className='ml-2 w-[200px] h-full bg-white border-[0.5px] border-gray-200 shadow-xl rounded-l-2xl'> <div className='ml-2 w-[200px] h-full bg-white border-[0.5px] border-gray-200 shadow-xl rounded-l-2xl'>
<div className='flex items-center justify-between px-4 pt-3 text-base font-semibold text-gray-900'> <div className='flex items-center justify-between px-4 pt-3 text-base font-semibold text-gray-900'>
Run History {t('workflow.common.runHistory')}
<div <div
className='flex items-center justify-center w-6 h-6 cursor-pointer' className='flex items-center justify-center w-6 h-6 cursor-pointer'
onClick={() => useStore.setState({ showRunHistory: false })} onClick={() => useStore.setState({ showRunHistory: false })}
......
...@@ -47,6 +47,9 @@ const translation = { ...@@ -47,6 +47,9 @@ const translation = {
zoomTo100: 'Zoom to 100%', zoomTo100: 'Zoom to 100%',
zoomToFit: 'Zoom to Fit', zoomToFit: 'Zoom to Fit',
}, },
panel: {
userInputField: 'User Input Field',
},
nodes: { nodes: {
common: { common: {
outputVars: 'Output Variables', outputVars: 'Output Variables',
......
...@@ -47,6 +47,9 @@ const translation = { ...@@ -47,6 +47,9 @@ const translation = {
zoomTo100: '放大到 100%', zoomTo100: '放大到 100%',
zoomToFit: '自适应视图', zoomToFit: '自适应视图',
}, },
panel: {
userInputField: '用户输入字段',
},
nodes: { nodes: {
common: { common: {
outputVars: '输出变量', outputVars: '输出变量',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment