mirror of
https://github.com/router-for-me/Cli-Proxy-API-Management-Center.git
synced 2026-02-18 18:50:49 +08:00
feat: add auth type counts and hide disabled quotas
This commit is contained in:
@@ -79,6 +79,9 @@
|
||||
}
|
||||
|
||||
.filterTag {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
padding: 6px 14px;
|
||||
border-radius: 20px;
|
||||
font-size: 13px;
|
||||
@@ -97,6 +100,16 @@
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.filterTagLabel {
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.filterTagCount {
|
||||
font-size: 12px;
|
||||
font-weight: 600;
|
||||
opacity: 0.85;
|
||||
}
|
||||
|
||||
.filterControls {
|
||||
display: flex;
|
||||
gap: $spacing-md;
|
||||
|
||||
@@ -453,6 +453,15 @@ export function AuthFilesPage() {
|
||||
return Array.from(types);
|
||||
}, [files]);
|
||||
|
||||
const typeCounts = useMemo(() => {
|
||||
const counts: Record<string, number> = { all: files.length };
|
||||
files.forEach((file) => {
|
||||
if (!file.type) return;
|
||||
counts[file.type] = (counts[file.type] || 0) + 1;
|
||||
});
|
||||
return counts;
|
||||
}, [files]);
|
||||
|
||||
// 过滤和搜索
|
||||
const filtered = useMemo(() => {
|
||||
return files.filter((item) => {
|
||||
@@ -1006,7 +1015,8 @@ export function AuthFilesPage() {
|
||||
setPage(1);
|
||||
}}
|
||||
>
|
||||
{getTypeLabel(type)}
|
||||
<span className={styles.filterTagLabel}>{getTypeLabel(type)}</span>
|
||||
<span className={styles.filterTagCount}>{typeCounts[type] ?? 0}</span>
|
||||
</button>
|
||||
);
|
||||
})}
|
||||
|
||||
Reference in New Issue
Block a user