| | |
| | | import PromptLogModal from '@/app/components/base/prompt-log-modal' |
| | | import { useStore as useAppStore } from '@/app/components/app/store' |
| | | import { useFeatures, useFeaturesStore } from '@/app/components/base/features/hooks' |
| | | import { noop } from 'lodash-es' |
| | | |
| | | type IDebug = { |
| | | isAPIKeySet: boolean |
| | |
| | | return ( |
| | | <> |
| | | <div className="shrink-0"> |
| | | <div className='flex items-center justify-between px-4 pb-2 pt-3'> |
| | | <div className='system-xl-semibold text-text-primary'>{t('appDebug.inputs.title')}</div> |
| | | <div className='flex items-center justify-between px-4 pt-3 pb-2'> |
| | | <div className='text-text-primary system-xl-semibold'>{t('appDebug.inputs.title')}</div> |
| | | <div className='flex items-center'> |
| | | { |
| | | debugWithMultipleModel |
| | |
| | | onClick={() => onMultipleModelConfigsChange(true, [...multipleModelConfigs, { id: `${Date.now()}`, model: '', provider: '', parameters: {} }])} |
| | | disabled={multipleModelConfigs.length >= 4} |
| | | > |
| | | <RiAddLine className='mr-1 h-3.5 w-3.5' /> |
| | | <RiAddLine className='mr-1 w-3.5 h-3.5' /> |
| | | {t('common.modelProvider.addModel')}({multipleModelConfigs.length}/4) |
| | | </Button> |
| | | <div className='mx-2 h-[14px] w-[1px] bg-divider-regular' /> |
| | | <div className='mx-2 w-[1px] h-[14px] bg-divider-regular' /> |
| | | </> |
| | | ) |
| | | : null |
| | |
| | | popupContent={t('common.operation.refresh')} |
| | | > |
| | | <ActionButton onClick={clearConversation}> |
| | | <RefreshCcw01 className='h-4 w-4' /> |
| | | <RefreshCcw01 className='w-4 h-4' /> |
| | | </ActionButton> |
| | | </TooltipPlus> |
| | | {varList.length > 0 && ( |
| | |
| | | popupContent={t('workflow.panel.userInputField')} |
| | | > |
| | | <ActionButton state={expanded ? ActionButtonState.Active : undefined} onClick={() => setExpanded(!expanded)}> |
| | | <RiEqualizer2Line className='h-4 w-4' /> |
| | | <RiEqualizer2Line className='w-4 h-4' /> |
| | | </ActionButton> |
| | | </TooltipPlus> |
| | | {expanded && <div className='absolute bottom-[-14px] right-[5px] z-10 h-3 w-3 rotate-45 border-l-[0.5px] border-t-[0.5px] border-components-panel-border-subtle bg-components-panel-on-panel-item-bg' />} |
| | | {expanded && <div className='absolute z-10 bottom-[-14px] right-[5px] w-3 h-3 bg-components-panel-on-panel-item-bg border-l-[0.5px] border-t-[0.5px] border-components-panel-border-subtle rotate-45' />} |
| | | </div> |
| | | )} |
| | | </> |
| | |
| | | </div> |
| | | { |
| | | debugWithMultipleModel && ( |
| | | <div className='mt-3 grow overflow-hidden' ref={ref}> |
| | | <div className='grow mt-3 overflow-hidden' ref={ref}> |
| | | <DebugWithMultipleModel |
| | | multipleModelConfigs={multipleModelConfigs} |
| | | onMultipleModelConfigsChange={onMultipleModelConfigsChange} |
| | |
| | | } |
| | | { |
| | | !debugWithMultipleModel && ( |
| | | <div className="flex grow flex-col" ref={ref}> |
| | | <div className="flex flex-col grow" ref={ref}> |
| | | {/* Chat */} |
| | | {mode !== AppType.completion && ( |
| | | <div className='h-0 grow overflow-hidden'> |
| | | <div className='grow h-0 overflow-hidden'> |
| | | <DebugWithSingleModel |
| | | ref={debugWithSingleModelRef} |
| | | checkCanSend={checkCanSend} |
| | |
| | | isInstalledApp={false} |
| | | messageId={messageId} |
| | | isError={false} |
| | | onRetry={noop} |
| | | onRetry={() => { }} |
| | | supportAnnotation |
| | | appId={appId} |
| | | varList={varList} |
| | | siteInfo={null} |
| | | /> |
| | | </div> |
| | | </> |
| | | )} |
| | | {!completionRes && !isResponding && ( |
| | | <div className='flex grow flex-col items-center justify-center gap-2'> |
| | | <RiSparklingFill className='h-12 w-12 text-text-empty-state-icon' /> |
| | | <div className='system-sm-regular text-text-quaternary'>{t('appDebug.noResult')}</div> |
| | | <div className='grow flex flex-col items-center justify-center gap-2'> |
| | | <RiSparklingFill className='w-12 h-12 text-text-empty-state-icon' /> |
| | | <div className='text-text-quaternary system-sm-regular'>{t('appDebug.noResult')}</div> |
| | | </div> |
| | | )} |
| | | </> |