Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

index.tsx 3.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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 LogoSite from '@/app/components/base/logo/logo-site'
  11. import { noop } from 'lodash-es'
  12. type IAccountSettingProps = {
  13. langeniusVersionInfo: LangGeniusVersionResponse
  14. onCancel: () => void
  15. }
  16. export default function AccountAbout({
  17. langeniusVersionInfo,
  18. onCancel,
  19. }: IAccountSettingProps) {
  20. const { t } = useTranslation()
  21. const isLatest = langeniusVersionInfo.current_version === langeniusVersionInfo.latest_version
  22. return (
  23. <Modal
  24. isShow
  25. onClose={noop}
  26. className='!w-[480px] !max-w-[480px] !px-6 !py-4'
  27. >
  28. <div className='relative pt-4'>
  29. <div className='absolute -right-4 -top-2 flex h-8 w-8 cursor-pointer items-center justify-center' onClick={onCancel}>
  30. <RiCloseLine className='h-4 w-4 text-text-tertiary' />
  31. </div>
  32. <div>
  33. <LogoSite className='mx-auto mb-2' />
  34. <div className='mb-3 text-center text-xs font-normal text-text-tertiary'>Version {langeniusVersionInfo?.current_version}</div>
  35. <div className='mb-4 text-center text-xs font-normal text-text-secondary'>
  36. <div>© {dayjs().year()} LangGenius, Inc., Contributors.</div>
  37. <div className='text-text-accent'>
  38. {
  39. IS_CE_EDITION
  40. ? <Link href={'https://github.com/langgenius/dify/blob/main/LICENSE'} target='_blank' rel='noopener noreferrer'>Open Source License</Link>
  41. : <>
  42. <Link href='https://dify.ai/privacy' target='_blank' rel='noopener noreferrer'>Privacy Policy</Link>,<span> </span>
  43. <Link href='https://dify.ai/terms' target='_blank' rel='noopener noreferrer'>Terms of Service</Link>
  44. </>
  45. }
  46. </div>
  47. </div>
  48. </div>
  49. <div className='-mx-8 mb-4 h-[0.5px] bg-divider-regular' />
  50. <div className='flex items-center justify-between'>
  51. <div className='text-xs font-medium text-text-primary'>
  52. {
  53. isLatest
  54. ? t('common.about.latestAvailable', { version: langeniusVersionInfo.latest_version })
  55. : t('common.about.nowAvailable', { version: langeniusVersionInfo.latest_version })
  56. }
  57. </div>
  58. <div className='flex items-center'>
  59. <Button className='mr-2'>
  60. <Link
  61. href={'https://github.com/langgenius/dify/releases'}
  62. target='_blank' rel='noopener noreferrer'
  63. >
  64. {t('common.about.changeLog')}
  65. </Link>
  66. </Button>
  67. {
  68. !isLatest && !IS_CE_EDITION && (
  69. <Button variant='primary'>
  70. <Link
  71. href={langeniusVersionInfo.release_notes}
  72. target='_blank' rel='noopener noreferrer'
  73. >
  74. {t('common.about.updateNow')}
  75. </Link>
  76. </Button>
  77. )
  78. }
  79. </div>
  80. </div>
  81. </div>
  82. </Modal>
  83. )
  84. }