mirror of
https://github.com/router-for-me/Cli-Proxy-API-Management-Center.git
synced 2026-02-19 11:10:49 +08:00
feat(AuthFilesPage): add title section with file count badge
This commit is contained in:
@@ -357,13 +357,10 @@ export function AuthFilesPage() {
|
||||
const start = (currentPage - 1) * pageSize;
|
||||
const pageItems = filtered.slice(start, start + pageSize);
|
||||
|
||||
// 统计信息
|
||||
const totalSize = useMemo(() => files.reduce((sum, item) => sum + (item.size || 0), 0), [files]);
|
||||
|
||||
// 点击上传
|
||||
const handleUploadClick = () => {
|
||||
fileInputRef.current?.click();
|
||||
};
|
||||
// 点击上传
|
||||
const handleUploadClick = () => {
|
||||
fileInputRef.current?.click();
|
||||
};
|
||||
|
||||
// 处理文件上传(支持多选)
|
||||
const handleFileChange = async (event: React.ChangeEvent<HTMLInputElement>) => {
|
||||
@@ -834,15 +831,22 @@ export function AuthFilesPage() {
|
||||
);
|
||||
};
|
||||
|
||||
const titleNode = (
|
||||
<div className={styles.titleWrapper}>
|
||||
<span>{t('auth_files.title_section')}</span>
|
||||
{files.length > 0 && <span className={styles.countBadge}>{files.length}</span>}
|
||||
</div>
|
||||
);
|
||||
|
||||
return (
|
||||
<div className={styles.container}>
|
||||
<div className={styles.pageHeader}>
|
||||
<h1 className={styles.pageTitle}>{t('auth_files.title')}</h1>
|
||||
<p className={styles.description}>{t('auth_files.description')}</p>
|
||||
</div>
|
||||
|
||||
<Card
|
||||
title={t('auth_files.title_section')}
|
||||
<div className={styles.pageHeader}>
|
||||
<h1 className={styles.pageTitle}>{t('auth_files.title')}</h1>
|
||||
<p className={styles.description}>{t('auth_files.description')}</p>
|
||||
</div>
|
||||
|
||||
<Card
|
||||
title={titleNode}
|
||||
extra={
|
||||
<div className={styles.headerActions}>
|
||||
<Button
|
||||
@@ -906,14 +910,8 @@ export function AuthFilesPage() {
|
||||
onChange={handlePageSizeChange}
|
||||
/>
|
||||
</div>
|
||||
<div className={styles.filterItem}>
|
||||
<label>{t('common.info')}</label>
|
||||
<div className={styles.statsInfo}>
|
||||
{files.length} {t('auth_files.files_count')} · {formatFileSize(totalSize)}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* 卡片网格 */}
|
||||
{loading ? (
|
||||
|
||||
Reference in New Issue
Block a user