mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-10-08 16:46:37 +08:00
feat(access-logs): 概览支持 Zone/域名多选筛选
概览可按 Zone→Domain 层级多选域名并折叠展开;明细列表 IP 旁展示地区。 后端 overview 支持 hosts 多域名精确匹配。
This commit is contained in:
@@ -20,10 +20,16 @@ import type {
|
||||
|
||||
function buildSearchParams(filters: object): Record<string, unknown> {
|
||||
const params: Record<string, unknown> = {};
|
||||
Object.entries(
|
||||
filters as Record<string, string | number | undefined>,
|
||||
).forEach(([key, value]) => {
|
||||
Object.entries(filters as Record<string, unknown>).forEach(([key, value]) => {
|
||||
if (value === undefined || value === null || value === '') return;
|
||||
if (Array.isArray(value)) {
|
||||
const items = value
|
||||
.map((item) => String(item).trim())
|
||||
.filter((item) => item !== '');
|
||||
if (items.length === 0) return;
|
||||
params[key] = items;
|
||||
return;
|
||||
}
|
||||
params[key] = value;
|
||||
});
|
||||
return params;
|
||||
|
||||
@@ -503,6 +503,7 @@ export interface AccessLogFilters {
|
||||
export interface AccessLogOverviewFilters {
|
||||
node_id?: string;
|
||||
host?: string;
|
||||
hosts?: string[];
|
||||
hours?: number;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user