diff --git a/web/app/components/plugins/plugin-detail-panel/detail-header/components/header-modals.tsx b/web/app/components/plugins/plugin-detail-panel/detail-header/components/header-modals.tsx index 62840b64e3..dea7b58d38 100644 --- a/web/app/components/plugins/plugin-detail-panel/detail-header/components/header-modals.tsx +++ b/web/app/components/plugins/plugin-detail-panel/detail-header/components/header-modals.tsx @@ -4,7 +4,15 @@ import type { FC } from 'react' import type { PluginDetail } from '../../../types' import type { ModalStates, VersionTarget } from '../hooks' import { useTranslation } from 'react-i18next' -import Confirm from '@/app/components/base/confirm' +import { + AlertDialog, + AlertDialogActions, + AlertDialogCancelButton, + AlertDialogConfirmButton, + AlertDialogContent, + AlertDialogDescription, + AlertDialogTitle, +} from '@/app/components/base/ui/alert-dialog' import PluginInfo from '@/app/components/plugins/plugin-page/plugin-info' import UpdateFromMarketplace from '@/app/components/plugins/update-plugin/from-market-place' import { useGetLanguage } from '@/context/i18n' @@ -50,7 +58,6 @@ const HeaderModals: FC = ({ return ( <> - {/* Plugin Info Modal */} {isShowPluginInfo && ( = ({ /> )} - {/* Delete Confirm Modal */} - {isShowDeleteConfirm && ( - + { + if (!open) + hideDeleteConfirm() + }} + > + +
+ + {t(`${i18nPrefix}.delete`, { ns: 'plugin' })} + + {t(`${i18nPrefix}.deleteContentLeft`, { ns: 'plugin' })} - {label[locale]} + {label[locale]} {t(`${i18nPrefix}.deleteContentRight`, { ns: 'plugin' })} -
-
- )} - onCancel={hideDeleteConfirm} - onConfirm={onDelete} - isLoading={deleting} - isDisabled={deleting} - /> - )} + + + + + {t('operation.cancel', { ns: 'common' })} + + + {t('operation.confirm', { ns: 'common' })} + + +
+
- {/* Update from Marketplace Modal */} {isShowUpdateModal && ( { + const { t } = useTranslation() const { checkForUpdates, fetchReleases } = useGitHubReleases() const { setShowUpdatePluginModal } = useModalContext() const { refreshModelProviders } = useProviderContext() @@ -114,6 +116,10 @@ export const usePluginOperations = ({ if (res.success) { modalStates.hideDeleteConfirm() + Toast.notify({ + type: 'success', + message: t('action.deleteSuccess', { ns: 'plugin' }), + }) onUpdate?.(true) if (PluginCategoryEnum.model.includes(category)) diff --git a/web/eslint-suppressions.json b/web/eslint-suppressions.json index 6c153a386f..e548cea291 100644 --- a/web/eslint-suppressions.json +++ b/web/eslint-suppressions.json @@ -5317,11 +5317,6 @@ "count": 1 } }, - "app/components/plugins/plugin-detail-panel/detail-header/components/header-modals.tsx": { - "no-restricted-imports": { - "count": 1 - } - }, "app/components/plugins/plugin-detail-panel/detail-header/components/plugin-source-badge.tsx": { "no-restricted-imports": { "count": 1 diff --git a/web/i18n/en-US/plugin.json b/web/i18n/en-US/plugin.json index c7f091a442..0ddc64eee2 100644 --- a/web/i18n/en-US/plugin.json +++ b/web/i18n/en-US/plugin.json @@ -3,6 +3,7 @@ "action.delete": "Remove plugin", "action.deleteContentLeft": "Would you like to remove ", "action.deleteContentRight": " plugin?", + "action.deleteSuccess": "Plugin removed successfully", "action.pluginInfo": "Plugin info", "action.usedInApps": "This plugin is being used in {{num}} apps.", "allCategories": "All Categories", @@ -114,7 +115,7 @@ "detailPanel.operation.install": "Install", "detailPanel.operation.remove": "Remove", "detailPanel.operation.update": "Update", - "detailPanel.operation.viewDetail": "View Detail", + "detailPanel.operation.viewDetail": "View on Marketplace", "detailPanel.serviceOk": "Service OK", "detailPanel.strategyNum": "{{num}} {{strategy}} INCLUDED", "detailPanel.switchVersion": "Switch Version", diff --git a/web/i18n/zh-Hans/plugin.json b/web/i18n/zh-Hans/plugin.json index 703bd4e6ea..229ae263d8 100644 --- a/web/i18n/zh-Hans/plugin.json +++ b/web/i18n/zh-Hans/plugin.json @@ -3,6 +3,7 @@ "action.delete": "移除插件", "action.deleteContentLeft": "是否要移除 ", "action.deleteContentRight": " 插件?", + "action.deleteSuccess": "插件移除成功", "action.pluginInfo": "插件信息", "action.usedInApps": "此插件正在 {{num}} 个应用中使用。", "allCategories": "所有类别", @@ -114,7 +115,7 @@ "detailPanel.operation.install": "安装", "detailPanel.operation.remove": "移除", "detailPanel.operation.update": "更新", - "detailPanel.operation.viewDetail": "查看详情", + "detailPanel.operation.viewDetail": "在 Marketplace 查看", "detailPanel.serviceOk": "服务正常", "detailPanel.strategyNum": "包含 {{num}} 个 {{strategy}}", "detailPanel.switchVersion": "切换版本",