mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-10-03 15:06:36 +08:00
优化仪表板页面,移除冗余组件,简化代码结构
This commit is contained in:
@@ -161,13 +161,6 @@ function isCacheLevelsValue(value: string) {
|
||||
return /^\d{1,2}(?::\d{1,2}){0,2}$/.test(value.trim());
|
||||
}
|
||||
|
||||
function extractMainConfigLines(content: string, matcher: RegExp) {
|
||||
return content
|
||||
.split('\n')
|
||||
.map((line) => line.trim())
|
||||
.filter((line) => line && matcher.test(line));
|
||||
}
|
||||
|
||||
export function PerformancePage() {
|
||||
const queryClient = useQueryClient();
|
||||
const {user} = useAuth();
|
||||
@@ -595,15 +588,6 @@ export function PerformancePage() {
|
||||
);
|
||||
}
|
||||
|
||||
const cachePreviewLines = extractMainConfigLines(
|
||||
preview.main_config,
|
||||
/proxy_cache_path|proxy_cache_key|proxy_cache_lock(?:_timeout)?|proxy_cache_use_stale/,
|
||||
);
|
||||
const gzipPreviewLines = extractMainConfigLines(
|
||||
preview.main_config,
|
||||
/gzip(?:_| )/,
|
||||
);
|
||||
|
||||
return (
|
||||
<div className="space-y-6">
|
||||
<PageHeader
|
||||
|
||||
Reference in New Issue
Block a user