mirror of
https://github.com/langgenius/dify.git
synced 2024-11-16 11:42:29 +08:00
refactor: refactor the button component using forwardRef
(#4379)
Co-authored-by: KVOJJJin <jzongcode@gmail.com>
This commit is contained in:
parent
bb33ffc332
commit
a3bd5eba02
|
@ -137,7 +137,7 @@ const WebSSOForm: FC = () => {
|
||||||
<div className="w-full mx-auto mt-10">
|
<div className="w-full mx-auto mt-10">
|
||||||
<Button
|
<Button
|
||||||
tabIndex={0}
|
tabIndex={0}
|
||||||
type='primary'
|
variant='primary'
|
||||||
onClick={() => { handleSSOLogin() }}
|
onClick={() => { handleSSOLogin() }}
|
||||||
disabled={isLoading}
|
disabled={isLoading}
|
||||||
className="w-full !fone-medium !text-sm"
|
className="w-full !fone-medium !text-sm"
|
||||||
|
|
|
@ -109,7 +109,7 @@ const ActivateForm = () => {
|
||||||
<h2 className="text-[32px] font-bold text-gray-900">{t('login.invalid')}</h2>
|
<h2 className="text-[32px] font-bold text-gray-900">{t('login.invalid')}</h2>
|
||||||
</div>
|
</div>
|
||||||
<div className="w-full mx-auto mt-6">
|
<div className="w-full mx-auto mt-6">
|
||||||
<Button type='primary' className='w-full !fone-medium !text-sm'>
|
<Button variant='primary' className='w-full !fone-medium !text-sm'>
|
||||||
<a href="https://dify.ai">{t('login.explore')}</a>
|
<a href="https://dify.ai">{t('login.explore')}</a>
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
|
@ -195,7 +195,7 @@ const ActivateForm = () => {
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<Button
|
<Button
|
||||||
type='primary'
|
variant='primary'
|
||||||
className='w-full !fone-medium !text-sm'
|
className='w-full !fone-medium !text-sm'
|
||||||
onClick={handleActivate}
|
onClick={handleActivate}
|
||||||
>
|
>
|
||||||
|
@ -226,7 +226,7 @@ const ActivateForm = () => {
|
||||||
</h2>
|
</h2>
|
||||||
</div>
|
</div>
|
||||||
<div className="w-full mx-auto mt-6">
|
<div className="w-full mx-auto mt-6">
|
||||||
<Button type='primary' className='w-full !fone-medium !text-sm'>
|
<Button variant='primary' className='w-full !fone-medium !text-sm'>
|
||||||
<a href="/signin">{t('login.activated')}</a>
|
<a href="/signin">{t('login.activated')}</a>
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -105,7 +105,7 @@ const AddAnnotationModal: FC<Props> = ({
|
||||||
</div>
|
</div>
|
||||||
<div className='mt-2 flex space-x-2'>
|
<div className='mt-2 flex space-x-2'>
|
||||||
<Button className='!h-7 !text-xs !font-medium' onClick={onHide}>{t('common.operation.cancel')}</Button>
|
<Button className='!h-7 !text-xs !font-medium' onClick={onHide}>{t('common.operation.cancel')}</Button>
|
||||||
<Button className='!h-7 !text-xs !font-medium' type='primary' onClick={handleSave} loading={isSaving} disabled={isAnnotationFull}>{t('common.operation.add')}</Button>
|
<Button className='!h-7 !text-xs !font-medium' variant='primary' onClick={handleSave} loading={isSaving} disabled={isAnnotationFull}>{t('common.operation.add')}</Button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -110,7 +110,7 @@ const BatchModal: FC<IBatchModalProps> = ({
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
className='text-sm font-medium'
|
className='text-sm font-medium'
|
||||||
type="primary"
|
variant="primary"
|
||||||
onClick={handleSend}
|
onClick={handleSend}
|
||||||
disabled={isAnnotationFull || !currentCSV}
|
disabled={isAnnotationFull || !currentCSV}
|
||||||
loading={importStatus === ProcessStatus.PROCESSING || importStatus === ProcessStatus.WAITING}
|
loading={importStatus === ProcessStatus.PROCESSING || importStatus === ProcessStatus.WAITING}
|
||||||
|
|
|
@ -119,7 +119,7 @@ const EditItem: FC<Props> = ({
|
||||||
autoFocus
|
autoFocus
|
||||||
/>
|
/>
|
||||||
<div className='mt-2 flex space-x-2'>
|
<div className='mt-2 flex space-x-2'>
|
||||||
<Button className='!h-7 !text-xs !font-medium' type='primary' onClick={handleSave}>{t('common.operation.save')}</Button>
|
<Button className='!h-7 !text-xs !font-medium' variant='primary' onClick={handleSave}>{t('common.operation.save')}</Button>
|
||||||
<Button className='!h-7 !text-xs !font-medium' onClick={handleCancel}>{t('common.operation.cancel')}</Button>
|
<Button className='!h-7 !text-xs !font-medium' onClick={handleCancel}>{t('common.operation.cancel')}</Button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -135,7 +135,7 @@ const HeaderOptions: FC<Props> = ({
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className='flex space-x-2'>
|
<div className='flex space-x-2'>
|
||||||
<Button type='primary' onClick={() => setShowAddModal(true)} className='flex items-center !h-8 !px-3 !text-[13px] space-x-2'>
|
<Button variant='primary' onClick={() => setShowAddModal(true)} className='flex items-center !h-8 !px-3 !text-[13px] space-x-2'>
|
||||||
<Plus className='w-4 h-4' />
|
<Plus className='w-4 h-4' />
|
||||||
<div>{t('appAnnotation.table.header.addAnnotation')}</div>
|
<div>{t('appAnnotation.table.header.addAnnotation')}</div>
|
||||||
</Button>
|
</Button>
|
||||||
|
|
|
@ -119,7 +119,7 @@ const AppPublisher = ({
|
||||||
>
|
>
|
||||||
<PortalToFollowElemTrigger onClick={handleTrigger}>
|
<PortalToFollowElemTrigger onClick={handleTrigger}>
|
||||||
<Button
|
<Button
|
||||||
type='primary'
|
variant='primary'
|
||||||
className={`
|
className={`
|
||||||
pl-3 pr-2 py-0 h-8 text-[13px] font-medium
|
pl-3 pr-2 py-0 h-8 text-[13px] font-medium
|
||||||
${disabled && 'cursor-not-allowed opacity-50'}
|
${disabled && 'cursor-not-allowed opacity-50'}
|
||||||
|
@ -168,7 +168,7 @@ const AppPublisher = ({
|
||||||
)
|
)
|
||||||
: (
|
: (
|
||||||
<Button
|
<Button
|
||||||
type='primary'
|
variant='primary'
|
||||||
className={classNames(
|
className={classNames(
|
||||||
'mt-3 px-3 py-0 w-full h-8 border-[0.5px] border-primary-700 rounded-lg text-[13px] font-medium',
|
'mt-3 px-3 py-0 w-full h-8 border-[0.5px] border-primary-700 rounded-lg text-[13px] font-medium',
|
||||||
(publishDisabled || published) && 'border-transparent',
|
(publishDisabled || published) && 'border-transparent',
|
||||||
|
|
|
@ -68,7 +68,7 @@ const PublishWithMultipleModel: FC<PublishWithMultipleModelProps> = ({
|
||||||
>
|
>
|
||||||
<PortalToFollowElemTrigger className='w-full' onClick={handleToggle}>
|
<PortalToFollowElemTrigger className='w-full' onClick={handleToggle}>
|
||||||
<Button
|
<Button
|
||||||
type='primary'
|
variant='primary'
|
||||||
disabled={!validModelConfigs.length}
|
disabled={!validModelConfigs.length}
|
||||||
className='mt-3 px-3 py-0 w-full h-8 border-[0.5px] border-primary-700 rounded-lg text-[13px] font-medium'
|
className='mt-3 px-3 py-0 w-full h-8 border-[0.5px] border-primary-700 rounded-lg text-[13px] font-medium'
|
||||||
>
|
>
|
||||||
|
|
|
@ -20,7 +20,7 @@ const FormattingChanged: FC<IFormattingChangedProps> = ({
|
||||||
description={t('appDebug.feature.dataSet.queryVariable.unableToQueryDataSetTip')}
|
description={t('appDebug.feature.dataSet.queryVariable.unableToQueryDataSetTip')}
|
||||||
footer={
|
footer={
|
||||||
<div className='flex space-x-2'>
|
<div className='flex space-x-2'>
|
||||||
<Button type='primary' className='flex items-center justify-start !h-8 !w-[96px]' onClick={onConfirm}>
|
<Button variant='primary' className='flex items-center justify-start !h-8 !w-[96px]' onClick={onConfirm}>
|
||||||
<span className='text-[13px] font-medium'>{t('appDebug.feature.dataSet.queryVariable.ok')}</span>
|
<span className='text-[13px] font-medium'>{t('appDebug.feature.dataSet.queryVariable.ok')}</span>
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -28,7 +28,7 @@ const FormattingChanged: FC<IFormattingChangedProps> = ({
|
||||||
description={t('appDebug.formattingChangedText')}
|
description={t('appDebug.formattingChangedText')}
|
||||||
footer={
|
footer={
|
||||||
<div className='flex space-x-2'>
|
<div className='flex space-x-2'>
|
||||||
<Button type='primary' className='flex items-center space-x-2' onClick={onConfirm}>
|
<Button variant='primary' className='flex items-center space-x-2' onClick={onConfirm}>
|
||||||
{icon}
|
{icon}
|
||||||
<span>{t('common.operation.refresh')}</span>
|
<span>{t('common.operation.refresh')}</span>
|
||||||
</Button>
|
</Button>
|
||||||
|
|
|
@ -28,7 +28,7 @@ const HasNotSetAPI: FC<IHasNotSetAPIProps> = ({
|
||||||
title={isTrailFinished ? t('appDebug.notSetAPIKey.trailFinished') : t('appDebug.notSetAPIKey.title')}
|
title={isTrailFinished ? t('appDebug.notSetAPIKey.trailFinished') : t('appDebug.notSetAPIKey.title')}
|
||||||
description={t('appDebug.notSetAPIKey.description')}
|
description={t('appDebug.notSetAPIKey.description')}
|
||||||
footer={
|
footer={
|
||||||
<Button type='primary' className='flex items-center space-x-2' onClick={onSetting}>
|
<Button variant='primary' className='flex items-center space-x-2' onClick={onSetting}>
|
||||||
<span>{t('appDebug.notSetAPIKey.settingBtn')}</span>
|
<span>{t('appDebug.notSetAPIKey.settingBtn')}</span>
|
||||||
{icon}
|
{icon}
|
||||||
</Button>}
|
</Button>}
|
||||||
|
|
|
@ -63,7 +63,7 @@ const ConfirmAddVar: FC<IConfirmAddVarProps> = ({
|
||||||
</div>
|
</div>
|
||||||
<div className='mt-7 flex justify-end space-x-2'>
|
<div className='mt-7 flex justify-end space-x-2'>
|
||||||
<Button className='w-20 h-8 !text-[13px]' onClick={onCancel}>{t('common.operation.cancel')}</Button>
|
<Button className='w-20 h-8 !text-[13px]' onClick={onCancel}>{t('common.operation.cancel')}</Button>
|
||||||
<Button className='w-20 h-8 !text-[13px]' type='primary' onClick={onConfrim}>{t('common.operation.add')}</Button>
|
<Button className='w-20 h-8 !text-[13px]' variant='primary' onClick={onConfrim}>{t('common.operation.add')}</Button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -49,7 +49,7 @@ const EditModal: FC<Props> = ({
|
||||||
|
|
||||||
<div className='mt-10 flex justify-end'>
|
<div className='mt-10 flex justify-end'>
|
||||||
<Button className='mr-2 flex-shrink-0' onClick={onClose}>{t('common.operation.cancel')}</Button>
|
<Button className='mr-2 flex-shrink-0' onClick={onClose}>{t('common.operation.cancel')}</Button>
|
||||||
<Button type='primary' className='flex-shrink-0' onClick={() => onSave(tempData)} loading={saveLoading}>{t('common.operation.save')}</Button>
|
<Button variant='primary' className='flex-shrink-0' onClick={() => onSave(tempData)} loading={saveLoading}>{t('common.operation.save')}</Button>
|
||||||
</div>
|
</div>
|
||||||
</Modal>
|
</Modal>
|
||||||
)
|
)
|
||||||
|
|
|
@ -17,7 +17,7 @@ const ModalFoot: FC<IModalFootProps> = ({
|
||||||
return (
|
return (
|
||||||
<div className='flex justify-end gap-2'>
|
<div className='flex justify-end gap-2'>
|
||||||
<Button onClick={onCancel}>{t('common.operation.cancel')}</Button>
|
<Button onClick={onCancel}>{t('common.operation.cancel')}</Button>
|
||||||
<Button type='primary' onClick={onConfirm}>{t('common.operation.save')}</Button>
|
<Button variant='primary' onClick={onConfirm}>{t('common.operation.save')}</Button>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -142,7 +142,7 @@ const AgentSetting: FC<Props> = ({
|
||||||
{t('common.operation.cancel')}
|
{t('common.operation.cancel')}
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
type='primary'
|
variant='primary'
|
||||||
className='text-sm font-medium'
|
className='text-sm font-medium'
|
||||||
onClick={handleSave}
|
onClick={handleSave}
|
||||||
>
|
>
|
||||||
|
|
|
@ -209,7 +209,7 @@ const SettingBuiltInTool: FC<Props> = ({
|
||||||
{!readonly && !isInfoActive && (
|
{!readonly && !isInfoActive && (
|
||||||
<div className='mt-2 shrink-0 flex justify-end py-4 px-6 space-x-2 rounded-b-[10px] bg-gray-50 border-t border-black/5'>
|
<div className='mt-2 shrink-0 flex justify-end py-4 px-6 space-x-2 rounded-b-[10px] bg-gray-50 border-t border-black/5'>
|
||||||
<Button className='flex items-center h-8 !px-3 !text-[13px] font-medium !text-gray-700' onClick={onHide}>{t('common.operation.cancel')}</Button>
|
<Button className='flex items-center h-8 !px-3 !text-[13px] font-medium !text-gray-700' onClick={onHide}>{t('common.operation.cancel')}</Button>
|
||||||
<Button className='flex items-center h-8 !px-3 !text-[13px] font-medium' type='primary' disabled={!isValid} onClick={() => onSave?.(addDefaultValue(tempSetting, formSchemas))}>{t('common.operation.save')}</Button>
|
<Button className='flex items-center h-8 !px-3 !text-[13px] font-medium' variant='primary' disabled={!isValid} onClick={() => onSave?.(addDefaultValue(tempSetting, formSchemas))}>{t('common.operation.save')}</Button>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>)}
|
</div>)}
|
||||||
|
|
|
@ -155,7 +155,7 @@ const GetAutomaticRes: FC<IGetAutomaticResProps> = ({
|
||||||
<div className='mt-6 flex justify-end'>
|
<div className='mt-6 flex justify-end'>
|
||||||
<Button
|
<Button
|
||||||
className='flex space-x-2 items-center !h-8'
|
className='flex space-x-2 items-center !h-8'
|
||||||
type='primary'
|
variant='primary'
|
||||||
onClick={onGenerate}
|
onClick={onGenerate}
|
||||||
disabled={isLoading}
|
disabled={isLoading}
|
||||||
>
|
>
|
||||||
|
@ -198,7 +198,7 @@ const GetAutomaticRes: FC<IGetAutomaticResProps> = ({
|
||||||
|
|
||||||
<div className='sticky bottom-0 flex justify-end right-0 py-4 bg-white'>
|
<div className='sticky bottom-0 flex justify-end right-0 py-4 bg-white'>
|
||||||
<Button onClick={onClose}>{t('common.operation.cancel')}</Button>
|
<Button onClick={onClose}>{t('common.operation.cancel')}</Button>
|
||||||
<Button type='primary' className='ml-2' onClick={() => {
|
<Button variant='primary' className='ml-2' onClick={() => {
|
||||||
setShowConfirmOverwrite(true)
|
setShowConfirmOverwrite(true)
|
||||||
}}>{t('appDebug.automatic.apply')}</Button>
|
}}>{t('appDebug.automatic.apply')}</Button>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -15,8 +15,8 @@ const ContrlBtnGroup: FC<IContrlBtnGroupProps> = ({ onSave, onReset }) => {
|
||||||
return (
|
return (
|
||||||
<div className="fixed left-[224px] bottom-0 w-[519px] h-[64px]">
|
<div className="fixed left-[224px] bottom-0 w-[519px] h-[64px]">
|
||||||
<div className={`${s.ctrlBtn} flex items-center h-full pl-4 gap-2 bg-white`}>
|
<div className={`${s.ctrlBtn} flex items-center h-full pl-4 gap-2 bg-white`}>
|
||||||
<Button type='primary' onClick={onSave}>{t('appDebug.operation.applyConfig')}</Button>
|
<Button variant='primary' onClick={onSave}>{t('appDebug.operation.applyConfig')}</Button>
|
||||||
<Button type='default' onClick={onReset}>{t('appDebug.operation.resetConfig')}</Button>
|
<Button variant='default' onClick={onReset}>{t('appDebug.operation.resetConfig')}</Button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
|
|
@ -95,7 +95,7 @@ const ParamsConfig: FC = () => {
|
||||||
<Button className='mr-2 flex-shrink-0' onClick={() => {
|
<Button className='mr-2 flex-shrink-0' onClick={() => {
|
||||||
setOpen(false)
|
setOpen(false)
|
||||||
}}>{t('common.operation.cancel')}</Button>
|
}}>{t('common.operation.cancel')}</Button>
|
||||||
<Button type='primary' className='flex-shrink-0' onClick={handleSave} >{t('common.operation.save')}</Button>
|
<Button variant='primary' className='flex-shrink-0' onClick={handleSave} >{t('common.operation.save')}</Button>
|
||||||
</div>
|
</div>
|
||||||
</Modal>
|
</Modal>
|
||||||
)
|
)
|
||||||
|
|
|
@ -156,7 +156,7 @@ const SelectDataSet: FC<ISelectDataSetProps> = ({
|
||||||
</div>
|
</div>
|
||||||
<div className='flex space-x-2'>
|
<div className='flex space-x-2'>
|
||||||
<Button className='!w-24 !h-9' onClick={onClose}>{t('common.operation.cancel')}</Button>
|
<Button className='!w-24 !h-9' onClick={onClose}>{t('common.operation.cancel')}</Button>
|
||||||
<Button className='!w-24 !h-9' type='primary' onClick={handleSelect} disabled={hasNoData}>{t('common.operation.add')}</Button>
|
<Button className='!w-24 !h-9' variant='primary' onClick={handleSelect} disabled={hasNoData}>{t('common.operation.add')}</Button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
|
@ -280,7 +280,7 @@ const SettingsModal: FC<SettingsModalProps> = ({
|
||||||
{t('common.operation.cancel')}
|
{t('common.operation.cancel')}
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
type='primary'
|
variant='primary'
|
||||||
className='text-sm font-medium'
|
className='text-sm font-medium'
|
||||||
disabled={loading}
|
disabled={loading}
|
||||||
onClick={handleSave}
|
onClick={handleSave}
|
||||||
|
|
|
@ -132,7 +132,7 @@ const OpeningStatement: FC<IOpeningStatementProps> = ({
|
||||||
isFocus ? (
|
isFocus ? (
|
||||||
<div className='flex items-center space-x-1'>
|
<div className='flex items-center space-x-1'>
|
||||||
<div className='px-3 leading-[18px] text-xs font-medium text-gray-700 cursor-pointer' onClick={handleCancel}>{t('common.operation.cancel')}</div>
|
<div className='px-3 leading-[18px] text-xs font-medium text-gray-700 cursor-pointer' onClick={handleCancel}>{t('common.operation.cancel')}</div>
|
||||||
<Button className='!h-8 !px-3 text-xs' onClick={handleConfirm} type="primary">{t('common.operation.save')}</Button>
|
<Button className='!h-8 !px-3 text-xs' onClick={handleConfirm} variant="primary">{t('common.operation.save')}</Button>
|
||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
<OperationBtn type='edit' actionName={hasValue ? '' : t('appDebug.openingStatement.writeOpener') as string} onClick={handleEdit} />
|
<OperationBtn type='edit' actionName={hasValue ? '' : t('appDebug.openingStatement.writeOpener') as string} onClick={handleEdit} />
|
||||||
|
|
|
@ -62,7 +62,7 @@ const PromptValuePanel: FC<IPromptValuePanelProps> = ({
|
||||||
const renderRunButton = () => {
|
const renderRunButton = () => {
|
||||||
return (
|
return (
|
||||||
<Button
|
<Button
|
||||||
type="primary"
|
variant="primary"
|
||||||
disabled={canNotRun}
|
disabled={canNotRun}
|
||||||
onClick={() => onSend && onSend()}
|
onClick={() => onSend && onSend()}
|
||||||
className="w-[80px] !h-8">
|
className="w-[80px] !h-8">
|
||||||
|
|
|
@ -125,7 +125,7 @@ const ConfigParamModal: FC<Props> = ({
|
||||||
<div className='mt-6 flex gap-2 justify-end'>
|
<div className='mt-6 flex gap-2 justify-end'>
|
||||||
<Button className='!text-sm' onClick={onHide}>{t('common.operation.cancel')}</Button>
|
<Button className='!text-sm' onClick={onHide}>{t('common.operation.cancel')}</Button>
|
||||||
<Button
|
<Button
|
||||||
type='primary'
|
variant='primary'
|
||||||
onClick={handleSave}
|
onClick={handleSave}
|
||||||
className='flex items-center border-[0.5px] !text-sm'
|
className='flex items-center border-[0.5px] !text-sm'
|
||||||
loading={isLoading}
|
loading={isLoading}
|
||||||
|
|
|
@ -259,7 +259,7 @@ const ModerationSettingModal: FC<ModerationSettingModalProps> = ({
|
||||||
onClick={() => handleDataTypeChange(provider.key)}
|
onClick={() => handleDataTypeChange(provider.key)}
|
||||||
>
|
>
|
||||||
<div className={`
|
<div className={`
|
||||||
mr-2 w-4 h-4 rounded-full border
|
mr-2 w-4 h-4 rounded-full border
|
||||||
${localeData.type === provider.key ? 'border-[5px] border-primary-600' : 'border border-gray-300'}`} />
|
${localeData.type === provider.key ? 'border-[5px] border-primary-600' : 'border border-gray-300'}`} />
|
||||||
{provider.name}
|
{provider.name}
|
||||||
</div>
|
</div>
|
||||||
|
@ -359,7 +359,7 @@ const ModerationSettingModal: FC<ModerationSettingModalProps> = ({
|
||||||
{t('common.operation.cancel')}
|
{t('common.operation.cancel')}
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
type='primary'
|
variant='primary'
|
||||||
className='text-sm font-medium'
|
className='text-sm font-medium'
|
||||||
onClick={handleSave}
|
onClick={handleSave}
|
||||||
disabled={localeData.type === 'openai_moderation' && !openaiProviderConfiged}
|
disabled={localeData.type === 'openai_moderation' && !openaiProviderConfiged}
|
||||||
|
|
|
@ -276,7 +276,7 @@ const ExternalDataToolModal: FC<ExternalDataToolModalProps> = ({
|
||||||
{t('common.operation.cancel')}
|
{t('common.operation.cancel')}
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
type='primary'
|
variant='primary'
|
||||||
className='text-sm font-medium'
|
className='text-sm font-medium'
|
||||||
onClick={handleSave}
|
onClick={handleSave}
|
||||||
>
|
>
|
||||||
|
|
|
@ -85,7 +85,7 @@ const CreateAppModal = ({ show, onSuccess, onClose }: CreateAppDialogProps) => {
|
||||||
overflowVisible
|
overflowVisible
|
||||||
className='!p-0 !max-w-[720px] !w-[720px] rounded-xl'
|
className='!p-0 !max-w-[720px] !w-[720px] rounded-xl'
|
||||||
isShow={show}
|
isShow={show}
|
||||||
onClose={() => {}}
|
onClose={() => { }}
|
||||||
>
|
>
|
||||||
{/* Heading */}
|
{/* Heading */}
|
||||||
<div className='shrink-0 flex flex-col h-full bg-white rounded-t-xl'>
|
<div className='shrink-0 flex flex-col h-full bg-white rounded-t-xl'>
|
||||||
|
@ -208,7 +208,7 @@ const CreateAppModal = ({ show, onSuccess, onClose }: CreateAppDialogProps) => {
|
||||||
'hidden z-20 absolute left-[327px] top-[-158px] w-[376px] rounded-xl bg-white border-[0.5px] border-[rgba(0,0,0,0.05)] shadow-lg group-hover:block',
|
'hidden z-20 absolute left-[327px] top-[-158px] w-[376px] rounded-xl bg-white border-[0.5px] border-[rgba(0,0,0,0.05)] shadow-lg group-hover:block',
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
<div className={cn('w-full h-[256px] bg-center bg-no-repeat bg-contain rounded-xl', s.basicPic)}/>
|
<div className={cn('w-full h-[256px] bg-center bg-no-repeat bg-contain rounded-xl', s.basicPic)} />
|
||||||
<div className='px-4 pb-2'>
|
<div className='px-4 pb-2'>
|
||||||
<div className='flex items-center justify-between'>
|
<div className='flex items-center justify-between'>
|
||||||
<div className='text-gray-700 text-md leading-6 font-semibold'>{t('app.newApp.basic')}</div>
|
<div className='text-gray-700 text-md leading-6 font-semibold'>{t('app.newApp.basic')}</div>
|
||||||
|
@ -242,7 +242,7 @@ const CreateAppModal = ({ show, onSuccess, onClose }: CreateAppDialogProps) => {
|
||||||
'hidden z-20 absolute right-[26px] top-[-158px] w-[376px] rounded-xl bg-white border-[0.5px] border-[rgba(0,0,0,0.05)] shadow-lg group-hover:block',
|
'hidden z-20 absolute right-[26px] top-[-158px] w-[376px] rounded-xl bg-white border-[0.5px] border-[rgba(0,0,0,0.05)] shadow-lg group-hover:block',
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
<div className={cn('w-full h-[256px] bg-center bg-no-repeat bg-contain rounded-xl', s.advancedPic)}/>
|
<div className={cn('w-full h-[256px] bg-center bg-no-repeat bg-contain rounded-xl', s.advancedPic)} />
|
||||||
<div className='px-4 pb-2'>
|
<div className='px-4 pb-2'>
|
||||||
<div className='flex items-center justify-between'>
|
<div className='flex items-center justify-between'>
|
||||||
<div className='flex items-center'>
|
<div className='flex items-center'>
|
||||||
|
@ -302,7 +302,7 @@ const CreateAppModal = ({ show, onSuccess, onClose }: CreateAppDialogProps) => {
|
||||||
)}
|
)}
|
||||||
<div className='px-8 py-6 flex justify-end'>
|
<div className='px-8 py-6 flex justify-end'>
|
||||||
<Button className='mr-2 text-gray-700 text-sm font-medium' onClick={onClose}>{t('app.newApp.Cancel')}</Button>
|
<Button className='mr-2 text-gray-700 text-sm font-medium' onClick={onClose}>{t('app.newApp.Cancel')}</Button>
|
||||||
<Button className='text-sm font-medium' disabled={isAppsFull || !name} type="primary" onClick={onCreate}>{t('app.newApp.Create')}</Button>
|
<Button className='text-sm font-medium' disabled={isAppsFull || !name} variant="primary" onClick={onCreate}>{t('app.newApp.Create')}</Button>
|
||||||
</div>
|
</div>
|
||||||
<div className='absolute right-6 top-6 p-2 cursor-pointer z-20' onClick={onClose}>
|
<div className='absolute right-6 top-6 p-2 cursor-pointer z-20' onClick={onClose}>
|
||||||
<XClose className='w-4 h-4 text-gray-500' />
|
<XClose className='w-4 h-4 text-gray-500' />
|
||||||
|
|
|
@ -80,7 +80,7 @@ const CreateFromDSLModal = ({ show, onSuccess, onClose }: CreateFromDSLModalProp
|
||||||
<Modal
|
<Modal
|
||||||
className='px-8 py-6 max-w-[520px] w-[520px] rounded-xl'
|
className='px-8 py-6 max-w-[520px] w-[520px] rounded-xl'
|
||||||
isShow={show}
|
isShow={show}
|
||||||
onClose={() => {}}
|
onClose={() => { }}
|
||||||
>
|
>
|
||||||
<div className='relative pb-2 text-xl font-medium leading-[30px] text-gray-900'>{t('app.createFromConfigFile')}</div>
|
<div className='relative pb-2 text-xl font-medium leading-[30px] text-gray-900'>{t('app.createFromConfigFile')}</div>
|
||||||
<div className='absolute right-4 top-4 p-2 cursor-pointer' onClick={onClose}>
|
<div className='absolute right-4 top-4 p-2 cursor-pointer' onClick={onClose}>
|
||||||
|
@ -93,7 +93,7 @@ const CreateFromDSLModal = ({ show, onSuccess, onClose }: CreateFromDSLModalProp
|
||||||
{isAppsFull && <AppsFull loc='app-create-dsl' />}
|
{isAppsFull && <AppsFull loc='app-create-dsl' />}
|
||||||
<div className='pt-6 flex justify-end'>
|
<div className='pt-6 flex justify-end'>
|
||||||
<Button className='mr-2 text-gray-700 text-sm font-medium' onClick={onClose}>{t('app.newApp.Cancel')}</Button>
|
<Button className='mr-2 text-gray-700 text-sm font-medium' onClick={onClose}>{t('app.newApp.Cancel')}</Button>
|
||||||
<Button className='text-sm font-medium' disabled={isAppsFull || !currentFile} type="primary" onClick={onCreate}>{t('app.newApp.Create')}</Button>
|
<Button className='text-sm font-medium' disabled={isAppsFull || !currentFile} variant="primary" onClick={onCreate}>{t('app.newApp.Create')}</Button>
|
||||||
</div>
|
</div>
|
||||||
</Modal>
|
</Modal>
|
||||||
)
|
)
|
||||||
|
|
|
@ -75,7 +75,7 @@ const DuplicateAppModal = ({
|
||||||
{isAppsFull && <AppsFull loc='app-duplicate-create' />}
|
{isAppsFull && <AppsFull loc='app-duplicate-create' />}
|
||||||
</div>
|
</div>
|
||||||
<div className='flex flex-row-reverse'>
|
<div className='flex flex-row-reverse'>
|
||||||
<Button disabled={isAppsFull} className='w-24 ml-2' type='primary' onClick={submit}>{t('app.duplicate')}</Button>
|
<Button disabled={isAppsFull} className='w-24 ml-2' variant='primary' onClick={submit}>{t('app.duplicate')}</Button>
|
||||||
<Button className='w-24' onClick={onHide}>{t('common.operation.cancel')}</Button>
|
<Button className='w-24' onClick={onHide}>{t('common.operation.cancel')}</Button>
|
||||||
</div>
|
</div>
|
||||||
</Modal>
|
</Modal>
|
||||||
|
|
|
@ -44,7 +44,7 @@ const APIKeyInfoPanel: FC = () => {
|
||||||
<div className='mt-1 text-sm text-gray-600 font-normal'>{t(`appOverview.apiKeyInfo.cloud.${'trial'}.description`)}</div>
|
<div className='mt-1 text-sm text-gray-600 font-normal'>{t(`appOverview.apiKeyInfo.cloud.${'trial'}.description`)}</div>
|
||||||
)}
|
)}
|
||||||
<Button
|
<Button
|
||||||
type='primary'
|
variant='primary'
|
||||||
className='space-x-2'
|
className='space-x-2'
|
||||||
onClick={() => setShowAccountSettingModal({ payload: 'provider' })}
|
onClick={() => setShowAccountSettingModal({ payload: 'provider' })}
|
||||||
>
|
>
|
||||||
|
|
|
@ -173,7 +173,7 @@ const SettingsModal: FC<ISettingsModalProps> = ({
|
||||||
</>}
|
</>}
|
||||||
<div className='mt-10 flex justify-end'>
|
<div className='mt-10 flex justify-end'>
|
||||||
<Button className='mr-2 flex-shrink-0 !text-sm' onClick={onHide}>{t('common.operation.cancel')}</Button>
|
<Button className='mr-2 flex-shrink-0 !text-sm' onClick={onHide}>{t('common.operation.cancel')}</Button>
|
||||||
<Button type='primary' className='flex-shrink-0 !text-sm' onClick={onClickSave} loading={saveLoading}>{t('common.operation.save')}</Button>
|
<Button variant='primary' className='flex-shrink-0 !text-sm' onClick={onClickSave} loading={saveLoading}>{t('common.operation.save')}</Button>
|
||||||
</div>
|
</div>
|
||||||
{showEmojiPicker && <EmojiPicker
|
{showEmojiPicker && <EmojiPicker
|
||||||
onSelect={(icon, icon_background) => {
|
onSelect={(icon, icon_background) => {
|
||||||
|
|
|
@ -89,7 +89,7 @@ const SwitchAppModal = ({ show, appDetail, inAppDetail = false, onSuccess, onClo
|
||||||
<Modal
|
<Modal
|
||||||
className={cn('p-8 max-w-[600px] w-[600px]', s.bg)}
|
className={cn('p-8 max-w-[600px] w-[600px]', s.bg)}
|
||||||
isShow={show}
|
isShow={show}
|
||||||
onClose={() => {}}
|
onClose={() => { }}
|
||||||
>
|
>
|
||||||
<div className='absolute right-4 top-4 p-2 cursor-pointer' onClick={onClose}>
|
<div className='absolute right-4 top-4 p-2 cursor-pointer' onClick={onClose}>
|
||||||
<XClose className='w-4 h-4 text-gray-500' />
|
<XClose className='w-4 h-4 text-gray-500' />
|
||||||
|
@ -133,7 +133,7 @@ const SwitchAppModal = ({ show, appDetail, inAppDetail = false, onSuccess, onClo
|
||||||
</div>
|
</div>
|
||||||
<div className='flex items-center'>
|
<div className='flex items-center'>
|
||||||
<Button className='mr-2 text-gray-700 text-sm font-medium' onClick={onClose}>{t('app.newApp.Cancel')}</Button>
|
<Button className='mr-2 text-gray-700 text-sm font-medium' onClick={onClose}>{t('app.newApp.Cancel')}</Button>
|
||||||
<Button className='text-sm font-medium border-red-700 border-[0.5px]' disabled={isAppsFull || !name} type="warning" onClick={goStart}>{t('app.switchStart')}</Button>
|
<Button className='text-sm font-medium border-red-700 border-[0.5px]' disabled={isAppsFull || !name} variant="warning" onClick={goStart}>{t('app.switchStart')}</Button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</Modal>
|
</Modal>
|
||||||
|
|
|
@ -1,50 +1,44 @@
|
||||||
import type { FC, MouseEventHandler, PropsWithChildren } from 'react'
|
import React from 'react'
|
||||||
import React, { memo } from 'react'
|
import { type VariantProps, cva } from 'class-variance-authority'
|
||||||
import classNames from 'classnames'
|
import classNames from 'classnames'
|
||||||
import Spinner from '../spinner'
|
import Spinner from '../spinner'
|
||||||
|
|
||||||
export type IButtonProps = PropsWithChildren<{
|
const buttonVariants = cva(
|
||||||
type?: string
|
'btn disabled:pointer-events-none',
|
||||||
className?: string
|
{
|
||||||
disabled?: boolean
|
variants: {
|
||||||
|
variant: {
|
||||||
|
primary: 'btn-primary disabled:btn-primary-disabled',
|
||||||
|
warning:
|
||||||
|
'btn-warning disabled:btn-warning-disabled',
|
||||||
|
default: 'btn-default disabled:btn-default-disabled',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
defaultVariants: {
|
||||||
|
variant: 'default',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
)
|
||||||
|
|
||||||
|
export type ButtonProps = {
|
||||||
loading?: boolean
|
loading?: boolean
|
||||||
tabIndex?: number
|
} & React.ButtonHTMLAttributes<HTMLButtonElement> & VariantProps<typeof buttonVariants>
|
||||||
onClick?: MouseEventHandler<HTMLDivElement>
|
|
||||||
}>
|
|
||||||
|
|
||||||
const Button: FC<IButtonProps> = ({
|
const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
|
||||||
type,
|
({ className, variant, loading, children, ...props }, ref) => {
|
||||||
disabled,
|
return (
|
||||||
children,
|
<button
|
||||||
className,
|
className={classNames(buttonVariants({ variant, className }))}
|
||||||
onClick,
|
ref={ref}
|
||||||
loading = false,
|
{...props}
|
||||||
tabIndex,
|
>
|
||||||
}) => {
|
{children}
|
||||||
let typeClassNames = 'cursor-pointer'
|
<Spinner loading={loading} className='!text-white !h-3 !w-3 !border-2 !ml-1' />
|
||||||
switch (type) {
|
</button>
|
||||||
case 'primary':
|
)
|
||||||
typeClassNames = (disabled || loading) ? 'btn-primary-disabled' : 'btn-primary'
|
},
|
||||||
break
|
)
|
||||||
case 'warning':
|
Button.displayName = 'Button'
|
||||||
typeClassNames = (disabled || loading) ? 'btn-warning-disabled' : 'btn-warning'
|
|
||||||
break
|
|
||||||
default:
|
|
||||||
typeClassNames = disabled ? 'btn-default-disabled' : 'btn-default'
|
|
||||||
break
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
export default Button
|
||||||
<div
|
export { Button, buttonVariants }
|
||||||
className={classNames('btn', typeClassNames, className)}
|
|
||||||
tabIndex={tabIndex}
|
|
||||||
onClick={disabled ? undefined : onClick}
|
|
||||||
>
|
|
||||||
{children}
|
|
||||||
{/* Spinner is hidden when loading is false */}
|
|
||||||
<Spinner loading={loading} className='!text-white !h-3 !w-3 !border-2 !ml-1' />
|
|
||||||
</div>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
export default memo(Button)
|
|
||||||
|
|
|
@ -93,7 +93,7 @@ const ConfigPanel = () => {
|
||||||
<Form />
|
<Form />
|
||||||
<div className={`pl-[136px] flex items-center ${isMobile && '!pl-0'}`}>
|
<div className={`pl-[136px] flex items-center ${isMobile && '!pl-0'}`}>
|
||||||
<Button
|
<Button
|
||||||
type='primary'
|
variant='primary'
|
||||||
className='mr-2 text-sm font-medium'
|
className='mr-2 text-sm font-medium'
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setCollapsed(true)
|
setCollapsed(true)
|
||||||
|
@ -118,7 +118,7 @@ const ConfigPanel = () => {
|
||||||
<Form />
|
<Form />
|
||||||
<Button
|
<Button
|
||||||
className={`px-4 py-0 h-9 ${inputsForms.length && !isMobile && 'ml-[136px]'}`}
|
className={`px-4 py-0 h-9 ${inputsForms.length && !isMobile && 'ml-[136px]'}`}
|
||||||
type='primary'
|
variant='primary'
|
||||||
onClick={handleStartChat}
|
onClick={handleStartChat}
|
||||||
>
|
>
|
||||||
<MessageDotsCircle className='mr-2 w-4 h-4 text-white' />
|
<MessageDotsCircle className='mr-2 w-4 h-4 text-white' />
|
||||||
|
|
|
@ -42,7 +42,7 @@ const ConfirmUI: FC<IConfirmUIProps> = ({
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className='flex gap-3 mt-4 ml-12'>
|
<div className='flex gap-3 mt-4 ml-12'>
|
||||||
<Button type='primary' onClick={onConfirm} className='flex items-center justify-center min-w-20 text-center text-white rounded-lg cursor-pointer h-9 '>{confirmText || t('common.operation.confirm')}</Button>
|
<Button variant='primary' onClick={onConfirm} className='flex items-center justify-center min-w-20 text-center text-white rounded-lg cursor-pointer h-9 '>{confirmText || t('common.operation.confirm')}</Button>
|
||||||
<Button onClick={onCancel} className='flex items-center justify-center min-w-20 text-center text-gray-500 border rounded-lg cursor-pointer h-9 border-color-gray-200'>{cancelText || t('common.operation.cancel')}</Button>
|
<Button onClick={onCancel} className='flex items-center justify-center min-w-20 text-center text-gray-500 border rounded-lg cursor-pointer h-9 border-color-gray-200'>{cancelText || t('common.operation.cancel')}</Button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -51,7 +51,7 @@ const ConfirmCommon: FC<ConfirmCommonProps> = ({
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Modal isShow={isShow} onClose={() => {}} className='!w-[480px] !max-w-[480px] !p-0 !rounded-2xl' wrapperClassName={confirmWrapperClassName}>
|
<Modal isShow={isShow} onClose={() => { }} className='!w-[480px] !max-w-[480px] !p-0 !rounded-2xl' wrapperClassName={confirmWrapperClassName}>
|
||||||
<div className={cn(s[`wrapper-${type}`], 'relative p-8')}>
|
<div className={cn(s[`wrapper-${type}`], 'relative p-8')}>
|
||||||
<div className='flex items-center justify-center absolute top-4 right-4 w-8 h-8 cursor-pointer' onClick={onCancel}>
|
<div className='flex items-center justify-center absolute top-4 right-4 w-8 h-8 cursor-pointer' onClick={onCancel}>
|
||||||
<XClose className='w-4 h-4 text-gray-500' />
|
<XClose className='w-4 h-4 text-gray-500' />
|
||||||
|
@ -77,7 +77,7 @@ const ConfirmCommon: FC<ConfirmCommonProps> = ({
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
<Button
|
<Button
|
||||||
type='primary'
|
variant='primary'
|
||||||
className={confirmBtnClassName || ''}
|
className={confirmBtnClassName || ''}
|
||||||
onClick={onConfirm}
|
onClick={onConfirm}
|
||||||
disabled={confirmDisabled}
|
disabled={confirmDisabled}
|
||||||
|
|
|
@ -189,14 +189,14 @@ const EmojiPicker: FC<IEmojiPickerProps> = ({
|
||||||
</div>
|
</div>
|
||||||
<Divider className='m-0' />
|
<Divider className='m-0' />
|
||||||
<div className='w-full flex items-center justify-center p-3 gap-2'>
|
<div className='w-full flex items-center justify-center p-3 gap-2'>
|
||||||
<Button type="default" className='w-full' onClick={() => {
|
<Button variant="default" className='w-full' onClick={() => {
|
||||||
onClose && onClose()
|
onClose && onClose()
|
||||||
}}>
|
}}>
|
||||||
{t('app.emoji.cancel')}
|
{t('app.emoji.cancel')}
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
disabled={selectedEmoji === ''}
|
disabled={selectedEmoji === ''}
|
||||||
type="primary"
|
variant="primary"
|
||||||
className='w-full'
|
className='w-full'
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
onSelect && onSelect(selectedEmoji, selectedBackground)
|
onSelect && onSelect(selectedEmoji, selectedBackground)
|
||||||
|
|
|
@ -262,7 +262,7 @@ const ModerationSettingModal: FC<ModerationSettingModalProps> = ({
|
||||||
onClick={() => handleDataTypeChange(provider.key)}
|
onClick={() => handleDataTypeChange(provider.key)}
|
||||||
>
|
>
|
||||||
<div className={`
|
<div className={`
|
||||||
mr-2 w-4 h-4 rounded-full border
|
mr-2 w-4 h-4 rounded-full border
|
||||||
${localeData.type === provider.key ? 'border-[5px] border-primary-600' : 'border border-gray-300'}`} />
|
${localeData.type === provider.key ? 'border-[5px] border-primary-600' : 'border border-gray-300'}`} />
|
||||||
{provider.name}
|
{provider.name}
|
||||||
</div>
|
</div>
|
||||||
|
@ -362,7 +362,7 @@ const ModerationSettingModal: FC<ModerationSettingModalProps> = ({
|
||||||
{t('common.operation.cancel')}
|
{t('common.operation.cancel')}
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
type='primary'
|
variant='primary'
|
||||||
className='text-sm font-medium'
|
className='text-sm font-medium'
|
||||||
onClick={handleSave}
|
onClick={handleSave}
|
||||||
disabled={localeData.type === 'openai_moderation' && !openaiProviderConfiged}
|
disabled={localeData.type === 'openai_moderation' && !openaiProviderConfiged}
|
||||||
|
|
|
@ -169,7 +169,7 @@ const OpeningStatement: FC<OpeningStatementProps> = ({
|
||||||
isFocus ? (
|
isFocus ? (
|
||||||
<div className='flex items-center space-x-1'>
|
<div className='flex items-center space-x-1'>
|
||||||
<div className='px-3 leading-[18px] text-xs font-medium text-gray-700 cursor-pointer' onClick={handleCancel}>{t('common.operation.cancel')}</div>
|
<div className='px-3 leading-[18px] text-xs font-medium text-gray-700 cursor-pointer' onClick={handleCancel}>{t('common.operation.cancel')}</div>
|
||||||
<Button className='!h-8 !px-3 text-xs' onClick={handleConfirm} type="primary">{t('common.operation.save')}</Button>
|
<Button className='!h-8 !px-3 text-xs' onClick={handleConfirm} variant="primary">{t('common.operation.save')}</Button>
|
||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
<OperationBtn type='edit' actionName={hasValue ? '' : t('appDebug.openingStatement.writeOpener') as string} onClick={handleEdit} />
|
<OperationBtn type='edit' actionName={hasValue ? '' : t('appDebug.openingStatement.writeOpener') as string} onClick={handleEdit} />
|
||||||
|
|
|
@ -42,7 +42,7 @@ const ImageLinkInput: FC<ImageLinkInputProps> = ({
|
||||||
placeholder={t('common.imageUploader.pasteImageLinkInputPlaceholder') || ''}
|
placeholder={t('common.imageUploader.pasteImageLinkInputPlaceholder') || ''}
|
||||||
/>
|
/>
|
||||||
<Button
|
<Button
|
||||||
type='primary'
|
variant='primary'
|
||||||
className='!h-6 text-xs font-medium'
|
className='!h-6 text-xs font-medium'
|
||||||
disabled={!imageLink || disabled}
|
disabled={!imageLink || disabled}
|
||||||
onClick={handleClick}
|
onClick={handleClick}
|
||||||
|
|
|
@ -50,7 +50,7 @@ const DeleteConfirmModal: FC<Props> = ({
|
||||||
<div className='flex gap-2 justify-end'>
|
<div className='flex gap-2 justify-end'>
|
||||||
<Button onClick={onHide}>{t('common.operation.cancel')}</Button>
|
<Button onClick={onHide}>{t('common.operation.cancel')}</Button>
|
||||||
<Button
|
<Button
|
||||||
type='warning'
|
variant='warning'
|
||||||
onClick={onRemove}
|
onClick={onRemove}
|
||||||
className='border-red-700 border-[0.5px]'
|
className='border-red-700 border-[0.5px]'
|
||||||
>
|
>
|
||||||
|
|
|
@ -23,7 +23,7 @@ const TagRemoveModal = ({ show, tag, onConfirm, onClose }: TagRemoveModalProps)
|
||||||
<Modal
|
<Modal
|
||||||
className={cn('p-8 max-w-[480px] w-[480px]', s.bg)}
|
className={cn('p-8 max-w-[480px] w-[480px]', s.bg)}
|
||||||
isShow={show}
|
isShow={show}
|
||||||
onClose={() => {}}
|
onClose={() => { }}
|
||||||
>
|
>
|
||||||
<div className='absolute right-4 top-4 p-2 cursor-pointer' onClick={onClose}>
|
<div className='absolute right-4 top-4 p-2 cursor-pointer' onClick={onClose}>
|
||||||
<XClose className='w-4 h-4 text-gray-500' />
|
<XClose className='w-4 h-4 text-gray-500' />
|
||||||
|
@ -40,7 +40,7 @@ const TagRemoveModal = ({ show, tag, onConfirm, onClose }: TagRemoveModalProps)
|
||||||
</div>
|
</div>
|
||||||
<div className='pt-6 flex items-center justify-end'>
|
<div className='pt-6 flex items-center justify-end'>
|
||||||
<Button className='mr-2 text-gray-700 text-sm font-medium' onClick={onClose}>{t('common.operation.cancel')}</Button>
|
<Button className='mr-2 text-gray-700 text-sm font-medium' onClick={onClose}>{t('common.operation.cancel')}</Button>
|
||||||
<Button className='text-sm font-medium border-red-700 border-[0.5px]' type="warning" onClick={onConfirm}>{t('common.operation.delete')}</Button>
|
<Button className='text-sm font-medium border-red-700 border-[0.5px]' variant="warning" onClick={onConfirm}>{t('common.operation.delete')}</Button>
|
||||||
</div>
|
</div>
|
||||||
</Modal>
|
</Modal>
|
||||||
)
|
)
|
||||||
|
|
|
@ -192,7 +192,7 @@ const CustomWebAppBrand = () => {
|
||||||
fileId && (
|
fileId && (
|
||||||
<>
|
<>
|
||||||
<Button
|
<Button
|
||||||
type='primary'
|
variant='primary'
|
||||||
className='mr-2 !h-8 !px-3 !py-0 !text-[13px]'
|
className='mr-2 !h-8 !px-3 !py-0 !text-[13px]'
|
||||||
onClick={handleApply}
|
onClick={handleApply}
|
||||||
disabled={webappBrandRemoved || !isCurrentWorkspaceManager}
|
disabled={webappBrandRemoved || !isCurrentWorkspaceManager}
|
||||||
|
|
|
@ -282,7 +282,7 @@ const EmbeddingProcess: FC<Props> = ({ datasetId, batchId, documents = [], index
|
||||||
</div>
|
</div>
|
||||||
<RuleDetail sourceData={ruleDetail} />
|
<RuleDetail sourceData={ruleDetail} />
|
||||||
<div className='flex items-center gap-2 mt-10'>
|
<div className='flex items-center gap-2 mt-10'>
|
||||||
<Button className='w-fit' type='primary' onClick={navToDocumentList}>
|
<Button className='w-fit' variant='primary' onClick={navToDocumentList}>
|
||||||
<span>{t('datasetCreation.stepThree.navTo')}</span>
|
<span>{t('datasetCreation.stepThree.navTo')}</span>
|
||||||
<ArrowRightIcon className='h-4 w-4 ml-2 stroke-current stroke-1' />
|
<ArrowRightIcon className='h-4 w-4 ml-2 stroke-current stroke-1' />
|
||||||
</Button>
|
</Button>
|
||||||
|
|
|
@ -53,7 +53,7 @@ const EmptyDatasetCreationModal = ({
|
||||||
>
|
>
|
||||||
<div className={s.modalHeader}>
|
<div className={s.modalHeader}>
|
||||||
<div className={s.title}>{t('datasetCreation.stepOne.modal.title')}</div>
|
<div className={s.title}>{t('datasetCreation.stepOne.modal.title')}</div>
|
||||||
<span className={s.close} onClick={onHide}/>
|
<span className={s.close} onClick={onHide} />
|
||||||
</div>
|
</div>
|
||||||
<div className={s.tip}>{t('datasetCreation.stepOne.modal.tip')}</div>
|
<div className={s.tip}>{t('datasetCreation.stepOne.modal.tip')}</div>
|
||||||
<div className={s.form}>
|
<div className={s.form}>
|
||||||
|
@ -61,7 +61,7 @@ const EmptyDatasetCreationModal = ({
|
||||||
<Input className='!h-8' value={inputValue} placeholder={t('datasetCreation.stepOne.modal.placeholder') || ''} onChange={setInputValue} />
|
<Input className='!h-8' value={inputValue} placeholder={t('datasetCreation.stepOne.modal.placeholder') || ''} onChange={setInputValue} />
|
||||||
</div>
|
</div>
|
||||||
<div className='flex flex-row-reverse'>
|
<div className='flex flex-row-reverse'>
|
||||||
<Button className='w-24 ml-2' type='primary' onClick={submit}>{t('datasetCreation.stepOne.modal.confirmButton')}</Button>
|
<Button className='w-24 ml-2' variant='primary' onClick={submit}>{t('datasetCreation.stepOne.modal.confirmButton')}</Button>
|
||||||
<Button className='w-24' onClick={onHide}>{t('datasetCreation.stepOne.modal.cancelButton')}</Button>
|
<Button className='w-24' onClick={onHide}>{t('datasetCreation.stepOne.modal.cancelButton')}</Button>
|
||||||
</div>
|
</div>
|
||||||
</Modal>
|
</Modal>
|
||||||
|
|
|
@ -49,7 +49,7 @@ export const NotionConnector = ({ onSetting }: NotionConnectorProps) => {
|
||||||
<span className={s.notionIcon} />
|
<span className={s.notionIcon} />
|
||||||
<div className={s.title}>{t('datasetCreation.stepOne.notionSyncTitle')}</div>
|
<div className={s.title}>{t('datasetCreation.stepOne.notionSyncTitle')}</div>
|
||||||
<div className={s.tip}>{t('datasetCreation.stepOne.notionSyncTip')}</div>
|
<div className={s.tip}>{t('datasetCreation.stepOne.notionSyncTip')}</div>
|
||||||
<Button className='h-8' type='primary' onClick={onSetting}>{t('datasetCreation.stepOne.connect')}</Button>
|
<Button className='h-8' variant='primary' onClick={onSetting}>{t('datasetCreation.stepOne.connect')}</Button>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -197,7 +197,7 @@ const StepOne = ({
|
||||||
<VectorSpaceFull />
|
<VectorSpaceFull />
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
<Button disabled={nextDisabled} className={s.submitButton} type='primary' onClick={onStepChange}>{t('datasetCreation.stepOne.button')}</Button>
|
<Button disabled={nextDisabled} className={s.submitButton} variant='primary' onClick={onStepChange}>{t('datasetCreation.stepOne.button')}</Button>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
{dataSourceType === DataSourceType.NOTION && (
|
{dataSourceType === DataSourceType.NOTION && (
|
||||||
|
@ -217,7 +217,7 @@ const StepOne = ({
|
||||||
<VectorSpaceFull />
|
<VectorSpaceFull />
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
<Button disabled={isShowVectorSpaceFull || !notionPages.length} className={s.submitButton} type='primary' onClick={onStepChange}>{t('datasetCreation.stepOne.button')}</Button>
|
<Button disabled={isShowVectorSpaceFull || !notionPages.length} className={s.submitButton} variant='primary' onClick={onStepChange}>{t('datasetCreation.stepOne.button')}</Button>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
</>
|
</>
|
||||||
|
|
|
@ -655,7 +655,7 @@ const StepTwo = ({
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className={s.formFooter}>
|
<div className={s.formFooter}>
|
||||||
<Button type="primary" className={cn(s.button, '!h-8')} onClick={confirmChangeCustomConfig}>{t('datasetCreation.stepTwo.preview')}</Button>
|
<Button variant="primary" className={cn(s.button, '!h-8')} onClick={confirmChangeCustomConfig}>{t('datasetCreation.stepTwo.preview')}</Button>
|
||||||
<Button className={cn(s.button, 'ml-2 !h-8')} onClick={resetRules}>{t('datasetCreation.stepTwo.reset')}</Button>
|
<Button className={cn(s.button, 'ml-2 !h-8')} onClick={resetRules}>{t('datasetCreation.stepTwo.reset')}</Button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -891,12 +891,12 @@ const StepTwo = ({
|
||||||
<div className='flex items-center mt-8 py-2'>
|
<div className='flex items-center mt-8 py-2'>
|
||||||
<Button onClick={() => onStepChange && onStepChange(-1)}>{t('datasetCreation.stepTwo.previousStep')}</Button>
|
<Button onClick={() => onStepChange && onStepChange(-1)}>{t('datasetCreation.stepTwo.previousStep')}</Button>
|
||||||
<div className={s.divider} />
|
<div className={s.divider} />
|
||||||
<Button loading={isCreating} type='primary' onClick={createHandle}>{t('datasetCreation.stepTwo.nextStep')}</Button>
|
<Button loading={isCreating} variant='primary' onClick={createHandle}>{t('datasetCreation.stepTwo.nextStep')}</Button>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
: (
|
: (
|
||||||
<div className='flex items-center mt-8 py-2'>
|
<div className='flex items-center mt-8 py-2'>
|
||||||
<Button loading={isCreating} type='primary' onClick={createHandle}>{t('datasetCreation.stepTwo.save')}</Button>
|
<Button loading={isCreating} variant='primary' onClick={createHandle}>{t('datasetCreation.stepTwo.save')}</Button>
|
||||||
<Button className='ml-2' onClick={onCancel}>{t('datasetCreation.stepTwo.cancel')}</Button>
|
<Button className='ml-2' onClick={onCancel}>{t('datasetCreation.stepTwo.cancel')}</Button>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
|
@ -30,12 +30,12 @@ const StopEmbeddingModal = ({
|
||||||
onClose={onHide}
|
onClose={onHide}
|
||||||
className={cn(s.modal, '!max-w-[480px]', 'px-8')}
|
className={cn(s.modal, '!max-w-[480px]', 'px-8')}
|
||||||
>
|
>
|
||||||
<div className={s.icon}/>
|
<div className={s.icon} />
|
||||||
<span className={s.close} onClick={onHide}/>
|
<span className={s.close} onClick={onHide} />
|
||||||
<div className={s.title}>{t('datasetCreation.stepThree.modelTitle')}</div>
|
<div className={s.title}>{t('datasetCreation.stepThree.modelTitle')}</div>
|
||||||
<div className={s.content}>{t('datasetCreation.stepThree.modelContent')}</div>
|
<div className={s.content}>{t('datasetCreation.stepThree.modelContent')}</div>
|
||||||
<div className='flex flex-row-reverse'>
|
<div className='flex flex-row-reverse'>
|
||||||
<Button className='w-24 ml-2' type='primary' onClick={submit}>{t('datasetCreation.stepThree.modelButtonConfirm')}</Button>
|
<Button className='w-24 ml-2' variant='primary' onClick={submit}>{t('datasetCreation.stepThree.modelButtonConfirm')}</Button>
|
||||||
<Button className='w-24' onClick={onHide}>{t('datasetCreation.stepThree.modelButtonCancel')}</Button>
|
<Button className='w-24' onClick={onHide}>{t('datasetCreation.stepThree.modelButtonCancel')}</Button>
|
||||||
</div>
|
</div>
|
||||||
</Modal>
|
</Modal>
|
||||||
|
|
|
@ -39,7 +39,7 @@ const BatchModal: FC<IBatchModalProps> = ({
|
||||||
}, [isShow])
|
}, [isShow])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Modal isShow={isShow} onClose={() => {}} className='px-8 py-6 !max-w-[520px] !rounded-xl'>
|
<Modal isShow={isShow} onClose={() => { }} className='px-8 py-6 !max-w-[520px] !rounded-xl'>
|
||||||
<div className='relative pb-1 text-xl font-medium leading-[30px] text-gray-900'>{t('datasetDocuments.list.batchModal.title')}</div>
|
<div className='relative pb-1 text-xl font-medium leading-[30px] text-gray-900'>{t('datasetDocuments.list.batchModal.title')}</div>
|
||||||
<div className='absolute right-4 top-4 p-2 cursor-pointer' onClick={onCancel}>
|
<div className='absolute right-4 top-4 p-2 cursor-pointer' onClick={onCancel}>
|
||||||
<XClose className='w-4 h-4 text-gray-500' />
|
<XClose className='w-4 h-4 text-gray-500' />
|
||||||
|
@ -55,7 +55,7 @@ const BatchModal: FC<IBatchModalProps> = ({
|
||||||
<Button className='mr-2 text-gray-700 text-sm font-medium' onClick={onCancel}>
|
<Button className='mr-2 text-gray-700 text-sm font-medium' onClick={onCancel}>
|
||||||
{t('datasetDocuments.list.batchModal.cancel')}
|
{t('datasetDocuments.list.batchModal.cancel')}
|
||||||
</Button>
|
</Button>
|
||||||
<Button className='text-sm font-medium' type="primary" onClick={handleSend} disabled={!currentCSV}>
|
<Button className='text-sm font-medium' variant="primary" onClick={handleSend} disabled={!currentCSV}>
|
||||||
{t('datasetDocuments.list.batchModal.run')}
|
{t('datasetDocuments.list.batchModal.run')}
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -224,7 +224,7 @@ const SegmentCard: FC<ISegmentCardProps> = ({
|
||||||
<div className='flex gap-2 justify-end'>
|
<div className='flex gap-2 justify-end'>
|
||||||
<Button onClick={() => setShowModal(false)}>{t('common.operation.cancel')}</Button>
|
<Button onClick={() => setShowModal(false)}>{t('common.operation.cancel')}</Button>
|
||||||
<Button
|
<Button
|
||||||
type='warning'
|
variant='warning'
|
||||||
onClick={async () => {
|
onClick={async () => {
|
||||||
await onDelete?.(id)
|
await onDelete?.(id)
|
||||||
}}
|
}}
|
||||||
|
|
|
@ -139,7 +139,7 @@ const SegmentDetailComponent: FC<ISegmentDetailProps> = ({
|
||||||
{t('common.operation.cancel')}
|
{t('common.operation.cancel')}
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
type='primary'
|
variant='primary'
|
||||||
className='!h-7 !px-3 !py-[5px] text-xs font-medium !rounded-md'
|
className='!h-7 !px-3 !py-[5px] text-xs font-medium !rounded-md'
|
||||||
onClick={handleSave}
|
onClick={handleSave}
|
||||||
disabled={loading}
|
disabled={loading}
|
||||||
|
@ -402,7 +402,7 @@ const Completed: FC<ICompletedProps> = ({
|
||||||
onClick={onClickCard}
|
onClick={onClickCard}
|
||||||
archived={archived}
|
archived={archived}
|
||||||
/>
|
/>
|
||||||
<Modal isShow={currSegment.showModal} onClose={() => {}} className='!max-w-[640px] !overflow-visible'>
|
<Modal isShow={currSegment.showModal} onClose={() => { }} className='!max-w-[640px] !overflow-visible'>
|
||||||
<SegmentDetail
|
<SegmentDetail
|
||||||
embeddingAvailable={embeddingAvailable}
|
embeddingAvailable={embeddingAvailable}
|
||||||
segInfo={currSegment.segInfo ?? { id: '' }}
|
segInfo={currSegment.segInfo ?? { id: '' }}
|
||||||
|
|
|
@ -279,7 +279,7 @@ const EmbeddingDetail: FC<Props> = ({ detail, stopPosition = 'top', datasetId: d
|
||||||
{t('datasetCreation.stepThree.resume')}
|
{t('datasetCreation.stepThree.resume')}
|
||||||
</Button>
|
</Button>
|
||||||
)}
|
)}
|
||||||
<Button className='w-fit' type='primary' onClick={navToDocument}>
|
<Button className='w-fit' variant='primary' onClick={navToDocument}>
|
||||||
<span>{t('datasetCreation.stepThree.navTo')}</span>
|
<span>{t('datasetCreation.stepThree.navTo')}</span>
|
||||||
<ArrowRightIcon className='h-4 w-4 ml-2 stroke-current stroke-1' />
|
<ArrowRightIcon className='h-4 w-4 ml-2 stroke-current stroke-1' />
|
||||||
</Button>
|
</Button>
|
||||||
|
|
|
@ -208,7 +208,7 @@ const Metadata: FC<IMetadataProps> = ({ docDetail, loading, onUpdate }) => {
|
||||||
})}
|
})}
|
||||||
</Radio.Group>
|
</Radio.Group>
|
||||||
{!doc_type && !documentType && (
|
{!doc_type && !documentType && (
|
||||||
<Button type='primary'
|
<Button variant='primary'
|
||||||
onClick={confirmDocType}
|
onClick={confirmDocType}
|
||||||
disabled={!tempDocType}
|
disabled={!tempDocType}
|
||||||
>
|
>
|
||||||
|
@ -216,7 +216,7 @@ const Metadata: FC<IMetadataProps> = ({ docDetail, loading, onUpdate }) => {
|
||||||
</Button>
|
</Button>
|
||||||
)}
|
)}
|
||||||
{documentType && <div className={s.opBtnWrapper}>
|
{documentType && <div className={s.opBtnWrapper}>
|
||||||
<Button onClick={confirmDocType} className={`${s.opBtn} ${s.opSaveBtn}`} type='primary' >{t('common.operation.save')}</Button>
|
<Button onClick={confirmDocType} className={`${s.opBtn} ${s.opSaveBtn}`} variant='primary' >{t('common.operation.save')}</Button>
|
||||||
<Button onClick={cancelDocType} className={`${s.opBtn} ${s.opCancelBtn}`}>{t('common.operation.cancel')}</Button>
|
<Button onClick={cancelDocType} className={`${s.opBtn} ${s.opCancelBtn}`}>{t('common.operation.cancel')}</Button>
|
||||||
</div>}
|
</div>}
|
||||||
</div >
|
</div >
|
||||||
|
@ -324,7 +324,7 @@ const Metadata: FC<IMetadataProps> = ({ docDetail, loading, onUpdate }) => {
|
||||||
<Button onClick={onCancel} className={`${s.opBtn} ${s.opCancelBtn}`}>{t('common.operation.cancel')}</Button>
|
<Button onClick={onCancel} className={`${s.opBtn} ${s.opCancelBtn}`}>{t('common.operation.cancel')}</Button>
|
||||||
<Button onClick={onSave}
|
<Button onClick={onSave}
|
||||||
className={`${s.opBtn} ${s.opSaveBtn}`}
|
className={`${s.opBtn} ${s.opSaveBtn}`}
|
||||||
type='primary'
|
variant='primary'
|
||||||
loading={saveLoading}
|
loading={saveLoading}
|
||||||
>
|
>
|
||||||
{t('common.operation.save')}
|
{t('common.operation.save')}
|
||||||
|
@ -344,7 +344,7 @@ const Metadata: FC<IMetadataProps> = ({ docDetail, loading, onUpdate }) => {
|
||||||
<TypeIcon iconName={metadataMap[metadataParams.documentType || 'book'].iconName || ''} className={s.iconShow} />
|
<TypeIcon iconName={metadataMap[metadataParams.documentType || 'book'].iconName || ''} className={s.iconShow} />
|
||||||
{metadataMap[metadataParams.documentType || 'book'].text}
|
{metadataMap[metadataParams.documentType || 'book'].text}
|
||||||
{editStatus && <div className='inline-flex items-center gap-1 ml-1'>
|
{editStatus && <div className='inline-flex items-center gap-1 ml-1'>
|
||||||
·
|
·
|
||||||
<div
|
<div
|
||||||
onClick={() => { setShowDocTypes(true) }}
|
onClick={() => { setShowDocTypes(true) }}
|
||||||
className='cursor-pointer hover:text-[#155EEF]'
|
className='cursor-pointer hover:text-[#155EEF]'
|
||||||
|
|
|
@ -110,7 +110,7 @@ const NewSegmentModal: FC<NewSegmentModalProps> = ({
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Modal isShow={isShow} onClose={() => {}} className='pt-8 px-8 pb-6 !max-w-[640px] !rounded-xl'>
|
<Modal isShow={isShow} onClose={() => { }} className='pt-8 px-8 pb-6 !max-w-[640px] !rounded-xl'>
|
||||||
<div className={'flex flex-col relative'}>
|
<div className={'flex flex-col relative'}>
|
||||||
<div className='absolute right-0 -top-0.5 flex items-center h-6'>
|
<div className='absolute right-0 -top-0.5 flex items-center h-6'>
|
||||||
<div className='flex justify-center items-center w-6 h-6 cursor-pointer' onClick={handleCancel}>
|
<div className='flex justify-center items-center w-6 h-6 cursor-pointer' onClick={handleCancel}>
|
||||||
|
@ -141,7 +141,7 @@ const NewSegmentModal: FC<NewSegmentModalProps> = ({
|
||||||
{t('common.operation.cancel')}
|
{t('common.operation.cancel')}
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
type='primary'
|
variant='primary'
|
||||||
className='!h-9 !px-4 !py-2 text-sm font-medium !rounded-lg'
|
className='!h-9 !px-4 !py-2 text-sm font-medium !rounded-lg'
|
||||||
onClick={handleSave}
|
onClick={handleSave}
|
||||||
disabled={loading}
|
disabled={loading}
|
||||||
|
|
|
@ -210,7 +210,7 @@ const Documents: FC<IDocumentsProps> = ({ datasetId }) => {
|
||||||
<div className='flex gap-2 justify-center items-center !h-8'>
|
<div className='flex gap-2 justify-center items-center !h-8'>
|
||||||
<RetryButton datasetId={datasetId} />
|
<RetryButton datasetId={datasetId} />
|
||||||
{embeddingAvailable && (
|
{embeddingAvailable && (
|
||||||
<Button type='primary' onClick={routeToDocCreate} className='!h-8 !text-[13px] !shrink-0'>
|
<Button variant='primary' onClick={routeToDocCreate} className='!h-8 !text-[13px] !shrink-0'>
|
||||||
<PlusIcon className='h-4 w-4 mr-2 stroke-current' />
|
<PlusIcon className='h-4 w-4 mr-2 stroke-current' />
|
||||||
{isDataSourceNotion && t('datasetDocuments.list.addPages')}
|
{isDataSourceNotion && t('datasetDocuments.list.addPages')}
|
||||||
{isDataSourceWeb && t('datasetDocuments.list.addUrl')}
|
{isDataSourceWeb && t('datasetDocuments.list.addUrl')}
|
||||||
|
|
|
@ -301,7 +301,7 @@ export const OperationAction: FC<{
|
||||||
<div className='flex gap-2 justify-end'>
|
<div className='flex gap-2 justify-end'>
|
||||||
<Button onClick={() => setShowModal(false)}>{t('common.operation.cancel')}</Button>
|
<Button onClick={() => setShowModal(false)}>{t('common.operation.cancel')}</Button>
|
||||||
<Button
|
<Button
|
||||||
type='warning'
|
variant='warning'
|
||||||
onClick={() => onOperate('delete')}
|
onClick={() => onOperate('delete')}
|
||||||
className='border-red-700 border-[0.5px]'
|
className='border-red-700 border-[0.5px]'
|
||||||
>
|
>
|
||||||
|
|
|
@ -115,7 +115,7 @@ const ModifyRetrievalModal: FC<Props> = ({
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Button className='mr-2 flex-shrink-0' onClick={onHide}>{t('common.operation.cancel')}</Button>
|
<Button className='mr-2 flex-shrink-0' onClick={onHide}>{t('common.operation.cancel')}</Button>
|
||||||
<Button type='primary' className='flex-shrink-0' onClick={handleSave} >{t('common.operation.save')}</Button>
|
<Button variant='primary' className='flex-shrink-0' onClick={handleSave} >{t('common.operation.save')}</Button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
|
|
@ -128,7 +128,7 @@ const TextAreaWithButton = ({
|
||||||
<div>
|
<div>
|
||||||
<Button
|
<Button
|
||||||
onClick={onSubmit}
|
onClick={onSubmit}
|
||||||
type="primary"
|
variant="primary"
|
||||||
loading={loading}
|
loading={loading}
|
||||||
disabled={(!text?.length || text?.length > 200)}
|
disabled={(!text?.length || text?.length > 200)}
|
||||||
>
|
>
|
||||||
|
|
|
@ -58,7 +58,7 @@ const RenameDatasetModal = ({ show, dataset, onSuccess, onClose }: RenameDataset
|
||||||
<Modal
|
<Modal
|
||||||
className='px-8 py-6 max-w-[520px] w-[520px] rounded-xl'
|
className='px-8 py-6 max-w-[520px] w-[520px] rounded-xl'
|
||||||
isShow={show}
|
isShow={show}
|
||||||
onClose={() => {}}
|
onClose={() => { }}
|
||||||
>
|
>
|
||||||
<div className='relative pb-2 text-xl font-medium leading-[30px] text-gray-900'>{t('datasetSettings.title')}</div>
|
<div className='relative pb-2 text-xl font-medium leading-[30px] text-gray-900'>{t('datasetSettings.title')}</div>
|
||||||
<div className='absolute right-4 top-4 p-2 cursor-pointer' onClick={onClose}>
|
<div className='absolute right-4 top-4 p-2 cursor-pointer' onClick={onClose}>
|
||||||
|
@ -96,7 +96,7 @@ const RenameDatasetModal = ({ show, dataset, onSuccess, onClose }: RenameDataset
|
||||||
</div>
|
</div>
|
||||||
<div className='pt-6 flex justify-end'>
|
<div className='pt-6 flex justify-end'>
|
||||||
<Button className='mr-2 text-gray-700 text-sm font-medium' onClick={onClose}>{t('common.operation.cancel')}</Button>
|
<Button className='mr-2 text-gray-700 text-sm font-medium' onClick={onClose}>{t('common.operation.cancel')}</Button>
|
||||||
<Button className='text-sm font-medium' disabled={loading} type="primary" onClick={onConfirm}>{t('common.operation.save')}</Button>
|
<Button className='text-sm font-medium' disabled={loading} variant="primary" onClick={onConfirm}>{t('common.operation.save')}</Button>
|
||||||
</div>
|
</div>
|
||||||
</Modal>
|
</Modal>
|
||||||
)
|
)
|
||||||
|
|
|
@ -244,7 +244,7 @@ const Form = () => {
|
||||||
<div className='w-[480px]'>
|
<div className='w-[480px]'>
|
||||||
<Button
|
<Button
|
||||||
className='min-w-24 text-sm'
|
className='min-w-24 text-sm'
|
||||||
type='primary'
|
variant='primary'
|
||||||
onClick={handleSave}
|
onClick={handleSave}
|
||||||
>
|
>
|
||||||
{t('datasetSettings.form.save')}
|
{t('datasetSettings.form.save')}
|
||||||
|
|
|
@ -17,7 +17,7 @@ const SecretKeyButton = ({ className, appId, iconCls, textCls }: ISecretKeyButto
|
||||||
const { t } = useTranslation()
|
const { t } = useTranslation()
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Button className={`px-3 ${className}`} type='default' onClick={() => setVisible(true)}>
|
<Button className={`px-3 ${className}`} variant='default' onClick={() => setVisible(true)}>
|
||||||
<div className={'flex items-center justify-center w-4 h-4 mr-2'}>
|
<div className={'flex items-center justify-center w-4 h-4 mr-2'}>
|
||||||
<svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg" className={iconCls}>
|
<svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg" className={iconCls}>
|
||||||
<path d="M9 3.66672C9.35362 3.66672 9.69276 3.80719 9.94281 4.05724C10.1929 4.30729 10.3333 4.64643 10.3333 5.00005M13 5.00005C13.0002 5.62483 12.854 6.24097 12.5732 6.79908C12.2924 7.3572 11.8847 7.84177 11.3829 8.21397C10.8811 8.58617 10.2991 8.83564 9.68347 8.94239C9.06788 9.04915 8.43584 9.01022 7.838 8.82872L6.33333 10.3334H5V11.6667H3.66667V13.0001H1.66667C1.48986 13.0001 1.32029 12.9298 1.19526 12.8048C1.07024 12.6798 1 12.5102 1 12.3334V10.6094C1.00004 10.4326 1.0703 10.263 1.19533 10.1381L5.17133 6.16205C5.00497 5.61206 4.95904 5.03268 5.0367 4.46335C5.11435 3.89402 5.31375 3.3481 5.62133 2.86275C5.92891 2.3774 6.33744 1.96401 6.81913 1.65073C7.30082 1.33745 7.84434 1.13162 8.41272 1.04725C8.9811 0.96289 9.56098 1.00197 10.1129 1.16184C10.6648 1.32171 11.1758 1.59861 11.6111 1.97369C12.0464 2.34878 12.3958 2.81324 12.6354 3.33548C12.8751 3.85771 12.9994 4.42545 13 5.00005Z" stroke="#1F2A37" strokeLinecap="round" strokeLinejoin="round" />
|
<path d="M9 3.66672C9.35362 3.66672 9.69276 3.80719 9.94281 4.05724C10.1929 4.30729 10.3333 4.64643 10.3333 5.00005M13 5.00005C13.0002 5.62483 12.854 6.24097 12.5732 6.79908C12.2924 7.3572 11.8847 7.84177 11.3829 8.21397C10.8811 8.58617 10.2991 8.83564 9.68347 8.94239C9.06788 9.04915 8.43584 9.01022 7.838 8.82872L6.33333 10.3334H5V11.6667H3.66667V13.0001H1.66667C1.48986 13.0001 1.32029 12.9298 1.19526 12.8048C1.07024 12.6798 1 12.5102 1 12.3334V10.6094C1.00004 10.4326 1.0703 10.263 1.19533 10.1381L5.17133 6.16205C5.00497 5.61206 4.95904 5.03268 5.0367 4.46335C5.11435 3.89402 5.31375 3.3481 5.62133 2.86275C5.92891 2.3774 6.33744 1.96401 6.81913 1.65073C7.30082 1.33745 7.84434 1.13162 8.41272 1.04725C8.9811 0.96289 9.56098 1.00197 10.1129 1.16184C10.6648 1.32171 11.1758 1.59861 11.6111 1.97369C12.0464 2.34878 12.3958 2.81324 12.6354 3.33548C12.8751 3.85771 12.9994 4.42545 13 5.00005Z" stroke="#1F2A37" strokeLinecap="round" strokeLinejoin="round" />
|
||||||
|
|
|
@ -29,7 +29,7 @@ const SecretKeyGenerateModal = ({
|
||||||
<InputCopy className='w-full' value={newKey?.token} />
|
<InputCopy className='w-full' value={newKey?.token} />
|
||||||
</div>
|
</div>
|
||||||
<div className='flex justify-end my-4'>
|
<div className='flex justify-end my-4'>
|
||||||
<Button type='default' className={`flex-shrink-0 ${s.w64}`} onClick={onClose}>
|
<Button variant='default' className={`flex-shrink-0 ${s.w64}`} onClick={onClose}>
|
||||||
<span className='text-xs font-medium text-gray-800'>{t('appApi.actionMsg.ok')}</span>
|
<span className='text-xs font-medium text-gray-800'>{t('appApi.actionMsg.ok')}</span>
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -128,7 +128,7 @@ const SecretKeyModal = ({
|
||||||
setCopyValue(api.token)
|
setCopyValue(api.token)
|
||||||
}}></div>
|
}}></div>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
{ isCurrentWorkspaceManager
|
{isCurrentWorkspaceManager
|
||||||
&& <div className={`flex items-center justify-center flex-shrink-0 w-6 h-6 rounded-lg cursor-pointer ${s.trashIcon}`} onClick={() => {
|
&& <div className={`flex items-center justify-center flex-shrink-0 w-6 h-6 rounded-lg cursor-pointer ${s.trashIcon}`} onClick={() => {
|
||||||
setDelKeyId(api.id)
|
setDelKeyId(api.id)
|
||||||
setShowConfirmDelete(true)
|
setShowConfirmDelete(true)
|
||||||
|
@ -143,7 +143,7 @@ const SecretKeyModal = ({
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
<div className='flex'>
|
<div className='flex'>
|
||||||
<Button type='default' className={`flex flex-shrink-0 mt-4 ${s.autoWidth}`} onClick={onCreate} disabled={ !currentWorkspace || !isCurrentWorkspaceManager}>
|
<Button variant='default' className={`flex flex-shrink-0 mt-4 ${s.autoWidth}`} onClick={onCreate} disabled={ !currentWorkspace || !isCurrentWorkspaceManager}>
|
||||||
<PlusIcon className='flex flex-shrink-0 w-4 h-4' />
|
<PlusIcon className='flex flex-shrink-0 w-4 h-4' />
|
||||||
<div className='text-xs font-medium text-gray-800'>{t('appApi.apiKeyModal.createNewSecretKey')}</div>
|
<div className='text-xs font-medium text-gray-800'>{t('appApi.apiKeyModal.createNewSecretKey')}</div>
|
||||||
</Button>
|
</Button>
|
||||||
|
|
|
@ -62,7 +62,7 @@ const AppCard = ({
|
||||||
{isExplore && canCreate && (
|
{isExplore && canCreate && (
|
||||||
<div className={cn('hidden items-center flex-wrap min-h-[42px] px-[14px] pt-2 pb-[10px] group-hover:flex')}>
|
<div className={cn('hidden items-center flex-wrap min-h-[42px] px-[14px] pt-2 pb-[10px] group-hover:flex')}>
|
||||||
<div className={cn('flex items-center w-full space-x-2')}>
|
<div className={cn('flex items-center w-full space-x-2')}>
|
||||||
<Button type='primary' className='grow flex items-center !h-7' onClick={() => onCreate()}>
|
<Button variant='primary' className='grow flex items-center !h-7' onClick={() => onCreate()}>
|
||||||
<PlusIcon className='w-4 h-4 mr-1' />
|
<PlusIcon className='w-4 h-4 mr-1' />
|
||||||
<span className='text-xs'>{t('explore.appCard.addToWorkspace')}</span>
|
<span className='text-xs'>{t('explore.appCard.addToWorkspace')}</span>
|
||||||
</Button>
|
</Button>
|
||||||
|
@ -72,7 +72,7 @@ const AppCard = ({
|
||||||
{!isExplore && (
|
{!isExplore && (
|
||||||
<div className={cn('hidden items-center flex-wrap min-h-[42px] px-[14px] pt-2 pb-[10px] group-hover:flex')}>
|
<div className={cn('hidden items-center flex-wrap min-h-[42px] px-[14px] pt-2 pb-[10px] group-hover:flex')}>
|
||||||
<div className={cn('flex items-center w-full space-x-2')}>
|
<div className={cn('flex items-center w-full space-x-2')}>
|
||||||
<Button type='primary' className='grow flex items-center !h-7' onClick={() => onCreate()}>
|
<Button variant='primary' className='grow flex items-center !h-7' onClick={() => onCreate()}>
|
||||||
<PlusIcon className='w-4 h-4 mr-1' />
|
<PlusIcon className='w-4 h-4 mr-1' />
|
||||||
<span className='text-xs'>{t('app.newApp.useTemplate')}</span>
|
<span className='text-xs'>{t('app.newApp.useTemplate')}</span>
|
||||||
</Button>
|
</Button>
|
||||||
|
|
|
@ -102,7 +102,7 @@ const CreateAppModal = ({
|
||||||
{!isEditModal && isAppsFull && <AppsFull loc='app-explore-create' />}
|
{!isEditModal && isAppsFull && <AppsFull loc='app-explore-create' />}
|
||||||
</div>
|
</div>
|
||||||
<div className='flex flex-row-reverse'>
|
<div className='flex flex-row-reverse'>
|
||||||
<Button disabled={!isEditModal && isAppsFull} className='w-24 ml-2' type='primary' onClick={submit}>{!isEditModal ? t('common.operation.create') : t('common.operation.save')}</Button>
|
<Button disabled={!isEditModal && isAppsFull} className='w-24 ml-2' variant='primary' onClick={submit}>{!isEditModal ? t('common.operation.create') : t('common.operation.save')}</Button>
|
||||||
<Button className='w-24' onClick={onHide}>{t('common.operation.cancel')}</Button>
|
<Button className='w-24' onClick={onHide}>{t('common.operation.cancel')}</Button>
|
||||||
</div>
|
</div>
|
||||||
</Modal>
|
</Modal>
|
||||||
|
|
|
@ -182,7 +182,7 @@ export default function AccountPage() {
|
||||||
<Button className='mr-2 text-sm font-medium' onClick={() => setEditNameModalVisible(false)}>{t('common.operation.cancel')}</Button>
|
<Button className='mr-2 text-sm font-medium' onClick={() => setEditNameModalVisible(false)}>{t('common.operation.cancel')}</Button>
|
||||||
<Button
|
<Button
|
||||||
disabled={editing || !editName}
|
disabled={editing || !editName}
|
||||||
type='primary'
|
variant='primary'
|
||||||
className='text-sm font-medium'
|
className='text-sm font-medium'
|
||||||
onClick={handleSaveName}
|
onClick={handleSaveName}
|
||||||
>
|
>
|
||||||
|
@ -235,7 +235,7 @@ export default function AccountPage() {
|
||||||
}}>{t('common.operation.cancel')}</Button>
|
}}>{t('common.operation.cancel')}</Button>
|
||||||
<Button
|
<Button
|
||||||
disabled={editing}
|
disabled={editing}
|
||||||
type='primary'
|
variant='primary'
|
||||||
className='text-sm font-medium'
|
className='text-sm font-medium'
|
||||||
onClick={handleSavePassowrd}
|
onClick={handleSavePassowrd}
|
||||||
>
|
>
|
||||||
|
|
|
@ -135,7 +135,7 @@ const ApiBasedExtensionModal: FC<ApiBasedExtensionModalProps> = ({
|
||||||
{t('common.operation.cancel')}
|
{t('common.operation.cancel')}
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
type='primary'
|
variant='primary'
|
||||||
className='text-sm font-medium'
|
className='text-sm font-medium'
|
||||||
disabled={!localeData.name || !localeData.api_endpoint || !localeData.api_key || loading}
|
disabled={!localeData.name || !localeData.api_endpoint || !localeData.api_key || loading}
|
||||||
onClick={handleSave}
|
onClick={handleSave}
|
||||||
|
|
|
@ -61,7 +61,7 @@ const InviteModal = ({
|
||||||
onSend(invitation_results)
|
onSend(invitation_results)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (e) {}
|
catch (e) { }
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
notify({ type: 'error', message: t('common.members.emailInvalid') })
|
notify({ type: 'error', message: t('common.members.emailInvalid') })
|
||||||
|
@ -92,7 +92,7 @@ const InviteModal = ({
|
||||||
<div data-tag key={index} className={cn(s.emailBackground)}>
|
<div data-tag key={index} className={cn(s.emailBackground)}>
|
||||||
<div data-tag-item>{email}</div>
|
<div data-tag-item>{email}</div>
|
||||||
<span data-tag-handle onClick={() => removeEmail(index)}>
|
<span data-tag-handle onClick={() => removeEmail(index)}>
|
||||||
×
|
×
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
|
@ -151,7 +151,7 @@ const InviteModal = ({
|
||||||
className='w-full text-sm font-medium'
|
className='w-full text-sm font-medium'
|
||||||
onClick={handleSend}
|
onClick={handleSend}
|
||||||
disabled={!emails.length}
|
disabled={!emails.length}
|
||||||
type='primary'
|
variant='primary'
|
||||||
>
|
>
|
||||||
{t('common.members.sendInvite')}
|
{t('common.members.sendInvite')}
|
||||||
</Button>
|
</Button>
|
||||||
|
|
|
@ -49,34 +49,34 @@ const InvitedModal = ({
|
||||||
<div className='flex flex-col gap-2 mb-9'>
|
<div className='flex flex-col gap-2 mb-9'>
|
||||||
{
|
{
|
||||||
!!successInvationResults.length
|
!!successInvationResults.length
|
||||||
&& <>
|
&& <>
|
||||||
<div className='py-2 text-sm font-Medium text-gray-900'>{t('common.members.invitationLink')}</div>
|
<div className='py-2 text-sm font-Medium text-gray-900'>{t('common.members.invitationLink')}</div>
|
||||||
{successInvationResults.map(item =>
|
{successInvationResults.map(item =>
|
||||||
<InvitationLink key={item.email} value={item} />)}
|
<InvitationLink key={item.email} value={item} />)}
|
||||||
</>
|
</>
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
!!failedInvationResults.length
|
!!failedInvationResults.length
|
||||||
&& <>
|
&& <>
|
||||||
<div className='py-2 text-sm font-Medium text-gray-900'>{t('common.members.failedinvitationEmails')}</div>
|
<div className='py-2 text-sm font-Medium text-gray-900'>{t('common.members.failedinvitationEmails')}</div>
|
||||||
<div className='flex flex-wrap justify-between gap-y-1'>
|
<div className='flex flex-wrap justify-between gap-y-1'>
|
||||||
{
|
{
|
||||||
failedInvationResults.map(item =>
|
failedInvationResults.map(item =>
|
||||||
<div key={item.email} className='flex justify-center border border-red-300 rounded-md px-1 bg-orange-50'>
|
<div key={item.email} className='flex justify-center border border-red-300 rounded-md px-1 bg-orange-50'>
|
||||||
<Tooltip
|
<Tooltip
|
||||||
selector={`invitation-tag-${item.email}`}
|
selector={`invitation-tag-${item.email}`}
|
||||||
htmlContent={item.message}
|
htmlContent={item.message}
|
||||||
>
|
>
|
||||||
<div className='flex justify-center items-center text-sm gap-1'>
|
<div className='flex justify-center items-center text-sm gap-1'>
|
||||||
{item.email}
|
{item.email}
|
||||||
<QuestionMarkCircleIcon className='w-4 h-4 text-red-300' />
|
<QuestionMarkCircleIcon className='w-4 h-4 text-red-300' />
|
||||||
</div>
|
</div>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
</div>,
|
</div>,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
|
@ -85,7 +85,7 @@ const InvitedModal = ({
|
||||||
<Button
|
<Button
|
||||||
className='w-[96px] text-sm font-medium'
|
className='w-[96px] text-sm font-medium'
|
||||||
onClick={onCancel}
|
onClick={onCancel}
|
||||||
type='primary'
|
variant='primary'
|
||||||
>
|
>
|
||||||
{t('common.members.ok')}
|
{t('common.members.ok')}
|
||||||
</Button>
|
</Button>
|
||||||
|
|
|
@ -339,7 +339,7 @@ const ModelModal: FC<ModelModalProps> = ({
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
className='h-9 text-sm font-medium'
|
className='h-9 text-sm font-medium'
|
||||||
type='primary'
|
variant='primary'
|
||||||
onClick={handleSave}
|
onClick={handleSave}
|
||||||
disabled={
|
disabled={
|
||||||
loading
|
loading
|
||||||
|
|
|
@ -148,7 +148,7 @@ const SystemModel: FC<SystemModelSelectorProps> = ({
|
||||||
<div className='w-[261px] text-gray-500'>{t('common.modelProvider.systemReasoningModel.tip')}</div>
|
<div className='w-[261px] text-gray-500'>{t('common.modelProvider.systemReasoningModel.tip')}</div>
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<HelpCircle className='ml-0.5 w-[14px] h-[14px] text-gray-400'/>
|
<HelpCircle className='ml-0.5 w-[14px] h-[14px] text-gray-400' />
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
|
@ -168,7 +168,7 @@ const SystemModel: FC<SystemModelSelectorProps> = ({
|
||||||
<div className='w-[261px] text-gray-500'>{t('common.modelProvider.embeddingModel.tip')}</div>
|
<div className='w-[261px] text-gray-500'>{t('common.modelProvider.embeddingModel.tip')}</div>
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<HelpCircle className='ml-0.5 w-[14px] h-[14px] text-gray-400'/>
|
<HelpCircle className='ml-0.5 w-[14px] h-[14px] text-gray-400' />
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
|
@ -188,7 +188,7 @@ const SystemModel: FC<SystemModelSelectorProps> = ({
|
||||||
<div className='w-[261px] text-gray-500'>{t('common.modelProvider.rerankModel.tip')}</div>
|
<div className='w-[261px] text-gray-500'>{t('common.modelProvider.rerankModel.tip')}</div>
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<HelpCircle className='ml-0.5 w-[14px] h-[14px] text-gray-400'/>
|
<HelpCircle className='ml-0.5 w-[14px] h-[14px] text-gray-400' />
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
|
@ -208,7 +208,7 @@ const SystemModel: FC<SystemModelSelectorProps> = ({
|
||||||
<div className='w-[261px] text-gray-500'>{t('common.modelProvider.speechToTextModel.tip')}</div>
|
<div className='w-[261px] text-gray-500'>{t('common.modelProvider.speechToTextModel.tip')}</div>
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<HelpCircle className='ml-0.5 w-[14px] h-[14px] text-gray-400'/>
|
<HelpCircle className='ml-0.5 w-[14px] h-[14px] text-gray-400' />
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
|
@ -228,7 +228,7 @@ const SystemModel: FC<SystemModelSelectorProps> = ({
|
||||||
<div className='w-[261px] text-gray-500'>{t('common.modelProvider.ttsModel.tip')}</div>
|
<div className='w-[261px] text-gray-500'>{t('common.modelProvider.ttsModel.tip')}</div>
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<HelpCircle className='ml-0.5 w-[14px] h-[14px] text-gray-400'/>
|
<HelpCircle className='ml-0.5 w-[14px] h-[14px] text-gray-400' />
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
|
@ -247,7 +247,7 @@ const SystemModel: FC<SystemModelSelectorProps> = ({
|
||||||
{t('common.operation.cancel')}
|
{t('common.operation.cancel')}
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
type='primary'
|
variant='primary'
|
||||||
className='!h-8 !text-[13px]'
|
className='!h-8 !text-[13px]'
|
||||||
onClick={handleSave}
|
onClick={handleSave}
|
||||||
disabled={!isCurrentWorkspaceManager}
|
disabled={!isCurrentWorkspaceManager}
|
||||||
|
|
|
@ -38,7 +38,7 @@ const RenameModal: FC<IRenameModalProps> = ({
|
||||||
|
|
||||||
<div className='mt-10 flex justify-end'>
|
<div className='mt-10 flex justify-end'>
|
||||||
<Button className='mr-2 flex-shrink-0' onClick={onClose}>{t('common.operation.cancel')}</Button>
|
<Button className='mr-2 flex-shrink-0' onClick={onClose}>{t('common.operation.cancel')}</Button>
|
||||||
<Button type='primary' className='flex-shrink-0' onClick={() => onSave(tempName)} loading={saveLoading}>{t('common.operation.save')}</Button>
|
<Button variant='primary' className='flex-shrink-0' onClick={() => onSave(tempName)} loading={saveLoading}>{t('common.operation.save')}</Button>
|
||||||
</div>
|
</div>
|
||||||
</Modal>
|
</Modal>
|
||||||
)
|
)
|
||||||
|
|
|
@ -61,7 +61,7 @@ export const VarOpBtnGroup: FC<{ className?: string; onConfirm: () => void; onCa
|
||||||
<div className={cn(className, 'flex mt-3 space-x-2 mobile:ml-0 tablet:ml-[128px] text-sm')}>
|
<div className={cn(className, 'flex mt-3 space-x-2 mobile:ml-0 tablet:ml-[128px] text-sm')}>
|
||||||
<Button
|
<Button
|
||||||
className='text-sm'
|
className='text-sm'
|
||||||
type='primary'
|
variant='primary'
|
||||||
onClick={onConfirm}
|
onClick={onConfirm}
|
||||||
>
|
>
|
||||||
{t('common.operation.save')}
|
{t('common.operation.save')}
|
||||||
|
|
|
@ -44,7 +44,7 @@ export const ChatBtn: FC<{ onClick: () => void; className?: string }> = ({
|
||||||
const { t } = useTranslation()
|
const { t } = useTranslation()
|
||||||
return (
|
return (
|
||||||
<Button
|
<Button
|
||||||
type='primary'
|
variant='primary'
|
||||||
className={cn(className, `px-4 inline-flex items-center ${s.customBtn} gap-2`)}
|
className={cn(className, `px-4 inline-flex items-center ${s.customBtn} gap-2`)}
|
||||||
onClick={onClick}>
|
onClick={onClick}>
|
||||||
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
|
|
@ -61,7 +61,7 @@ export const VarOpBtnGroup: FC<{ className?: string; onConfirm: () => void; onCa
|
||||||
<div className={cn(className, 'flex mt-3 space-x-2 mobile:ml-0 tablet:ml-[128px] text-sm')}>
|
<div className={cn(className, 'flex mt-3 space-x-2 mobile:ml-0 tablet:ml-[128px] text-sm')}>
|
||||||
<Button
|
<Button
|
||||||
className='text-sm'
|
className='text-sm'
|
||||||
type='primary'
|
variant='primary'
|
||||||
onClick={onConfirm}
|
onClick={onConfirm}
|
||||||
>
|
>
|
||||||
{t('common.operation.save')}
|
{t('common.operation.save')}
|
||||||
|
|
|
@ -45,7 +45,7 @@ export const ChatBtn: FC<{ onClick: () => void; className?: string }> = ({
|
||||||
const { t } = useTranslation()
|
const { t } = useTranslation()
|
||||||
return (
|
return (
|
||||||
<Button
|
<Button
|
||||||
type='primary'
|
variant='primary'
|
||||||
className={cn(className, `!p-0 space-x-2 flex items-center ${s.customBtn}`)}
|
className={cn(className, `!p-0 space-x-2 flex items-center ${s.customBtn}`)}
|
||||||
onClick={onClick}>
|
onClick={onClick}>
|
||||||
<svg width="20" height="21" viewBox="0 0 20 21" fill="none" xmlns="http://www.w3.org/2000/svg">
|
<svg width="20" height="21" viewBox="0 0 20 21" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
|
|
@ -478,7 +478,7 @@ const TextGeneration: FC<IMainProps> = ({
|
||||||
<AlertCircle className='w-4 h-4 text-[#D92D20]' />
|
<AlertCircle className='w-4 h-4 text-[#D92D20]' />
|
||||||
<div className='ml-1 text-[#D92D20]'>{t('share.generation.batchFailed.info', { num: allFailedTaskList.length })}</div>
|
<div className='ml-1 text-[#D92D20]'>{t('share.generation.batchFailed.info', { num: allFailedTaskList.length })}</div>
|
||||||
<Button
|
<Button
|
||||||
type='primary'
|
variant='primary'
|
||||||
className='ml-2 !h-8 !px-3'
|
className='ml-2 !h-8 !px-3'
|
||||||
onClick={handleRetryAllFailedTask}
|
onClick={handleRetryAllFailedTask}
|
||||||
>{t('share.generation.batchFailed.retry')}</Button>
|
>{t('share.generation.batchFailed.retry')}</Button>
|
||||||
|
|
|
@ -42,7 +42,7 @@ const RunBatch: FC<IRunBatchProps> = ({
|
||||||
<div className='mt-4 h-[1px] bg-gray-100'></div>
|
<div className='mt-4 h-[1px] bg-gray-100'></div>
|
||||||
<div className='flex justify-end'>
|
<div className='flex justify-end'>
|
||||||
<Button
|
<Button
|
||||||
type="primary"
|
variant="primary"
|
||||||
className='mt-4 !h-8 !pl-3 !pr-4'
|
className='mt-4 !h-8 !pl-3 !pr-4'
|
||||||
onClick={handleSend}
|
onClick={handleSend}
|
||||||
disabled={!isParsed || !isAllFinished}
|
disabled={!isParsed || !isAllFinished}
|
||||||
|
|
|
@ -125,7 +125,7 @@ const RunOnce: FC<IRunOnceProps> = ({
|
||||||
<span className='text-[13px]'>{t('common.operation.clear')}</span>
|
<span className='text-[13px]'>{t('common.operation.clear')}</span>
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
type="primary"
|
variant="primary"
|
||||||
className='!h-8 !pl-3 !pr-4'
|
className='!h-8 !pl-3 !pr-4'
|
||||||
onClick={onSend}
|
onClick={onSend}
|
||||||
disabled={false}
|
disabled={false}
|
||||||
|
|
|
@ -174,15 +174,15 @@ const AddToolModal: FC<Props> = ({
|
||||||
<div className='sticky top-0 left-0 right-0'>
|
<div className='sticky top-0 left-0 right-0'>
|
||||||
<div className='sticky top-0 left-0 right-0 px-5 py-3 text-md font-semibold text-gray-900'>{t('tools.addTool')}</div>
|
<div className='sticky top-0 left-0 right-0 px-5 py-3 text-md font-semibold text-gray-900'>{t('tools.addTool')}</div>
|
||||||
<div className='px-3 pt-2 pb-4'>
|
<div className='px-3 pt-2 pb-4'>
|
||||||
<Button type='primary' className='w-[176px] text-[13px] leading-[18px] font-medium' onClick={() => setIsShowEditCustomCollectionModal(true)}>
|
<Button variant='primary' className='w-[176px] text-[13px] leading-[18px] font-medium' onClick={() => setIsShowEditCustomCollectionModal(true)}>
|
||||||
<Plus className='w-4 h-4 mr-1'/>
|
<Plus className='w-4 h-4 mr-1' />
|
||||||
{t('tools.createCustomTool')}
|
{t('tools.createCustomTool')}
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className='px-2 py-1'>
|
<div className='px-2 py-1'>
|
||||||
<Type value={currentType} onSelect={setCurrentType}/>
|
<Type value={currentType} onSelect={setCurrentType} />
|
||||||
<Category value={currentCategory} onSelect={setCurrentCategory}/>
|
<Category value={currentCategory} onSelect={setCurrentCategory} />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className='relative grow bg-white rounded-r-xl overflow-y-auto'>
|
<div className='relative grow bg-white rounded-r-xl overflow-y-auto'>
|
||||||
|
|
|
@ -99,23 +99,23 @@ const Blocks = ({
|
||||||
<div className={cn('grow text-sm text-gray-900 truncate', needAuth && 'opacity-30')}>{tool.label[language]}</div>
|
<div className={cn('grow text-sm text-gray-900 truncate', needAuth && 'opacity-30')}>{tool.label[language]}</div>
|
||||||
{!needAuth && added && (
|
{!needAuth && added && (
|
||||||
<div className='flex items-center gap-1 rounded-[6px] border border-gray-100 px-2 py-[3px] bg-white text-gray-300 text-xs font-medium leading-[18px]'>
|
<div className='flex items-center gap-1 rounded-[6px] border border-gray-100 px-2 py-[3px] bg-white text-gray-300 text-xs font-medium leading-[18px]'>
|
||||||
<Check className='w-3 h-3'/>
|
<Check className='w-3 h-3' />
|
||||||
{t('tools.addToolModal.added').toLocaleUpperCase()}
|
{t('tools.addToolModal.added').toLocaleUpperCase()}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
{!needAuth && !added && addable && (
|
{!needAuth && !added && addable && (
|
||||||
<Button
|
<Button
|
||||||
type='default'
|
variant='default'
|
||||||
className={cn('hidden shrink-0 items-center !h-6 px-2 py-1 bg-white text-xs font-medium leading-[18px] text-primary-600 group-hover/item:flex')}
|
className={cn('hidden shrink-0 items-center !h-6 px-2 py-1 bg-white text-xs font-medium leading-[18px] text-primary-600 group-hover/item:flex')}
|
||||||
onClick={() => onSelect(toolWithProvider, tool)}
|
onClick={() => onSelect(toolWithProvider, tool)}
|
||||||
>
|
>
|
||||||
<Plus className='w-3 h-3'/>
|
<Plus className='w-3 h-3' />
|
||||||
{t('tools.addToolModal.add').toLocaleUpperCase()}
|
{t('tools.addToolModal.add').toLocaleUpperCase()}
|
||||||
</Button>
|
</Button>
|
||||||
)}
|
)}
|
||||||
{needAuth && (
|
{needAuth && (
|
||||||
<Button
|
<Button
|
||||||
type='default'
|
variant='default'
|
||||||
className={cn('hidden shrink-0 items-center !h-6 px-2 py-1 bg-white text-xs font-medium leading-[18px] text-primary-600 group-hover/item:flex')}
|
className={cn('hidden shrink-0 items-center !h-6 px-2 py-1 bg-white text-xs font-medium leading-[18px] text-primary-600 group-hover/item:flex')}
|
||||||
onClick={() => onAuthSetup(toolWithProvider)}
|
onClick={() => onAuthSetup(toolWithProvider)}
|
||||||
>{t('tools.auth.setup')}</Button>
|
>{t('tools.auth.setup')}</Button>
|
||||||
|
@ -135,7 +135,7 @@ const Blocks = ({
|
||||||
)}
|
)}
|
||||||
{!tools.length && showWorkflowEmpty && (
|
{!tools.length && showWorkflowEmpty && (
|
||||||
<div className='pt-[280px]'>
|
<div className='pt-[280px]'>
|
||||||
<Empty/>
|
<Empty />
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
{!!tools.length && tools.map(renderGroup)}
|
{!!tools.length && tools.map(renderGroup)}
|
||||||
|
|
|
@ -117,7 +117,7 @@ const ConfigCredential: FC<Props> = ({
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<HelpCircle className='ml-0.5 w-[14px] h-[14px] text-gray-400'/>
|
<HelpCircle className='ml-0.5 w-[14px] h-[14px] text-gray-400' />
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
</div>
|
</div>
|
||||||
<input
|
<input
|
||||||
|
@ -142,7 +142,7 @@ const ConfigCredential: FC<Props> = ({
|
||||||
|
|
||||||
<div className='mt-4 shrink-0 flex justify-end space-x-2 py-4'>
|
<div className='mt-4 shrink-0 flex justify-end space-x-2 py-4'>
|
||||||
<Button className='flex items-center h-8 !px-3 !text-[13px] font-medium !text-gray-700' onClick={onHide}>{t('common.operation.cancel')}</Button>
|
<Button className='flex items-center h-8 !px-3 !text-[13px] font-medium !text-gray-700' onClick={onHide}>{t('common.operation.cancel')}</Button>
|
||||||
<Button className='flex items-center h-8 !px-3 !text-[13px] font-medium' type='primary' onClick={() => {
|
<Button className='flex items-center h-8 !px-3 !text-[13px] font-medium' variant='primary' onClick={() => {
|
||||||
onChange(tempCredential)
|
onChange(tempCredential)
|
||||||
onHide()
|
onHide()
|
||||||
}}>{t('common.operation.save')}</Button>
|
}}>{t('common.operation.save')}</Button>
|
||||||
|
|
|
@ -74,7 +74,7 @@ const GetSchema: FC<Props> = ({
|
||||||
/>
|
/>
|
||||||
<Button
|
<Button
|
||||||
className='absolute top-1 right-1 !h-6 !px-2 text-xs font-medium'
|
className='absolute top-1 right-1 !h-6 !px-2 text-xs font-medium'
|
||||||
type='primary'
|
variant='primary'
|
||||||
disabled={!importUrl}
|
disabled={!importUrl}
|
||||||
onClick={handleImportFromUrl}
|
onClick={handleImportFromUrl}
|
||||||
loading={isParsing}
|
loading={isParsing}
|
||||||
|
|
|
@ -307,7 +307,7 @@ const EditCustomCollectionModal: FC<Props> = ({
|
||||||
}
|
}
|
||||||
<div className='flex space-x-2 '>
|
<div className='flex space-x-2 '>
|
||||||
<Button className='flex items-center h-8 !px-3 !text-[13px] font-medium !text-gray-700 bg-white' onClick={onHide}>{t('common.operation.cancel')}</Button>
|
<Button className='flex items-center h-8 !px-3 !text-[13px] font-medium !text-gray-700 bg-white' onClick={onHide}>{t('common.operation.cancel')}</Button>
|
||||||
<Button className='flex items-center h-8 !px-3 !text-[13px] font-medium' type='primary' onClick={handleSave}>{t('common.operation.save')}</Button>
|
<Button className='flex items-center h-8 !px-3 !text-[13px] font-medium' variant='primary' onClick={handleSave}>{t('common.operation.save')}</Button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -107,7 +107,7 @@ const TestApi: FC<Props> = ({
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<Button type='primary' className=' mt-4 w-full h-10 !text-[13px] leading-[18px] font-medium' onClick={handleTest}>{t('tools.test.title')}</Button>
|
<Button variant='primary' className=' mt-4 w-full h-10 !text-[13px] leading-[18px] font-medium' onClick={handleTest}>{t('tools.test.title')}</Button>
|
||||||
<div className='mt-6'>
|
<div className='mt-6'>
|
||||||
<div className='flex items-center space-x-3'>
|
<div className='flex items-center space-x-3'>
|
||||||
<div className='leading-[18px] text-xs font-semibold text-gray-500'>{t('tools.test.testResult')}</div>
|
<div className='leading-[18px] text-xs font-semibold text-gray-500'>{t('tools.test.testResult')}</div>
|
||||||
|
|
|
@ -197,7 +197,7 @@ const ProviderDetail = ({
|
||||||
<div className='flex items-center py-1 gap-2'>
|
<div className='flex items-center py-1 gap-2'>
|
||||||
<div className='relative shrink-0'>
|
<div className='relative shrink-0'>
|
||||||
{typeof collection.icon === 'string' && (
|
{typeof collection.icon === 'string' && (
|
||||||
<div className='w-8 h-8 bg-center bg-cover bg-no-repeat rounded-md' style={{ backgroundImage: `url(${collection.icon})` }}/>
|
<div className='w-8 h-8 bg-center bg-cover bg-no-repeat rounded-md' style={{ backgroundImage: `url(${collection.icon})` }} />
|
||||||
)}
|
)}
|
||||||
{typeof collection.icon !== 'string' && (
|
{typeof collection.icon !== 'string' && (
|
||||||
<AppIcon
|
<AppIcon
|
||||||
|
@ -217,7 +217,7 @@ const ProviderDetail = ({
|
||||||
<div className='flex gap-1 border-b-[0.5px] border-black/5'>
|
<div className='flex gap-1 border-b-[0.5px] border-black/5'>
|
||||||
{(collection.type === CollectionType.builtIn) && needAuth && (
|
{(collection.type === CollectionType.builtIn) && needAuth && (
|
||||||
<Button
|
<Button
|
||||||
type={isAuthed ? 'default' : 'primary'}
|
variant={isAuthed ? 'default' : 'primary'}
|
||||||
className={cn('shrink-0 my-3 w-full flex items-center', isAuthed && 'bg-white')}
|
className={cn('shrink-0 my-3 w-full flex items-center', isAuthed && 'bg-white')}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
if (collection.type === CollectionType.builtIn || collection.type === CollectionType.model)
|
if (collection.type === CollectionType.builtIn || collection.type === CollectionType.model)
|
||||||
|
@ -243,7 +243,7 @@ const ProviderDetail = ({
|
||||||
{collection.type === CollectionType.workflow && !isDetailLoading && customCollection && (
|
{collection.type === CollectionType.workflow && !isDetailLoading && customCollection && (
|
||||||
<>
|
<>
|
||||||
<Button
|
<Button
|
||||||
type='primary'
|
variant='primary'
|
||||||
className={cn('shrink-0 my-3 w-[183px] flex items-center')}
|
className={cn('shrink-0 my-3 w-[183px] flex items-center')}
|
||||||
>
|
>
|
||||||
<a className='flex items-center text-white' href={`/app/${(customCollection as WorkflowToolProviderResponse).workflow_app_id}/workflow`} rel='noreferrer' target='_blank'>
|
<a className='flex items-center text-white' href={`/app/${(customCollection as WorkflowToolProviderResponse).workflow_app_id}/workflow`} rel='noreferrer' target='_blank'>
|
||||||
|
@ -263,7 +263,7 @@ const ProviderDetail = ({
|
||||||
</div>
|
</div>
|
||||||
{/* Tools */}
|
{/* Tools */}
|
||||||
<div className='pt-3'>
|
<div className='pt-3'>
|
||||||
{isDetailLoading && <div className='flex h-[200px]'><Loading type='app'/></div>}
|
{isDetailLoading && <div className='flex h-[200px]'><Loading type='app' /></div>}
|
||||||
{!isDetailLoading && (
|
{!isDetailLoading && (
|
||||||
<div className='text-xs font-medium leading-6 text-gray-500'>
|
<div className='text-xs font-medium leading-6 text-gray-500'>
|
||||||
{collection.type === CollectionType.workflow && <span className=''>{t('tools.createTool.toolInput.title').toLocaleUpperCase()}</span>}
|
{collection.type === CollectionType.workflow && <span className=''>{t('tools.createTool.toolInput.title').toLocaleUpperCase()}</span>}
|
||||||
|
|
|
@ -91,7 +91,7 @@ const ConfigCredential: FC<Props> = ({
|
||||||
}
|
}
|
||||||
< div className='flex space-x-2'>
|
< div className='flex space-x-2'>
|
||||||
<Button className='flex items-center h-8 !px-3 !text-[13px] font-medium !text-gray-700 bg-white' onClick={onCancel}>{t('common.operation.cancel')}</Button>
|
<Button className='flex items-center h-8 !px-3 !text-[13px] font-medium !text-gray-700 bg-white' onClick={onCancel}>{t('common.operation.cancel')}</Button>
|
||||||
<Button className='flex items-center h-8 !px-3 !text-[13px] font-medium' type='primary' onClick={() => onSaved(tempCredential)}>{t('common.operation.save')}</Button>
|
<Button className='flex items-center h-8 !px-3 !text-[13px] font-medium' variant='primary' onClick={() => onSaved(tempCredential)}>{t('common.operation.save')}</Button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
|
|
|
@ -21,7 +21,7 @@ const ConfirmModal = ({ show, onConfirm, onClose }: ConfirmModalProps) => {
|
||||||
<Modal
|
<Modal
|
||||||
className={cn('p-8 max-w-[600px] w-[600px]', s.bg)}
|
className={cn('p-8 max-w-[600px] w-[600px]', s.bg)}
|
||||||
isShow={show}
|
isShow={show}
|
||||||
onClose={() => {}}
|
onClose={() => { }}
|
||||||
>
|
>
|
||||||
<div className='absolute right-4 top-4 p-2 cursor-pointer' onClick={onClose}>
|
<div className='absolute right-4 top-4 p-2 cursor-pointer' onClick={onClose}>
|
||||||
<XClose className='w-4 h-4 text-gray-500' />
|
<XClose className='w-4 h-4 text-gray-500' />
|
||||||
|
@ -36,7 +36,7 @@ const ConfirmModal = ({ show, onConfirm, onClose }: ConfirmModalProps) => {
|
||||||
<div className='pt-6 flex justify-end items-center'>
|
<div className='pt-6 flex justify-end items-center'>
|
||||||
<div className='flex items-center'>
|
<div className='flex items-center'>
|
||||||
<Button className='mr-2 text-gray-700 text-sm font-medium' onClick={onClose}>{t('common.operation.cancel')}</Button>
|
<Button className='mr-2 text-gray-700 text-sm font-medium' onClick={onClose}>{t('common.operation.cancel')}</Button>
|
||||||
<Button className='text-sm font-medium border-red-700 border-[0.5px]' type="warning" onClick={onConfirm}>{t('common.operation.confirm')}</Button>
|
<Button className='text-sm font-medium border-red-700 border-[0.5px]' variant="warning" onClick={onConfirm}>{t('common.operation.confirm')}</Button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</Modal>
|
</Modal>
|
||||||
|
|
|
@ -208,7 +208,7 @@ const WorkflowToolAsModal: FC<Props> = ({
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
{item.name !== '__image' && (
|
{item.name !== '__image' && (
|
||||||
<MethodSelector value={item.form} onChange={value => handleParameterChange('form', value, index)}/>
|
<MethodSelector value={item.form} onChange={value => handleParameterChange('form', value, index)} />
|
||||||
)}
|
)}
|
||||||
</td>
|
</td>
|
||||||
<td className="p-2 pl-3 text-gray-500 w-[236px]">
|
<td className="p-2 pl-3 text-gray-500 w-[236px]">
|
||||||
|
@ -246,7 +246,7 @@ const WorkflowToolAsModal: FC<Props> = ({
|
||||||
)}
|
)}
|
||||||
<div className='flex space-x-2 '>
|
<div className='flex space-x-2 '>
|
||||||
<Button className='flex items-center h-8 !px-3 !text-[13px] font-medium !text-gray-700' onClick={onHide}>{t('common.operation.cancel')}</Button>
|
<Button className='flex items-center h-8 !px-3 !text-[13px] font-medium !text-gray-700' onClick={onHide}>{t('common.operation.cancel')}</Button>
|
||||||
<Button disabled={!label || !name || !isNameValid(name)} className='flex items-center h-8 !px-3 !text-[13px] font-medium' type='primary' onClick={() => {
|
<Button disabled={!label || !name || !isNameValid(name)} className='flex items-center h-8 !px-3 !text-[13px] font-medium' variant='primary' onClick={() => {
|
||||||
if (isAdd)
|
if (isAdd)
|
||||||
onConfirm()
|
onConfirm()
|
||||||
else
|
else
|
||||||
|
|
|
@ -206,7 +206,7 @@ const Header: FC = () => {
|
||||||
<ViewHistory withText />
|
<ViewHistory withText />
|
||||||
<div className='mx-2 w-[1px] h-3.5 bg-gray-200'></div>
|
<div className='mx-2 w-[1px] h-3.5 bg-gray-200'></div>
|
||||||
<Button
|
<Button
|
||||||
type='primary'
|
variant='primary'
|
||||||
className={`
|
className={`
|
||||||
mr-2 px-3 py-0 h-8 text-[13px] font-medium
|
mr-2 px-3 py-0 h-8 text-[13px] font-medium
|
||||||
border-[0.5px] border-gray-200 shadow-xs
|
border-[0.5px] border-gray-200 shadow-xs
|
||||||
|
@ -242,7 +242,7 @@ const Header: FC = () => {
|
||||||
<Button
|
<Button
|
||||||
className='px-3 py-0 h-8 text-[13px] font-medium shadow-xs'
|
className='px-3 py-0 h-8 text-[13px] font-medium shadow-xs'
|
||||||
onClick={handleRestore}
|
onClick={handleRestore}
|
||||||
type='primary'
|
variant='primary'
|
||||||
>
|
>
|
||||||
{t('workflow.common.restore')}
|
{t('workflow.common.restore')}
|
||||||
</Button>
|
</Button>
|
||||||
|
|
|
@ -141,7 +141,7 @@ const BeforeRunForm: FC<BeforeRunFormProps> = ({
|
||||||
<StopCircle className='w-4 h-4 text-gray-500' />
|
<StopCircle className='w-4 h-4 text-gray-500' />
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
<Button disabled={!isFileLoaded || isRunning} type='primary' className='w-0 grow !h-8 flex items-center space-x-2 text-[13px]' onClick={handleRun}>
|
<Button disabled={!isFileLoaded || isRunning} variant='primary' className='w-0 grow !h-8 flex items-center space-x-2 text-[13px]' onClick={handleRun}>
|
||||||
{isRunning && <Loading02 className='animate-spin w-4 h-4 text-white' />}
|
{isRunning && <Loading02 className='animate-spin w-4 h-4 text-white' />}
|
||||||
<div>{t(`${i18nPrefix}.${isRunning ? 'running' : 'startRun'}`)}</div>
|
<div>{t(`${i18nPrefix}.${isRunning ? 'running' : 'startRun'}`)}</div>
|
||||||
</Button>
|
</Button>
|
||||||
|
|
|
@ -140,7 +140,7 @@ const Authorization: FC<Props> = ({
|
||||||
</div>
|
</div>
|
||||||
<div className='mt-6 flex justify-end space-x-2'>
|
<div className='mt-6 flex justify-end space-x-2'>
|
||||||
<Button onClick={onHide} className='flex items-center !h-8 leading-[18px] !text-[13px] !font-medium'>{t('common.operation.cancel')}</Button>
|
<Button onClick={onHide} className='flex items-center !h-8 leading-[18px] !text-[13px] !font-medium'>{t('common.operation.cancel')}</Button>
|
||||||
<Button type='primary' onClick={handleConfirm} className='flex items-center !h-8 leading-[18px] !text-[13px] !font-medium'>{t('common.operation.save')}</Button>
|
<Button variant='primary' onClick={handleConfirm} className='flex items-center !h-8 leading-[18px] !text-[13px] !font-medium'>{t('common.operation.save')}</Button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</Modal>
|
</Modal>
|
||||||
|
|
|
@ -181,7 +181,7 @@ const AddExtractParameter: FC<Props> = ({
|
||||||
</div>
|
</div>
|
||||||
<div className='mt-4 flex justify-end space-x-2'>
|
<div className='mt-4 flex justify-end space-x-2'>
|
||||||
<Button className='flex !h-8 !w-[95px] text-[13px] font-medium text-gray-700' onClick={hideModal} >{t('common.operation.cancel')}</Button>
|
<Button className='flex !h-8 !w-[95px] text-[13px] font-medium text-gray-700' onClick={hideModal} >{t('common.operation.cancel')}</Button>
|
||||||
<Button className='flex !h-8 !w-[95px] text-[13px] font-medium' type='primary' onClick={handleSave} >{isAdd ? t('common.operation.add') : t('common.operation.save')}</Button>
|
<Button className='flex !h-8 !w-[95px] text-[13px] font-medium' variant='primary' onClick={handleSave} >{isAdd ? t('common.operation.add') : t('common.operation.save')}</Button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</Modal>
|
</Modal>
|
||||||
|
|
|
@ -61,7 +61,7 @@ const Panel: FC<NodePanelProps<ToolNodeType>> = ({
|
||||||
<>
|
<>
|
||||||
<div className='px-4 pb-3'>
|
<div className='px-4 pb-3'>
|
||||||
<Button
|
<Button
|
||||||
type='primary'
|
variant='primary'
|
||||||
className='w-full !h-8'
|
className='w-full !h-8'
|
||||||
onClick={showSetAuthModal}
|
onClick={showSetAuthModal}
|
||||||
>
|
>
|
||||||
|
|
|
@ -103,7 +103,7 @@ const InputsPanel = ({ onRun }: Props) => {
|
||||||
</div>
|
</div>
|
||||||
<div className='flex items-center justify-between px-4 py-2'>
|
<div className='flex items-center justify-between px-4 py-2'>
|
||||||
<Button
|
<Button
|
||||||
type='primary'
|
variant='primary'
|
||||||
disabled={!canRun || workflowRunningData?.result?.status === WorkflowRunningStatus.Running}
|
disabled={!canRun || workflowRunningData?.result?.status === WorkflowRunningStatus.Running}
|
||||||
className='py-0 w-full h-8 rounded-lg text-[13px] font-medium'
|
className='py-0 w-full h-8 rounded-lg text-[13px] font-medium'
|
||||||
onClick={doRun}
|
onClick={doRun}
|
||||||
|
|
|
@ -69,7 +69,7 @@ const InitPasswordPopup = () => {
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex flex-row flex-wrap justify-stretch p-0">
|
<div className="flex flex-row flex-wrap justify-stretch p-0">
|
||||||
<Button type="primary" onClick={handleValidation} className="basis-full min-w-28">
|
<Button variant="primary" onClick={handleValidation} className="basis-full min-w-28">
|
||||||
{t('login.validate')}
|
{t('login.validate')}
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -148,7 +148,7 @@ const InstallForm = () => {
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<Button type='primary' className='w-full !fone-medium !text-sm' onClick={handleSetting}>
|
<Button variant='primary' className='w-full !fone-medium !text-sm' onClick={handleSetting}>
|
||||||
{t('login.installBtn')}
|
{t('login.installBtn')}
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -156,7 +156,7 @@ const NormalForm = () => {
|
||||||
<div className='w-full'>
|
<div className='w-full'>
|
||||||
<a href={getPurifyHref(`${apiPrefix}/oauth/login/github`)}>
|
<a href={getPurifyHref(`${apiPrefix}/oauth/login/github`)}>
|
||||||
<Button
|
<Button
|
||||||
type='default'
|
variant='default'
|
||||||
disabled={isLoading}
|
disabled={isLoading}
|
||||||
className='w-full hover:!bg-gray-50 !text-sm !font-medium'
|
className='w-full hover:!bg-gray-50 !text-sm !font-medium'
|
||||||
>
|
>
|
||||||
|
@ -175,7 +175,7 @@ const NormalForm = () => {
|
||||||
<div className='w-full'>
|
<div className='w-full'>
|
||||||
<a href={getPurifyHref(`${apiPrefix}/oauth/login/google`)}>
|
<a href={getPurifyHref(`${apiPrefix}/oauth/login/google`)}>
|
||||||
<Button
|
<Button
|
||||||
type='default'
|
variant='default'
|
||||||
disabled={isLoading}
|
disabled={isLoading}
|
||||||
className='w-full hover:!bg-gray-50 !text-sm !font-medium'
|
className='w-full hover:!bg-gray-50 !text-sm !font-medium'
|
||||||
>
|
>
|
||||||
|
@ -271,7 +271,7 @@ const NormalForm = () => {
|
||||||
<div className='mb-2'>
|
<div className='mb-2'>
|
||||||
<Button
|
<Button
|
||||||
tabIndex={0}
|
tabIndex={0}
|
||||||
type='primary'
|
variant='primary'
|
||||||
onClick={handleEmailPasswordLogin}
|
onClick={handleEmailPasswordLogin}
|
||||||
disabled={isLoading}
|
disabled={isLoading}
|
||||||
className="w-full !fone-medium !text-sm"
|
className="w-full !fone-medium !text-sm"
|
||||||
|
|
|
@ -145,7 +145,7 @@ const OneMoreStep = () => {
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<Button
|
<Button
|
||||||
type='primary'
|
variant='primary'
|
||||||
className='w-full !fone-medium !text-sm'
|
className='w-full !fone-medium !text-sm'
|
||||||
disabled={state.formState === 'processing'}
|
disabled={state.formState === 'processing'}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
|
|
|
@ -87,7 +87,7 @@ const UserSSOForm: FC<UserSSOFormProps> = ({
|
||||||
<div className="w-full mx-auto mt-10">
|
<div className="w-full mx-auto mt-10">
|
||||||
<Button
|
<Button
|
||||||
tabIndex={0}
|
tabIndex={0}
|
||||||
type='primary'
|
variant='primary'
|
||||||
onClick={() => { handleSSOLogin() }}
|
onClick={() => { handleSSOLogin() }}
|
||||||
disabled={isLoading}
|
disabled={isLoading}
|
||||||
className="w-full !fone-medium !text-sm"
|
className="w-full !fone-medium !text-sm"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user