mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2026-01-05 04:19:02 +08:00
fix: align S3 backup manager action buttons horizontally (#10922)
(cherry picked from commit d184f7a24b)
This commit is contained in:
parent
e4036b6991
commit
7b10ff5010
@ -2,7 +2,7 @@ import { DeleteOutlined, ExclamationCircleOutlined, ReloadOutlined } from '@ant-
|
|||||||
import { restoreFromS3 } from '@renderer/services/BackupService'
|
import { restoreFromS3 } from '@renderer/services/BackupService'
|
||||||
import type { S3Config } from '@renderer/types'
|
import type { S3Config } from '@renderer/types'
|
||||||
import { formatFileSize } from '@renderer/utils'
|
import { formatFileSize } from '@renderer/utils'
|
||||||
import { Button, Modal, Table, Tooltip } from 'antd'
|
import { Button, Modal, Space, Table, Tooltip } from 'antd'
|
||||||
import dayjs from 'dayjs'
|
import dayjs from 'dayjs'
|
||||||
import { useCallback, useEffect, useState } from 'react'
|
import { useCallback, useEffect, useState } from 'react'
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
@ -253,6 +253,26 @@ export function S3BackupManager({ visible, onClose, s3Config, restoreMethod }: S
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const footerContent = (
|
||||||
|
<Space align="center">
|
||||||
|
<Button key="refresh" icon={<ReloadOutlined />} onClick={fetchBackupFiles} disabled={loading}>
|
||||||
|
{t('settings.data.s3.manager.refresh')}
|
||||||
|
</Button>
|
||||||
|
<Button
|
||||||
|
key="delete"
|
||||||
|
danger
|
||||||
|
icon={<DeleteOutlined />}
|
||||||
|
onClick={handleDeleteSelected}
|
||||||
|
disabled={selectedRowKeys.length === 0 || deleting}
|
||||||
|
loading={deleting}>
|
||||||
|
{t('settings.data.s3.manager.delete.selected', { count: selectedRowKeys.length })}
|
||||||
|
</Button>
|
||||||
|
<Button key="close" onClick={onClose}>
|
||||||
|
{t('settings.data.s3.manager.close')}
|
||||||
|
</Button>
|
||||||
|
</Space>
|
||||||
|
)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Modal
|
<Modal
|
||||||
title={t('settings.data.s3.manager.title')}
|
title={t('settings.data.s3.manager.title')}
|
||||||
@ -261,23 +281,7 @@ export function S3BackupManager({ visible, onClose, s3Config, restoreMethod }: S
|
|||||||
width={800}
|
width={800}
|
||||||
centered
|
centered
|
||||||
transitionName="animation-move-down"
|
transitionName="animation-move-down"
|
||||||
footer={[
|
footer={footerContent}>
|
||||||
<Button key="refresh" icon={<ReloadOutlined />} onClick={fetchBackupFiles} disabled={loading}>
|
|
||||||
{t('settings.data.s3.manager.refresh')}
|
|
||||||
</Button>,
|
|
||||||
<Button
|
|
||||||
key="delete"
|
|
||||||
danger
|
|
||||||
icon={<DeleteOutlined />}
|
|
||||||
onClick={handleDeleteSelected}
|
|
||||||
disabled={selectedRowKeys.length === 0 || deleting}
|
|
||||||
loading={deleting}>
|
|
||||||
{t('settings.data.s3.manager.delete.selected', { count: selectedRowKeys.length })}
|
|
||||||
</Button>,
|
|
||||||
<Button key="close" onClick={onClose}>
|
|
||||||
{t('settings.data.s3.manager.close')}
|
|
||||||
</Button>
|
|
||||||
]}>
|
|
||||||
<Table
|
<Table
|
||||||
rowKey="fileName"
|
rowKey="fileName"
|
||||||
columns={columns}
|
columns={columns}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user