| </div> | </div> | ||||
| <div className={`${style.listItemDescription} ${style.noClip}`}>{t('app.newApp.chatAppIntro')}</div> | <div className={`${style.listItemDescription} ${style.noClip}`}>{t('app.newApp.chatAppIntro')}</div> | ||||
| {/* <div className={classNames(style.listItemFooter, 'justify-end')}> | {/* <div className={classNames(style.listItemFooter, 'justify-end')}> | ||||
| <a className={style.listItemLink} href='https://udify.app/chat/7CQBa5yyvYLSkZtx' target='_blank'>{t('app.newApp.previewDemo')}<span className={classNames(style.linkIcon, style.grayLinkIcon)} /></a> | |||||
| <a className={style.listItemLink} href='https://udify.app/chat/7CQBa5yyvYLSkZtx' target='_blank' rel='noopener noreferrer'>{t('app.newApp.previewDemo')}<span className={classNames(style.linkIcon, style.grayLinkIcon)} /></a> | |||||
| </div> */} | </div> */} | ||||
| </li> | </li> | ||||
| <li | <li |
| <h3 className='text-xl font-semibold leading-tight text-gradient'>{t('join')}</h3> | <h3 className='text-xl font-semibold leading-tight text-gradient'>{t('join')}</h3> | ||||
| <p className='mt-1 text-sm font-normal leading-tight text-gray-700'>{t('communityIntro')}</p> | <p className='mt-1 text-sm font-normal leading-tight text-gray-700'>{t('communityIntro')}</p> | ||||
| <div className='flex items-center gap-2 mt-3'> | <div className='flex items-center gap-2 mt-3'> | ||||
| <a className={style.socialMediaLink} target='_blank' href='https://github.com/langgenius/dify'><span className={classNames(style.socialMediaIcon, style.githubIcon)} /></a> | |||||
| <a className={style.socialMediaLink} target='_blank' href='https://discord.gg/FngNHpbcY7'><span className={classNames(style.socialMediaIcon, style.discordIcon)} /></a> | |||||
| <a className={style.socialMediaLink} target='_blank' rel='noopener noreferrer' href='https://github.com/langgenius/dify'><span className={classNames(style.socialMediaIcon, style.githubIcon)} /></a> | |||||
| <a className={style.socialMediaLink} target='_blank' rel='noopener noreferrer' href='https://discord.gg/FngNHpbcY7'><span className={classNames(style.socialMediaIcon, style.discordIcon)} /></a> | |||||
| </div> | </div> | ||||
| </footer> | </footer> | ||||
| </div > | </div > |
| return ( | return ( | ||||
| <Link className={classNames(s.itemWrapper, 'px-0', isMobile && 'justify-center')} href={`/app/${detail?.id}/overview`}> | <Link className={classNames(s.itemWrapper, 'px-0', isMobile && 'justify-center')} href={`/app/${detail?.id}/overview`}> | ||||
| <div className={classNames(s.iconWrapper, 'mr-0')}> | <div className={classNames(s.iconWrapper, 'mr-0')}> | ||||
| <AppIcon size='tiny' icon={detail?.icon} background={detail?.icon_background}/> | |||||
| <AppIcon size='tiny' icon={detail?.icon} background={detail?.icon_background} /> | |||||
| {type === 'app' && ( | {type === 'app' && ( | ||||
| <div className={s.statusPoint}> | <div className={s.statusPoint}> | ||||
| <Indicator color={appStatus ? 'green' : 'gray'} /> | <Indicator color={appStatus ? 'green' : 'gray'} /> | ||||
| ? 'https://docs.dify.ai/v/zh-hans/guides/application-design/prompt-engineering' | ? 'https://docs.dify.ai/v/zh-hans/guides/application-design/prompt-engineering' | ||||
| : 'https://docs.dify.ai/user-guide/creating-dify-apps/prompt-engineering' | : 'https://docs.dify.ai/user-guide/creating-dify-apps/prompt-engineering' | ||||
| } | } | ||||
| target='_blank' | |||||
| target='_blank' rel='noopener noreferrer' | |||||
| > | > | ||||
| <BookOpenIcon className='mr-1' /> | <BookOpenIcon className='mr-1' /> | ||||
| {t('common.datasetMenus.viewDoc')} | {t('common.datasetMenus.viewDoc')} |
| <footer className='px-12 py-6 grow-0 shrink-0'> | <footer className='px-12 py-6 grow-0 shrink-0'> | ||||
| <h3 className='text-xl font-semibold leading-tight text-gradient'>{t('dataset.didYouKnow')}</h3> | <h3 className='text-xl font-semibold leading-tight text-gradient'>{t('dataset.didYouKnow')}</h3> | ||||
| <p className='mt-1 text-sm font-normal leading-tight text-gray-700'> | <p className='mt-1 text-sm font-normal leading-tight text-gray-700'> | ||||
| {t('dataset.intro1')}<a className='inline-flex items-center gap-1 link' target='_blank' href='/'>{t('dataset.intro2')}</a>{t('dataset.intro3')}<br /> | |||||
| {t('dataset.intro4')}<a className='inline-flex items-center gap-1 link' target='_blank' href='/'>{t('dataset.intro5')}</a>{t('dataset.intro6')} | |||||
| {t('dataset.intro1')}<a className='inline-flex items-center gap-1 link' target='_blank' rel='noopener noreferrer' href='/'>{t('dataset.intro2')}</a>{t('dataset.intro3')}<br /> | |||||
| {t('dataset.intro4')}<a className='inline-flex items-center gap-1 link' target='_blank' rel='noopener noreferrer' href='/'>{t('dataset.intro5')}</a>{t('dataset.intro6')} | |||||
| </p> | </p> | ||||
| </footer> | </footer> | ||||
| ) | ) |
| <a href={`${language === LanguagesSupported[1] | <a href={`${language === LanguagesSupported[1] | ||||
| ? 'https://docs.dify.ai/v/zh-hans/guides/application-design/prompt-engineering' | ? 'https://docs.dify.ai/v/zh-hans/guides/application-design/prompt-engineering' | ||||
| : 'https://docs.dify.ai/features/prompt-engineering'}`} | : 'https://docs.dify.ai/features/prompt-engineering'}`} | ||||
| target='_blank' | |||||
| target='_blank' rel='noopener noreferrer' | |||||
| className='text-[#155EEF]'>{t('appDebug.feature.conversationHistory.learnMore')} | className='text-[#155EEF]'>{t('appDebug.feature.conversationHistory.learnMore')} | ||||
| </a> | </a> | ||||
| </div> | </div> |
| className='block px-3 py-2 w-full h-[88px] rounded-lg bg-gray-100 text-sm outline-none appearance-none resize-none' | className='block px-3 py-2 w-full h-[88px] rounded-lg bg-gray-100 text-sm outline-none appearance-none resize-none' | ||||
| placeholder={t('datasetSettings.form.descPlaceholder') || ''} | placeholder={t('datasetSettings.form.descPlaceholder') || ''} | ||||
| /> | /> | ||||
| <a className='mt-2 flex items-center h-[18px] px-3 text-xs text-gray-500' href="https://docs.dify.ai/features/datasets#how-to-write-a-good-dataset-description" target='_blank'> | |||||
| <a className='mt-2 flex items-center h-[18px] px-3 text-xs text-gray-500' href="https://docs.dify.ai/features/datasets#how-to-write-a-good-dataset-description" target='_blank' rel='noopener noreferrer'> | |||||
| <BookOpenIcon className='w-3 h-[18px] mr-1' /> | <BookOpenIcon className='w-3 h-[18px] mr-1' /> | ||||
| {t('datasetSettings.form.descWrite')} | {t('datasetSettings.form.descWrite')} | ||||
| </a> | </a> | ||||
| <div> | <div> | ||||
| <div>{t('datasetSettings.form.retrievalSetting.title')}</div> | <div>{t('datasetSettings.form.retrievalSetting.title')}</div> | ||||
| <div className='leading-[18px] text-xs font-normal text-gray-500'> | <div className='leading-[18px] text-xs font-normal text-gray-500'> | ||||
| <a target='_blank' href='https://docs.dify.ai/features/retrieval-augment' className='text-[#155eef]'>{t('datasetSettings.form.retrievalSetting.learnMore')}</a> | |||||
| <a target='_blank' rel='noopener noreferrer' href='https://docs.dify.ai/features/retrieval-augment' className='text-[#155eef]'>{t('datasetSettings.form.retrievalSetting.learnMore')}</a> | |||||
| {t('datasetSettings.form.retrievalSetting.description')} | {t('datasetSettings.form.retrievalSetting.description')} | ||||
| </div> | </div> | ||||
| </div> | </div> |
| <a | <a | ||||
| className='font-medium text-[#155EEF]' | className='font-medium text-[#155EEF]' | ||||
| href={`https://docs.dify.ai/${language === LanguagesSupported[1] ? 'v/zh-hans/guides/application-design/prompt-engineering' : 'features/prompt-engineering'}`} | href={`https://docs.dify.ai/${language === LanguagesSupported[1] ? 'v/zh-hans/guides/application-design/prompt-engineering' : 'features/prompt-engineering'}`} | ||||
| target='_blank' | |||||
| target='_blank' rel='noopener noreferrer' | |||||
| > | > | ||||
| {t('appDebug.promptMode.advancedWarning.learnMore')} | {t('appDebug.promptMode.advancedWarning.learnMore')} | ||||
| </a> | </a> |
| return ( | return ( | ||||
| <Modal | <Modal | ||||
| isShow | isShow | ||||
| onClose={() => {}} | |||||
| onClose={() => { }} | |||||
| className='!p-8 !pb-6 !mt-14 !max-w-none !w-[640px]' | className='!p-8 !pb-6 !mt-14 !max-w-none !w-[640px]' | ||||
| > | > | ||||
| <div className='mb-2 text-xl font-semibold text-[#1D2939]'> | <div className='mb-2 text-xl font-semibold text-[#1D2939]'> | ||||
| <div className='text-sm font-medium text-gray-900'>{t('common.apiBasedExtension.selector.title')}</div> | <div className='text-sm font-medium text-gray-900'>{t('common.apiBasedExtension.selector.title')}</div> | ||||
| <a | <a | ||||
| href={t('common.apiBasedExtension.linkUrl') || '/'} | href={t('common.apiBasedExtension.linkUrl') || '/'} | ||||
| target='_blank' | |||||
| target='_blank' rel='noopener noreferrer' | |||||
| className='group flex items-center text-xs text-gray-500 hover:text-primary-600' | className='group flex items-center text-xs text-gray-500 hover:text-primary-600' | ||||
| > | > | ||||
| <BookOpen01 className='mr-1 w-3 h-3 text-gray-500 group-hover:text-primary-600' /> | <BookOpen01 className='mr-1 w-3 h-3 text-gray-500 group-hover:text-primary-600' /> |
| {t('common.apiBasedExtension.selector.title')} | {t('common.apiBasedExtension.selector.title')} | ||||
| <a | <a | ||||
| href={t('common.apiBasedExtension.linkUrl') || '/'} | href={t('common.apiBasedExtension.linkUrl') || '/'} | ||||
| target='_blank' | |||||
| target='_blank' rel='noopener noreferrer' | |||||
| className='group flex items-center text-xs font-normal text-gray-500 hover:text-primary-600' | className='group flex items-center text-xs font-normal text-gray-500 hover:text-primary-600' | ||||
| > | > | ||||
| <BookOpen01 className='mr-1 w-3 h-3 text-gray-500 group-hover:text-primary-600' /> | <BookOpen01 className='mr-1 w-3 h-3 text-gray-500 group-hover:text-primary-600' /> |
| <div className='mt-2 text-gray-500 text-sm font-normal'> | <div className='mt-2 text-gray-500 text-sm font-normal'> | ||||
| <Trans | <Trans | ||||
| i18nKey="appLog.table.empty.element.content" | i18nKey="appLog.table.empty.element.content" | ||||
| components={{ shareLink: <Link href={`${pathSegments.join('/')}/overview`} className='text-primary-600' />, testLink: <Link href={appUrl} className='text-primary-600' target='_blank' /> }} | |||||
| components={{ shareLink: <Link href={`${pathSegments.join('/')}/overview`} className='text-primary-600' />, testLink: <Link href={appUrl} className='text-primary-600' target='_blank' rel='noopener noreferrer' /> }} | |||||
| /> | /> | ||||
| </div> | </div> | ||||
| </div> | </div> |
| <a | <a | ||||
| className='mt-2 flex items-center h-[26px] text-xs font-medium text-[#155EEF] p-1 space-x-1' | className='mt-2 flex items-center h-[26px] text-xs font-medium text-[#155EEF] p-1 space-x-1' | ||||
| href='https://cloud.dify.ai/apps' | href='https://cloud.dify.ai/apps' | ||||
| target='_blank' | |||||
| target='_blank' rel='noopener noreferrer' | |||||
| > | > | ||||
| <div>{t('appOverview.apiKeyInfo.tryCloud')}</div> | <div>{t('appOverview.apiKeyInfo.tryCloud')}</div> | ||||
| <LinkExternal02 className='w-3 h-3' /> | <LinkExternal02 className='w-3 h-3' /> |
| <div className='flex flex-col'> | <div className='flex flex-col'> | ||||
| <div className='text-gray-900'>{t(`${prefixCustomize}.way1.step1`)}</div> | <div className='text-gray-900'>{t(`${prefixCustomize}.way1.step1`)}</div> | ||||
| <div className='text-gray-500 text-xs mt-1 mb-2'>{t(`${prefixCustomize}.way1.step1Tip`)}</div> | <div className='text-gray-500 text-xs mt-1 mb-2'>{t(`${prefixCustomize}.way1.step1Tip`)}</div> | ||||
| <a href={`https://github.com/langgenius/${isChatApp ? 'webapp-conversation' : 'webapp-text-generator'}`} target='_blank'> | |||||
| <a href={`https://github.com/langgenius/${isChatApp ? 'webapp-conversation' : 'webapp-text-generator'}`} target='_blank' rel='noopener noreferrer'> | |||||
| <Button className='text-gray-800 text-sm w-fit'><GithubIcon className='text-gray-800 mr-2' />{t(`${prefixCustomize}.way1.step1Operation`)}</Button> | <Button className='text-gray-800 text-sm w-fit'><GithubIcon className='text-gray-800 mr-2' />{t(`${prefixCustomize}.way1.step1Operation`)}</Button> | ||||
| </a> | </a> | ||||
| </div> | </div> | ||||
| <div className='flex flex-col'> | <div className='flex flex-col'> | ||||
| <div className='text-gray-900'>{t(`${prefixCustomize}.way1.step3`)}</div> | <div className='text-gray-900'>{t(`${prefixCustomize}.way1.step3`)}</div> | ||||
| <div className='text-gray-500 text-xs mt-1 mb-2'>{t(`${prefixCustomize}.way1.step2Tip`)}</div> | <div className='text-gray-500 text-xs mt-1 mb-2'>{t(`${prefixCustomize}.way1.step2Tip`)}</div> | ||||
| <a href="https://vercel.com/docs/concepts/deployments/git/vercel-for-github" target='_blank'> | |||||
| <a href="https://vercel.com/docs/concepts/deployments/git/vercel-for-github" target='_blank' rel='noopener noreferrer'> | |||||
| <Button className='text-gray-800 text-sm w-fit'> | <Button className='text-gray-800 text-sm w-fit'> | ||||
| <div className='mr-1.5 border-solid border-t-0 border-r-[7px] border-l-[7px] border-b-[12px] border-r-transparent border-b-black border-l-transparent border-t-transparent'></div> | <div className='mr-1.5 border-solid border-t-0 border-r-[7px] border-l-[7px] border-b-[12px] border-r-transparent border-b-black border-l-transparent border-t-transparent'></div> | ||||
| <span>{t(`${prefixCustomize}.way1.step2Operation`)}</span> | <span>{t(`${prefixCustomize}.way1.step2Operation`)}</span> | ||||
| className='w-36 mt-2' | className='w-36 mt-2' | ||||
| onClick={() => | onClick={() => | ||||
| window.open( | window.open( | ||||
| `https://docs.dify.ai/${ | |||||
| language !== LanguagesSupportedUnderscore[1] | |||||
| ? 'user-guide/launching-dify-apps/developing-with-apis' | |||||
| : `v/${locale.toLowerCase()}/guides/application-publishing/developing-with-apis` | |||||
| `https://docs.dify.ai/${language !== LanguagesSupportedUnderscore[1] | |||||
| ? 'user-guide/launching-dify-apps/developing-with-apis' | |||||
| : `v/${locale.toLowerCase()}/guides/application-publishing/developing-with-apis` | |||||
| }`, | }`, | ||||
| '_blank', | '_blank', | ||||
| ) | ) |
| <p className={`mt-1 ${s.settingsTip} text-gray-500`}> | <p className={`mt-1 ${s.settingsTip} text-gray-500`}> | ||||
| <Trans | <Trans | ||||
| i18nKey={`${prefixSettings}.more.privacyPolicyTip`} | i18nKey={`${prefixSettings}.more.privacyPolicyTip`} | ||||
| components={{ privacyPolicyLink: <Link href={'https://docs.dify.ai/user-agreement/privacy-policy'} target='_blank' className='text-primary-600' /> }} | |||||
| components={{ privacyPolicyLink: <Link href={'https://docs.dify.ai/user-agreement/privacy-policy'} target='_blank' rel='noopener noreferrer' className='text-primary-600' /> }} | |||||
| /> | /> | ||||
| </p> | </p> | ||||
| <input className={`w-full mt-2 rounded-lg h-10 box-border px-3 ${s.projectName} bg-gray-100`} | <input className={`w-full mt-2 rounded-lg h-10 box-border px-3 ${s.projectName} bg-gray-100`} |
| <div> | <div> | ||||
| <PlanComp loc={'billing-page'} /> | <PlanComp loc={'billing-page'} /> | ||||
| {enableBilling && isCurrentWorkspaceManager && billingUrl && ( | {enableBilling && isCurrentWorkspaceManager && billingUrl && ( | ||||
| <a className='mt-5 flex px-6 justify-between h-12 items-center bg-gray-50 rounded-xl cursor-pointer' href={billingUrl} target='_blank'> | |||||
| <a className='mt-5 flex px-6 justify-between h-12 items-center bg-gray-50 rounded-xl cursor-pointer' href={billingUrl} target='_blank' rel='noopener noreferrer'> | |||||
| <div className='flex items-center'> | <div className='flex items-center'> | ||||
| <ReceiptList className='w-4 h-4 text-gray-700' /> | <ReceiptList className='w-4 h-4 text-gray-700' /> | ||||
| <div className='ml-2 text-sm font-normal text-gray-700'>{t('billing.viewBilling')}</div> | <div className='ml-2 text-sm font-normal text-gray-700'>{t('billing.viewBilling')}</div> |
| showContact && ( | showContact && ( | ||||
| <div className='absolute bottom-0 h-[50px] leading-[50px] text-xs text-gray-500'> | <div className='absolute bottom-0 h-[50px] leading-[50px] text-xs text-gray-500'> | ||||
| {t('custom.customize.prefix')} | {t('custom.customize.prefix')} | ||||
| <a className='text-[#155EEF]' href={contactSalesUrl} target='_blank'>{t('custom.customize.contactUs')}</a> | |||||
| <a className='text-[#155EEF]' href={contactSalesUrl} target='_blank' rel='noopener noreferrer'>{t('custom.customize.contactUs')}</a> | |||||
| {t('custom.customize.suffix')} | {t('custom.customize.suffix')} | ||||
| </div> | </div> | ||||
| ) | ) |
| import { useProviderContext } from '@/context/provider-context' | import { useProviderContext } from '@/context/provider-context' | ||||
| import { Plan } from '@/app/components/billing/type' | import { Plan } from '@/app/components/billing/type' | ||||
| import { imageUpload } from '@/app/components/base/image-uploader/utils' | import { imageUpload } from '@/app/components/base/image-uploader/utils' | ||||
| import type {} from '@/app/components/base/image-uploader/utils' | |||||
| import { useToastContext } from '@/app/components/base/toast' | import { useToastContext } from '@/app/components/base/toast' | ||||
| import { | import { | ||||
| updateCurrentWorkspace, | updateCurrentWorkspace, | ||||
| } from '@/service/common' | } from '@/service/common' | ||||
| import { useAppContext } from '@/context/app-context' | import { useAppContext } from '@/context/app-context' | ||||
| import { API_PREFIX } from '@/config' | import { API_PREFIX } from '@/config' | ||||
| import { getPurifyHref } from '@/utils' | |||||
| const ALLOW_FILE_EXTENSIONS = ['svg', 'png'] | const ALLOW_FILE_EXTENSIONS = ['svg', 'png'] | ||||
| POWERED BY | POWERED BY | ||||
| { | { | ||||
| webappLogo | webappLogo | ||||
| ? <img key={webappLogo} src={`${API_PREFIX.slice(0, -12)}/files/workspaces/${currentWorkspace.id}/webapp-logo`} alt='logo' className='ml-2 block w-auto h-5' /> | |||||
| ? <img key={webappLogo} src={`${getPurifyHref(API_PREFIX.slice(0, -12))}/files/workspaces/${currentWorkspace.id}/webapp-logo`} alt='logo' className='ml-2 block w-auto h-5' /> | |||||
| : <LogoSite className='ml-2 !h-5' /> | : <LogoSite className='ml-2 !h-5' /> | ||||
| } | } | ||||
| </div> | </div> |
| <div className={s.label}> | <div className={s.label}> | ||||
| {t('datasetSettings.form.retrievalSetting.title')} | {t('datasetSettings.form.retrievalSetting.title')} | ||||
| <div className='leading-[18px] text-xs font-normal text-gray-500'> | <div className='leading-[18px] text-xs font-normal text-gray-500'> | ||||
| <a target='_blank' href='https://docs.dify.ai/features/retrieval-augment' className='text-[#155eef]'>{t('datasetSettings.form.retrievalSetting.learnMore')}</a> | |||||
| <a target='_blank' rel='noopener noreferrer' href='https://docs.dify.ai/features/retrieval-augment' className='text-[#155eef]'>{t('datasetSettings.form.retrievalSetting.learnMore')}</a> | |||||
| {t('datasetSettings.form.retrievalSetting.longDescription')} | {t('datasetSettings.form.retrievalSetting.longDescription')} | ||||
| </div> | </div> | ||||
| </div> | </div> |
| <div className='text-base font-semibold text-gray-900'> | <div className='text-base font-semibold text-gray-900'> | ||||
| <div>{t('datasetSettings.form.retrievalSetting.title')}</div> | <div>{t('datasetSettings.form.retrievalSetting.title')}</div> | ||||
| <div className='leading-[18px] text-xs font-normal text-gray-500'> | <div className='leading-[18px] text-xs font-normal text-gray-500'> | ||||
| <a target='_blank' href='https://docs.dify.ai/features/retrieval-augment' className='text-[#155eef]'>{t('datasetSettings.form.retrievalSetting.learnMore')}</a> | |||||
| <a target='_blank' rel='noopener noreferrer' href='https://docs.dify.ai/features/retrieval-augment' className='text-[#155eef]'>{t('datasetSettings.form.retrievalSetting.learnMore')}</a> | |||||
| {t('datasetSettings.form.retrievalSetting.description')} | {t('datasetSettings.form.retrievalSetting.description')} | ||||
| </div> | </div> | ||||
| </div> | </div> |
| value={description} | value={description} | ||||
| onChange={e => setDescription(e.target.value)} | onChange={e => setDescription(e.target.value)} | ||||
| /> | /> | ||||
| <a className='flex items-center h-[18px] px-3 text-xs text-gray-500' href="https://docs.dify.ai/features/datasets#how-to-write-a-good-dataset-description" target='_blank'> | |||||
| <a className='flex items-center h-[18px] px-3 text-xs text-gray-500' href="https://docs.dify.ai/features/datasets#how-to-write-a-good-dataset-description" target='_blank' rel='noopener noreferrer'> | |||||
| <BookOpenIcon className='w-3 h-[18px] mr-1' /> | <BookOpenIcon className='w-3 h-[18px] mr-1' /> | ||||
| {t('datasetSettings.form.descWrite')} | {t('datasetSettings.form.descWrite')} | ||||
| </a> | </a> | ||||
| <div> | <div> | ||||
| <div>{t('datasetSettings.form.retrievalSetting.title')}</div> | <div>{t('datasetSettings.form.retrievalSetting.title')}</div> | ||||
| <div className='leading-[18px] text-xs font-normal text-gray-500'> | <div className='leading-[18px] text-xs font-normal text-gray-500'> | ||||
| <a target='_blank' href='https://docs.dify.ai/features/retrieval-augment' className='text-[#155eef]'>{t('datasetSettings.form.retrievalSetting.learnMore')}</a> | |||||
| <a target='_blank' rel='noopener noreferrer' href='https://docs.dify.ai/features/retrieval-augment' className='text-[#155eef]'>{t('datasetSettings.form.retrievalSetting.learnMore')}</a> | |||||
| {t('datasetSettings.form.retrievalSetting.description')} | {t('datasetSettings.form.retrievalSetting.description')} | ||||
| </div> | </div> | ||||
| </div> | </div> |
| <div className='text-[#1C64F2]'> | <div className='text-[#1C64F2]'> | ||||
| { | { | ||||
| IS_CE_EDITION | IS_CE_EDITION | ||||
| ? <Link href={'https://github.com/langgenius/dify/blob/main/LICENSE'} target='_blank'>Open Source License</Link> | |||||
| ? <Link href={'https://github.com/langgenius/dify/blob/main/LICENSE'} target='_blank' rel='noopener noreferrer'>Open Source License</Link> | |||||
| : <> | : <> | ||||
| <Link href={language !== LanguagesSupportedUnderscore[1] ? 'https://docs.dify.ai/user-agreement/privacy-policy' : 'https://docs.dify.ai/v/zh-hans/user-agreement/privacy-policy'} target='_blank'>Privacy Policy</Link>, | |||||
| <Link href={language !== LanguagesSupportedUnderscore[1] ? 'https://docs.dify.ai/user-agreement/terms-of-service' : 'https://docs.dify.ai/v/zh-hans/user-agreement/terms-of-service'} target='_blank'>Terms of Service</Link> | |||||
| <Link href={language !== LanguagesSupportedUnderscore[1] ? 'https://docs.dify.ai/user-agreement/privacy-policy' : 'https://docs.dify.ai/v/zh-hans/user-agreement/privacy-policy'} target='_blank' rel='noopener noreferrer'>Privacy Policy</Link>, | |||||
| <Link href={language !== LanguagesSupportedUnderscore[1] ? 'https://docs.dify.ai/user-agreement/terms-of-service' : 'https://docs.dify.ai/v/zh-hans/user-agreement/terms-of-service'} target='_blank' rel='noopener noreferrer'>Terms of Service</Link> | |||||
| </> | </> | ||||
| } | } | ||||
| </div> | </div> | ||||
| <Link | <Link | ||||
| className={classNames(buttonClassName, 'mr-2')} | className={classNames(buttonClassName, 'mr-2')} | ||||
| href={'https://github.com/langgenius/dify/releases'} | href={'https://github.com/langgenius/dify/releases'} | ||||
| target='_blank' | |||||
| target='_blank' rel='noopener noreferrer' | |||||
| > | > | ||||
| {t('common.about.changeLog')} | {t('common.about.changeLog')} | ||||
| </Link> | </Link> | ||||
| <Link | <Link | ||||
| className={classNames(buttonClassName, 'text-primary-600')} | className={classNames(buttonClassName, 'text-primary-600')} | ||||
| href={langeniusVersionInfo.release_notes} | href={langeniusVersionInfo.release_notes} | ||||
| target='_blank' | |||||
| target='_blank' rel='noopener noreferrer' | |||||
| > | > | ||||
| {t('common.about.updateNow')} | {t('common.about.updateNow')} | ||||
| </Link> | </Link> |
| <Avatar name={userProfile.name} className='sm:mr-2 mr-0' size={32} /> | <Avatar name={userProfile.name} className='sm:mr-2 mr-0' size={32} /> | ||||
| {!isMobile && <> | {!isMobile && <> | ||||
| {userProfile.name} | {userProfile.name} | ||||
| <ChevronDown className="w-3 h-3 ml-1 text-gray-700"/> | |||||
| <ChevronDown className="w-3 h-3 ml-1 text-gray-700" /> | |||||
| </>} | </>} | ||||
| </Menu.Button> | </Menu.Button> | ||||
| </div> | </div> | ||||
| <Link | <Link | ||||
| className={classNames(itemClassName, 'group justify-between')} | className={classNames(itemClassName, 'group justify-between')} | ||||
| href='https://feedback.dify.ai/' | href='https://feedback.dify.ai/' | ||||
| target='_blank'> | |||||
| target='_blank' rel='noopener noreferrer'> | |||||
| <div>{t('common.userProfile.roadmapAndFeedback')}</div> | <div>{t('common.userProfile.roadmapAndFeedback')}</div> | ||||
| <ArrowUpRight className='hidden w-[14px] h-[14px] text-gray-500 group-hover:flex' /> | <ArrowUpRight className='hidden w-[14px] h-[14px] text-gray-500 group-hover:flex' /> | ||||
| </Link> | </Link> | ||||
| <Link | <Link | ||||
| className={classNames(itemClassName, 'group justify-between')} | className={classNames(itemClassName, 'group justify-between')} | ||||
| href='https://discord.gg/5AEfbxcd9k' | href='https://discord.gg/5AEfbxcd9k' | ||||
| target='_blank'> | |||||
| target='_blank' rel='noopener noreferrer'> | |||||
| <div>{t('common.userProfile.community')}</div> | <div>{t('common.userProfile.community')}</div> | ||||
| <ArrowUpRight className='hidden w-[14px] h-[14px] text-gray-500 group-hover:flex' /> | <ArrowUpRight className='hidden w-[14px] h-[14px] text-gray-500 group-hover:flex' /> | ||||
| </Link> | </Link> | ||||
| href={ | href={ | ||||
| language !== LanguagesSupportedUnderscore[1] ? 'https://docs.dify.ai/' : `https://docs.dify.ai/v/${locale.toLowerCase()}/` | language !== LanguagesSupportedUnderscore[1] ? 'https://docs.dify.ai/' : `https://docs.dify.ai/v/${locale.toLowerCase()}/` | ||||
| } | } | ||||
| target='_blank'> | |||||
| target='_blank' rel='noopener noreferrer'> | |||||
| <div>{t('common.userProfile.helpCenter')}</div> | <div>{t('common.userProfile.helpCenter')}</div> | ||||
| <ArrowUpRight className='hidden w-[14px] h-[14px] text-gray-500 group-hover:flex' /> | <ArrowUpRight className='hidden w-[14px] h-[14px] text-gray-500 group-hover:flex' /> | ||||
| </Link> | </Link> |
| <a | <a | ||||
| className='flex items-center mb-2 h-[18px] text-xs text-primary-600' | className='flex items-center mb-2 h-[18px] text-xs text-primary-600' | ||||
| href={t('common.apiBasedExtension.linkUrl') || '/'} | href={t('common.apiBasedExtension.linkUrl') || '/'} | ||||
| target='_blank' | |||||
| target='_blank' rel='noopener noreferrer' | |||||
| > | > | ||||
| <BookOpen01 className='mr-1 w-3 h-3' /> | <BookOpen01 className='mr-1 w-3 h-3' /> | ||||
| {t('common.apiBasedExtension.link')} | {t('common.apiBasedExtension.link')} |
| return ( | return ( | ||||
| <Modal | <Modal | ||||
| isShow | isShow | ||||
| onClose={() => {}} | |||||
| onClose={() => { }} | |||||
| wrapperClassName='!z-[103]' | wrapperClassName='!z-[103]' | ||||
| className='!p-8 !pb-6 !max-w-none !w-[640px]' | className='!p-8 !pb-6 !max-w-none !w-[640px]' | ||||
| > | > | ||||
| {t('common.apiBasedExtension.modal.apiEndpoint.title')} | {t('common.apiBasedExtension.modal.apiEndpoint.title')} | ||||
| <a | <a | ||||
| href={t('common.apiBasedExtension.linkUrl') || '/'} | href={t('common.apiBasedExtension.linkUrl') || '/'} | ||||
| target='_blank' | |||||
| target='_blank' rel='noopener noreferrer' | |||||
| className='group flex items-center text-xs text-gray-500 font-normal hover:text-primary-600' | className='group flex items-center text-xs text-gray-500 font-normal hover:text-primary-600' | ||||
| > | > | ||||
| <BookOpen01 className='mr-1 w-3 h-3 text-gray-500 group-hover:text-primary-600' /> | <BookOpen01 className='mr-1 w-3 h-3 text-gray-500 group-hover:text-primary-600' /> |
| ? ( | ? ( | ||||
| <a | <a | ||||
| href={provider.help?.url[language]} | href={provider.help?.url[language]} | ||||
| target='_blank' | |||||
| target='_blank' rel='noopener noreferrer' | |||||
| className='inline-flex items-center text-xs text-primary-600' | className='inline-flex items-center text-xs text-primary-600' | ||||
| onClick={e => !provider.help.url && e.preventDefault()} | onClick={e => !provider.help.url && e.preventDefault()} | ||||
| > | > |
| return ( | return ( | ||||
| <a | <a | ||||
| href='https://github.com/langgenius/dify' | href='https://github.com/langgenius/dify' | ||||
| target='_blank' | |||||
| target='_blank' rel='noopener noreferrer' | |||||
| className='flex items-center leading-[18px] border border-gray-200 rounded-md text-xs text-gray-700 font-semibold overflow-hidden'> | className='flex items-center leading-[18px] border border-gray-200 rounded-md text-xs text-gray-700 font-semibold overflow-hidden'> | ||||
| <div className='flex items-center px-2 py-1 bg-gray-100'> | <div className='flex items-center px-2 py-1 bg-gray-100'> | ||||
| <Github className='mr-1 w-[18px] h-[18px]' /> | <Github className='mr-1 w-[18px] h-[18px]' /> |
| <a | <a | ||||
| className='text-gray-500' | className='text-gray-500' | ||||
| href={siteInfo.privacy_policy} | href={siteInfo.privacy_policy} | ||||
| target='_blank'>{t('share.chat.privacyPolicyMiddle')}</a> | |||||
| target='_blank' rel='noopener noreferrer'>{t('share.chat.privacyPolicyMiddle')}</a> | |||||
| {t('share.chat.privacyPolicyRight')} | {t('share.chat.privacyPolicyRight')} | ||||
| </div> | </div> | ||||
| : <div> | : <div> |
| <a | <a | ||||
| className='text-gray-500' | className='text-gray-500' | ||||
| href={siteInfo.privacy_policy} | href={siteInfo.privacy_policy} | ||||
| target='_blank'>{t('share.chat.privacyPolicyMiddle')}</a> | |||||
| target='_blank' rel='noopener noreferrer'>{t('share.chat.privacyPolicyMiddle')}</a> | |||||
| {t('share.chat.privacyPolicyRight')} | {t('share.chat.privacyPolicyRight')} | ||||
| </div> | </div> | ||||
| : <div> | : <div> |
| <a | <a | ||||
| className='text-gray-500' | className='text-gray-500' | ||||
| href={siteInfo.privacy_policy} | href={siteInfo.privacy_policy} | ||||
| target='_blank'>{t('share.chat.privacyPolicyMiddle')}</a> | |||||
| target='_blank' rel='noopener noreferrer'>{t('share.chat.privacyPolicyMiddle')}</a> | |||||
| {t('share.chat.privacyPolicyRight')} | {t('share.chat.privacyPolicyRight')} | ||||
| </div> | </div> | ||||
| </> | </> |
| {t('tools.contribute.line2')} | {t('tools.contribute.line2')} | ||||
| </div> | </div> | ||||
| </div> | </div> | ||||
| <a href='https://github.com/langgenius/dify/blob/main/CONTRIBUTING.md' target='_blank' className='mt-1 flex items-center space-x-1 text-[#155EEF]'> | |||||
| <a href='https://github.com/langgenius/dify/blob/main/CONTRIBUTING.md' target='_blank' rel='noopener noreferrer' className='mt-1 flex items-center space-x-1 text-[#155EEF]'> | |||||
| <BookOpen01 className='w-3 h-3' /> | <BookOpen01 className='w-3 h-3' /> | ||||
| <div className='leading-[18px] text-xs font-normal'>{t('tools.contribute.viewGuide')}</div> | <div className='leading-[18px] text-xs font-normal'>{t('tools.contribute.viewGuide')}</div> | ||||
| </a> | </a> |
| <div className='mx-2 w-px h-3 bg-black/5'></div> | <div className='mx-2 w-px h-3 bg-black/5'></div> | ||||
| <a | <a | ||||
| href="https://swagger.io/specification/" | href="https://swagger.io/specification/" | ||||
| target='_blank' | |||||
| target='_blank' rel='noopener noreferrer' | |||||
| className='flex items-center h-[18px] space-x-1 text-[#155EEF]' | className='flex items-center h-[18px] space-x-1 text-[#155EEF]' | ||||
| > | > | ||||
| <div className='text-xs font-normal'>{t('tools.createTool.viewSchemaSpec')}</div> | <div className='text-xs font-normal'>{t('tools.createTool.viewSchemaSpec')}</div> |
| import { login, oauth } from '@/service/common' | import { login, oauth } from '@/service/common' | ||||
| import I18n from '@/context/i18n' | import I18n from '@/context/i18n' | ||||
| import { LanguagesSupportedUnderscore, getModelRuntimeSupported } from '@/utils/language' | import { LanguagesSupportedUnderscore, getModelRuntimeSupported } from '@/utils/language' | ||||
| import { getPurifyHref } from '@/utils' | |||||
| const validEmailReg = /^[\w\.-]+@([\w-]+\.)+[\w-]{2,}$/ | const validEmailReg = /^[\w\.-]+@([\w-]+\.)+[\w-]{2,}$/ | ||||
| type IState = { | type IState = { | ||||
| {!IS_CE_EDITION && ( | {!IS_CE_EDITION && ( | ||||
| <div className="flex flex-col gap-3 mt-6"> | <div className="flex flex-col gap-3 mt-6"> | ||||
| <div className='w-full'> | <div className='w-full'> | ||||
| <a href={`${apiPrefix}/oauth/login/github`}> | |||||
| <a href={getPurifyHref(`${apiPrefix}/oauth/login/github`)}> | |||||
| <Button | <Button | ||||
| type='default' | type='default' | ||||
| disabled={isLoading} | disabled={isLoading} | ||||
| </a> | </a> | ||||
| </div> | </div> | ||||
| <div className='w-full'> | <div className='w-full'> | ||||
| <a href={`${apiPrefix}/oauth/login/google`}> | |||||
| <a href={getPurifyHref(`${apiPrefix}/oauth/login/google`)}> | |||||
| <Button | <Button | ||||
| type='default' | type='default' | ||||
| disabled={isLoading} | disabled={isLoading} |
| for (let i = length; i > 0; --i) result += chars[Math.floor(Math.random() * chars.length)] | for (let i = length; i > 0; --i) result += chars[Math.floor(Math.random() * chars.length)] | ||||
| return result | return result | ||||
| } | } | ||||
| export const getPurifyHref = (href: string) => { | |||||
| if (!href) | |||||
| return '' | |||||
| return href.replace(/javascript:/ig, '').replace(/vbscript:/ig, '').replace(/data:/ig, '') | |||||
| } |