fix: add offline notice
This commit is contained in:
parent
53d30d537f
commit
089207240e
@ -2,12 +2,24 @@
|
|||||||
|
|
||||||
import { useEffect } from 'react'
|
import { useEffect } from 'react'
|
||||||
import * as Sentry from '@sentry/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 isDevelopment = process.env.NODE_ENV === 'development'
|
||||||
|
|
||||||
const SentryInit = ({
|
const SentryInit = ({
|
||||||
children,
|
children,
|
||||||
}: { children: React.ReactElement }) => {
|
}: { 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(() => {
|
useEffect(() => {
|
||||||
const SENTRY_DSN = document?.body?.getAttribute('data-public-sentry-dsn')
|
const SENTRY_DSN = document?.body?.getAttribute('data-public-sentry-dsn')
|
||||||
if (!isDevelopment && SENTRY_DSN) {
|
if (!isDevelopment && SENTRY_DSN) {
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
const translation = {
|
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: {
|
api: {
|
||||||
success: 'Success',
|
success: 'Success',
|
||||||
actionSuccess: 'Action succeeded',
|
actionSuccess: 'Action succeeded',
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
const translation = {
|
const translation = {
|
||||||
|
offlineNotice: 'Dify v1.0.0 现已正式发布。自 2025年 2 月 24 日起,当前环境将不可访问,所有数据将被永久删除。请务必在此日期之前备份所有必要数据,以避免任何数据丢失。',
|
||||||
api: {
|
api: {
|
||||||
success: '成功',
|
success: '成功',
|
||||||
actionSuccess: '操作成功',
|
actionSuccess: '操作成功',
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user