mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-08-13 21:35:59 +08:00
feat: add confirm ui (#4625)
This commit is contained in:
parent
24624491cd
commit
10c61da686
@ -22,6 +22,7 @@ import Tag from '@/app/components/base/tag'
|
||||
import Switch from '@/app/components/base/switch'
|
||||
import Divider from '@/app/components/base/divider'
|
||||
import CopyFeedback from '@/app/components/base/copy-feedback'
|
||||
import Confirm from '@/app/components/base/confirm'
|
||||
import ShareQRCode from '@/app/components/base/qrcode'
|
||||
import SecretKeyButton from '@/app/components/develop/secret-key/secret-key-button'
|
||||
import type { AppDetailResponse } from '@/models/app'
|
||||
@ -57,6 +58,8 @@ function AppCard({
|
||||
const [showEmbedded, setShowEmbedded] = useState(false)
|
||||
const [showCustomizeModal, setShowCustomizeModal] = useState(false)
|
||||
const [genLoading, setGenLoading] = useState(false)
|
||||
const [showConfirmDelete, setShowConfirmDelete] = useState(false)
|
||||
|
||||
const { t } = useTranslation()
|
||||
|
||||
const OPERATIONS_MAP = useMemo(() => {
|
||||
@ -176,6 +179,20 @@ function AppCard({
|
||||
className={'hover:bg-gray-200'}
|
||||
/>
|
||||
{/* button copy link/ button regenerate */}
|
||||
{showConfirmDelete && (
|
||||
<Confirm
|
||||
type='warning'
|
||||
title={t('appOverview.overview.appInfo.regenerate')}
|
||||
content={''}
|
||||
isShow={showConfirmDelete}
|
||||
onClose={() => setShowConfirmDelete(false)}
|
||||
onConfirm={() => {
|
||||
onGenCode()
|
||||
setShowConfirmDelete(false)
|
||||
}}
|
||||
onCancel={() => setShowConfirmDelete(false)}
|
||||
/>
|
||||
)}
|
||||
{isApp && isCurrentWorkspaceManager && (
|
||||
<Tooltip
|
||||
content={t('appOverview.overview.appInfo.regenerate') || ''}
|
||||
@ -183,7 +200,7 @@ function AppCard({
|
||||
>
|
||||
<div
|
||||
className="w-8 h-8 ml-0.5 cursor-pointer hover:bg-gray-200 rounded-lg"
|
||||
onClick={onGenCode}
|
||||
onClick={() => setShowConfirmDelete(true)}
|
||||
>
|
||||
<div
|
||||
className={`w-full h-full ${style.refreshIcon} ${
|
||||
|
@ -34,6 +34,7 @@ const translation = {
|
||||
accessibleAddress: 'Öffentliche URL',
|
||||
preview: 'Vorschau',
|
||||
regenerate: 'Regenerieren',
|
||||
regenerateNotice: 'Möchten Sie die öffentliche URL neu generieren?',
|
||||
preUseReminder: 'Bitte aktivieren Sie WebApp, bevor Sie fortfahren.',
|
||||
settings: {
|
||||
entry: 'Einstellungen',
|
||||
|
@ -34,6 +34,7 @@ const translation = {
|
||||
accessibleAddress: 'Public URL',
|
||||
preview: 'Preview',
|
||||
regenerate: 'Regenerate',
|
||||
regenerateNotice: 'Do you want to regenerate the public URL?',
|
||||
preUseReminder: 'Please enable WebApp before continuing.',
|
||||
settings: {
|
||||
entry: 'Settings',
|
||||
|
@ -34,6 +34,7 @@ const translation = {
|
||||
accessibleAddress: 'URL publique',
|
||||
preview: 'Aperçu',
|
||||
regenerate: 'Regénérer',
|
||||
regenerateNotice: 'Voulez-vous régénérer l\'URL publique ?',
|
||||
preUseReminder: 'Veuillez activer WebApp avant de continuer.',
|
||||
settings: {
|
||||
entry: 'Paramètres',
|
||||
|
@ -34,6 +34,7 @@ const translation = {
|
||||
accessibleAddress: '公開URL',
|
||||
preview: 'プレビュー',
|
||||
regenerate: '再生成',
|
||||
regenerateNotice: '公開URLを再生成しますか?',
|
||||
preUseReminder: '続行する前にWebAppを有効にしてください。',
|
||||
settings: {
|
||||
entry: '設定',
|
||||
|
@ -34,6 +34,7 @@ const translation = {
|
||||
accessibleAddress: '공개 URL',
|
||||
preview: '미리보기',
|
||||
regenerate: '재생성',
|
||||
regenerateNotice: '공개 URL을 재생성하시겠습니까?',
|
||||
preUseReminder: '계속하기 전에 웹앱을 활성화하세요.',
|
||||
settings: {
|
||||
entry: '설정',
|
||||
|
@ -37,6 +37,7 @@ const translation = {
|
||||
accessibleAddress: 'Publiczny adres URL',
|
||||
preview: 'Podgląd',
|
||||
regenerate: 'Wygeneruj ponownie',
|
||||
regenerateNotice: 'Czy chcesz wygenerować ponownie publiczny adres URL?',
|
||||
preUseReminder: 'Przed kontynuowaniem włącz aplikację WebApp.',
|
||||
settings: {
|
||||
entry: 'Ustawienia',
|
||||
|
@ -34,6 +34,7 @@ const translation = {
|
||||
accessibleAddress: 'URL Pública',
|
||||
preview: 'Visualização',
|
||||
regenerate: 'Regenerar',
|
||||
regenerateNotice: 'Você deseja regenerar a URL pública?',
|
||||
preUseReminder: 'Por favor, ative o WebApp antes de continuar.',
|
||||
settings: {
|
||||
entry: 'Configurações',
|
||||
|
@ -34,6 +34,7 @@ const translation = {
|
||||
accessibleAddress: 'URL public',
|
||||
preview: 'Previzualizare',
|
||||
regenerate: 'Regenerare',
|
||||
regenerateNotice: 'Doriți să regenerați URL-ul public?',
|
||||
preUseReminder: 'Activați aplicația web înainte de a continua.',
|
||||
settings: {
|
||||
entry: 'Setări',
|
||||
|
@ -34,6 +34,7 @@ const translation = {
|
||||
accessibleAddress: 'Публічний URL',
|
||||
preview: 'Попередній перегляд',
|
||||
regenerate: 'Відновити',
|
||||
regenerateNotice: 'Бажаєте згенерувати новий публічний URL?',
|
||||
preUseReminder: 'Будь ласка, активуйте веб-додаток перед продовженням.',
|
||||
settings: {
|
||||
entry: 'Налаштування',
|
||||
|
@ -34,6 +34,7 @@ const translation = {
|
||||
accessibleAddress: 'Địa chỉ công cộng',
|
||||
preview: 'Xem trước',
|
||||
regenerate: 'Tạo lại',
|
||||
regenerateNotice: 'Bạn có muốn tạo lại địa chỉ công cộng không?',
|
||||
preUseReminder: 'Vui lòng kích hoạt ứng dụng web trước khi tiếp tục.',
|
||||
settings: {
|
||||
entry: 'Cài đặt',
|
||||
|
@ -34,6 +34,7 @@ const translation = {
|
||||
accessibleAddress: '公开访问 URL',
|
||||
preview: '预览',
|
||||
regenerate: '重新生成',
|
||||
regenerateNotice: '您是否要重新生成公开访问 URL?',
|
||||
preUseReminder: '使用前请先打开开关',
|
||||
settings: {
|
||||
entry: '设置',
|
||||
|
@ -34,6 +34,7 @@ const translation = {
|
||||
accessibleAddress: '公開訪問 URL',
|
||||
preview: '預覽',
|
||||
regenerate: '重新生成',
|
||||
regenerateNotice: '您是否要重新生成公開訪問 URL?',
|
||||
preUseReminder: '使用前請先開啟開關',
|
||||
settings: {
|
||||
entry: '設定',
|
||||
|
Loading…
x
Reference in New Issue
Block a user