fix: add offline notice
This commit is contained in:
parent
53d30d537f
commit
089207240e
@ -2,12 +2,24 @@
|
||||
|
||||
import { useEffect } from 'react'
|
||||
import * as Sentry from '@sentry/react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import Toast from './base/toast'
|
||||
import { useDebounceEffect } from 'ahooks'
|
||||
|
||||
const isDevelopment = process.env.NODE_ENV === 'development'
|
||||
|
||||
const SentryInit = ({
|
||||
children,
|
||||
}: { children: React.ReactElement }) => {
|
||||
const { t } = useTranslation()
|
||||
useDebounceEffect(() => {
|
||||
Toast.notify({
|
||||
type: 'warning',
|
||||
message: t('common.offlineNotice'),
|
||||
duration: 60000,
|
||||
className: 'fixed left-1/2 -translate-x-1/2',
|
||||
})
|
||||
}, [t])
|
||||
useEffect(() => {
|
||||
const SENTRY_DSN = document?.body?.getAttribute('data-public-sentry-dsn')
|
||||
if (!isDevelopment && SENTRY_DSN) {
|
||||
|
@ -1,4 +1,5 @@
|
||||
const translation = {
|
||||
offlineNotice: 'Dify v1.0.0 is now officially released. Effective February 24, 2025, the current environment will no longer be accessible, and all data will be permanently deleted. Please ensure that you back up any necessary data prior to this date to avoid any loss.',
|
||||
api: {
|
||||
success: 'Success',
|
||||
actionSuccess: 'Action succeeded',
|
||||
|
@ -1,4 +1,5 @@
|
||||
const translation = {
|
||||
offlineNotice: 'Dify v1.0.0 现已正式发布。自 2025年 2 月 24 日起,当前环境将不可访问,所有数据将被永久删除。请务必在此日期之前备份所有必要数据,以避免任何数据丢失。',
|
||||
api: {
|
||||
success: '成功',
|
||||
actionSuccess: '操作成功',
|
||||
|
Loading…
Reference in New Issue
Block a user