Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. 'use client'
  2. import { useTranslation } from 'react-i18next'
  3. import Link from 'next/link'
  4. import dayjs from 'dayjs'
  5. import { RiCloseLine } from '@remixicon/react'
  6. import Modal from '@/app/components/base/modal'
  7. import Button from '@/app/components/base/button'
  8. import type { LangGeniusVersionResponse } from '@/models/common'
  9. import { IS_CE_EDITION } from '@/config'
  10. import DifyLogo from '@/app/components/base/logo/dify-logo'
  11. import { useGlobalPublicStore } from '@/context/global-public-context'
  12. type IAccountSettingProps = {
  13. langGeniusVersionInfo: LangGeniusVersionResponse
  14. onCancel: () => void
  15. }
  16. export default function AccountAbout({
  17. langGeniusVersionInfo,
  18. onCancel,
  19. }: IAccountSettingProps) {
  20. const { t } = useTranslation()
  21. const isLatest = langGeniusVersionInfo.current_version === langGeniusVersionInfo.latest_version
  22. const systemFeatures = useGlobalPublicStore(s => s.systemFeatures)
  23. return (
  24. <Modal
  25. isShow
  26. onClose={onCancel}
  27. className='!w-[480px] !max-w-[480px] !px-6 !py-4'
  28. >
  29. <div className='relative'>
  30. <div className='absolute right-0 top-0 flex h-8 w-8 cursor-pointer items-center justify-center' onClick={onCancel}>
  31. <RiCloseLine className='h-4 w-4 text-text-tertiary' />
  32. </div>
  33. <div className='flex flex-col items-center gap-4 py-8'>
  34. {systemFeatures.branding.enabled && systemFeatures.branding.workspace_logo
  35. ? <img
  36. src={systemFeatures.branding.workspace_logo}
  37. className='block h-7 w-auto object-contain'
  38. alt='logo'
  39. />
  40. : <DifyLogo size='large' className='mx-auto' />}
  41. <div className='text-center text-xs font-normal text-text-tertiary'>Version {langGeniusVersionInfo?.current_version}</div>
  42. <div className='flex flex-col items-center gap-2 text-center text-xs font-normal text-text-secondary'>
  43. <div>© {dayjs().year()} LangGenius, Inc., Contributors.</div>
  44. <div className='text-text-accent'>
  45. {
  46. IS_CE_EDITION
  47. ? <Link href={'https://github.com/langgenius/dify/blob/main/LICENSE'} target='_blank' rel='noopener noreferrer'>Open Source License</Link>
  48. : <>
  49. <Link href='https://dify.ai/privacy' target='_blank' rel='noopener noreferrer'>Privacy Policy</Link>,&nbsp;
  50. <Link href='https://dify.ai/terms' target='_blank' rel='noopener noreferrer'>Terms of Service</Link>
  51. </>
  52. }
  53. </div>
  54. </div>
  55. </div>
  56. <div className='-mx-8 mb-4 h-[0.5px] bg-divider-regular' />
  57. <div className='flex items-center justify-between'>
  58. <div className='text-xs font-medium text-text-tertiary'>
  59. {
  60. isLatest
  61. ? t('common.about.latestAvailable', { version: langGeniusVersionInfo.latest_version })
  62. : t('common.about.nowAvailable', { version: langGeniusVersionInfo.latest_version })
  63. }
  64. </div>
  65. <div className='flex items-center'>
  66. <Button className='mr-2' size='small'>
  67. <Link
  68. href={'https://github.com/langgenius/dify/releases'}
  69. target='_blank' rel='noopener noreferrer'
  70. >
  71. {t('common.about.changeLog')}
  72. </Link>
  73. </Button>
  74. {
  75. !isLatest && !IS_CE_EDITION && (
  76. <Button variant='primary' size='small'>
  77. <Link
  78. href={langGeniusVersionInfo.release_notes}
  79. target='_blank' rel='noopener noreferrer'
  80. >
  81. {t('common.about.updateNow')}
  82. </Link>
  83. </Button>
  84. )
  85. }
  86. </div>
  87. </div>
  88. </div>
  89. </Modal>
  90. )
  91. }