Commit 113af85c authored by Joel's avatar Joel

chore: add requierd

parent 916bacb6
...@@ -5,8 +5,8 @@ import { memo } from 'react' ...@@ -5,8 +5,8 @@ import { memo } from 'react'
import Workflow from '@/app/components/workflow' import Workflow from '@/app/components/workflow'
import { BlockEnum } from '@/app/components/workflow/types' import { BlockEnum } from '@/app/components/workflow/types'
const nodes = [ const nodes = [
BlockEnum.HttpRequest/* 9 */, BlockEnum.VariableAssigner/* 11 */, BlockEnum.Start/* 1 */, BlockEnum.DirectAnswer/* 2 */, BlockEnum.LLM/* 3 */, BlockEnum.KnowledgeRetrieval/* 4 */, BlockEnum.QuestionClassifier/* 5 */, BlockEnum.HttpRequest/* 9 */, BlockEnum.Tool/* 10 */, BlockEnum.VariableAssigner/* 11 */, BlockEnum.Start/* 1 */, BlockEnum.DirectAnswer/* 2 */, BlockEnum.LLM/* 3 */, BlockEnum.KnowledgeRetrieval/* 4 */, BlockEnum.QuestionClassifier/* 5 */,
BlockEnum.IfElse/* 6 */, BlockEnum.Code/* 7 */, BlockEnum.TemplateTransform/* 8 */, BlockEnum.Tool/* 10 */, BlockEnum.IfElse/* 6 */, BlockEnum.Code/* 7 */, BlockEnum.TemplateTransform/* 8 */,
BlockEnum.End/* 12 */, BlockEnum.End/* 12 */,
].map((item, i) => ({ ].map((item, i) => ({
id: `${i + 1}`, id: `${i + 1}`,
......
...@@ -18,10 +18,13 @@ type Props = { ...@@ -18,10 +18,13 @@ type Props = {
onHide: () => void onHide: () => void
} }
const Field = ({ title, children }: { title: string; children: JSX.Element }) => { const Field = ({ title, isRequired, children }: { title: string; isRequired?: boolean; children: JSX.Element }) => {
return ( return (
<div> <div>
<div className='leading-8 text-[13px] font-medium text-gray-700'>{title}</div> <div className='leading-8 text-[13px] font-medium text-gray-700'>
{title}
{isRequired && <span className='ml-0.5 text-[#D92D20]'>*</span>}
</div>
<div>{children}</div> <div>{children}</div>
</div> </div>
) )
...@@ -115,7 +118,7 @@ const Authorization: FC<Props> = ({ ...@@ -115,7 +118,7 @@ const Authorization: FC<Props> = ({
/> />
</Field> </Field>
{tempPayload.config?.type === APIType.custom && ( {tempPayload.config?.type === APIType.custom && (
<Field title={t(`${i18nPrefix}.header`)}> <Field title={t(`${i18nPrefix}.header`)} isRequired>
<input <input
type='text' type='text'
className='w-full h-8 leading-8 px-2.5 rounded-lg border-0 bg-gray-100 text-gray-900 text-[13px] placeholder:text-gray-400 focus:outline-none focus:ring-1 focus:ring-inset focus:ring-gray-200' className='w-full h-8 leading-8 px-2.5 rounded-lg border-0 bg-gray-100 text-gray-900 text-[13px] placeholder:text-gray-400 focus:outline-none focus:ring-1 focus:ring-inset focus:ring-gray-200'
...@@ -125,7 +128,7 @@ const Authorization: FC<Props> = ({ ...@@ -125,7 +128,7 @@ const Authorization: FC<Props> = ({
</Field> </Field>
)} )}
<Field title={t(`${i18nPrefix}.api-key-title`)}> <Field title={t(`${i18nPrefix}.api-key-title`)} isRequired>
<input <input
type='text' type='text'
className='w-full h-8 leading-8 px-2.5 rounded-lg border-0 bg-gray-100 text-gray-900 text-[13px] placeholder:text-gray-400 focus:outline-none focus:ring-1 focus:ring-inset focus:ring-gray-200' className='w-full h-8 leading-8 px-2.5 rounded-lg border-0 bg-gray-100 text-gray-900 text-[13px] placeholder:text-gray-400 focus:outline-none focus:ring-1 focus:ring-inset focus:ring-gray-200'
......
import { BlockEnum } from '../../types'
import type { ToolNodeType } from './types' import type { ToolNodeType } from './types'
import { VarType } from './types' import { VarType } from './types'
export const mockData: ToolNodeType = { export const mockData: ToolNodeType = {
title: 'Test', title: 'Test',
desc: 'Test', desc: 'Test',
type: 'Test', type: BlockEnum.Tool,
provider_id: 'test', provider_id: 'test',
provider_type: 'builtin', provider_type: 'builtin',
provider_name: 'test', provider_name: 'test',
......
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