Commit fa3eb11b authored by JzoNg's avatar JzoNg

old app do not support duplicate and export dsl

parent beff31b0
......@@ -177,7 +177,7 @@ const AppCard = ({ app, onRefresh }: AppCardProps) => {
<span className={s.actionName}>{t('common.operation.settings')}</span>
</button>
<Divider className="!my-1" />
{app.mode !== 'completion' && (
{(app.mode === 'workflow' || app.mode === 'agent-chat' || app.mode === 'advanced-chat' || (app.mode === 'chat' && detailState.detail?.model_config.prompt_type === 'simple')) && (
<>
<button className={s.actionItem} onClick={onClickDuplicate} disabled={detailState.loading}>
<span className={s.actionName}>{t('app.duplicate')}</span>
......@@ -221,6 +221,10 @@ const AppCard = ({ app, onRefresh }: AppCardProps) => {
<div className={style.listItemHeadingContent}>{app.name}</div>
</div>
{isCurrentWorkspaceManager && <CustomPopover
onTriggerClick={() => {
if (app.mode === 'chat' && !detailState.detail)
getAppDetail()
}}
htmlContent={<Operations />}
position="br"
trigger="click"
......
......@@ -177,7 +177,10 @@ const AppInfo = ({ expand }: IAppInfoProps) => {
</>
)}
{appDetail.mode === 'completion' && (
<div className='shrink-0 px-1 border bg-white border-[rgba(0,0,0,0.08)] rounded-[5px] truncate'>{t('app.types.completion').toUpperCase()}</div>
<>
<div className='shrink-0 px-1 border bg-white border-[rgba(0,0,0,0.08)] rounded-[5px] truncate'>{t('app.types.completion').toUpperCase()}</div>
<div title={t('app.newApp.basic') || ''} className='px-1 border bg-white border-[rgba(0,0,0,0.08)] rounded-[5px] truncate'>{(t('app.newApp.basic').toUpperCase())}</div>
</>
)}
{appDetail.mode === 'workflow' && (
<div className='shrink-0 px-1 border bg-white border-[rgba(0,0,0,0.08)] rounded-[5px] truncate'>{t('app.types.workflow').toUpperCase()}</div>
......@@ -213,7 +216,10 @@ const AppInfo = ({ expand }: IAppInfoProps) => {
</>
)}
{appDetail.mode === 'completion' && (
<div className='shrink-0 px-1 border bg-white border-[rgba(0,0,0,0.08)] rounded-[5px] truncate'>{t('app.types.completion').toUpperCase()}</div>
<>
<div className='shrink-0 px-1 border bg-white border-[rgba(0,0,0,0.08)] rounded-[5px] truncate'>{t('app.types.completion').toUpperCase()}</div>
<div title={t('app.newApp.basic') || ''} className='px-1 border bg-white border-[rgba(0,0,0,0.08)] rounded-[5px] truncate'>{(t('app.newApp.basic').toUpperCase())}</div>
</>
)}
{appDetail.mode === 'workflow' && (
<div className='shrink-0 px-1 border bg-white border-[rgba(0,0,0,0.08)] rounded-[5px] truncate'>{t('app.types.workflow').toUpperCase()}</div>
......
......@@ -441,7 +441,7 @@ const Configuration: FC = () => {
model_id: model.name,
mode: model.mode,
configs: {
prompt_template: modelConfig.pre_prompt,
prompt_template: modelConfig.pre_prompt || '',
prompt_variables: userInputsFormToPromptVariables(
[
...modelConfig.user_input_form,
......
......@@ -17,6 +17,7 @@ type IPopover = {
btnElement?: string | React.ReactNode
btnClassName?: string | ((open: boolean) => string)
manualClose?: boolean
onTriggerClick?: () => void
}
const timeoutDuration = 100
......@@ -30,6 +31,7 @@ export default function CustomPopover({
className,
btnClassName,
manualClose,
onTriggerClick,
}: IPopover) {
const buttonRef = useRef<HTMLButtonElement>(null)
const timeOutRef = useRef<NodeJS.Timeout | null>(null)
......@@ -66,6 +68,10 @@ export default function CustomPopover({
? btnClassName
: btnClassName?.(open)
}`}
onClick={() => {
if (!open)
onTriggerClick && onTriggerClick()
}}
>
{btnElement}
</Popover.Button>
......
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