Merge branch 'next' into develop

This commit is contained in:
nocobase[bot]
2025-03-19 10:29:51 +00:00
2 changed files with 15 additions and 2 deletions
@@ -838,6 +838,7 @@
"The will interrupt service, it may take a few seconds to restart. Are you sure to continue?": "重启将会中断当前服务,这个过程可能需要一点时间,确定要继续吗?",
"Restart": "重启",
"Clear cache": "清除缓存",
"Are you sure you want to clear cache ?": "你确定你想清除缓存吗",
"Duplicate": "复制",
"Duplicating": "复制中",
"Duplicate mode": "复制方式",
@@ -10,17 +10,29 @@
import React from 'react';
import { useTranslation } from 'react-i18next';
import { useAPIClient, SchemaSettingsItem } from '@nocobase/client';
import { App } from 'antd';
export const ClearCache = () => {
const { t } = useTranslation();
const api = useAPIClient();
const { modal } = App.useApp();
return (
<SchemaSettingsItem
eventKey="cache"
title="cache"
onClick={async () => {
await api.resource('app').clearCache();
window.location.reload();
modal.confirm({
title: t('Clear cache'),
content: t('Are you sure you want to clear cache ?'),
okText: t('Clear'),
okButtonProps: {
danger: true,
},
onOk: async () => {
await api.resource('app').clearCache();
window.location.reload();
},
});
}}
>
{t('Clear cache')}