perf: optimize data path, indexes and frontend virtualization

- Убран latestCDNRowsBySource; expanded BIRD preview генерируется on-demand
- Batch AS meta updates; миграция perf-индексов 000012
- VirtualPrefixList для preview префиксов; метрики pipeline refresh
- PolitePause для RIPEstat после cache miss

Co-authored-by: Cursor <[email protected]>
This commit is contained in:
Denozordec
2026-05-21 10:45:39 +07:00
co-authored by Cursor
parent be3d73f374
commit a8c5e9701f
14 changed files with 172 additions and 46 deletions
@@ -0,0 +1,37 @@
<script lang="ts">
type Props = {
items: readonly string[];
rowHeight?: number;
viewportHeight?: number;
class?: string;
};
let { items, rowHeight = 20, viewportHeight = 320, class: className = '' }: Props = $props();
let scrollTop = $state(0);
const totalHeight = $derived(items.length * rowHeight);
const startIndex = $derived(Math.max(0, Math.floor(scrollTop / rowHeight) - 2));
const visibleCount = $derived(Math.ceil(viewportHeight / rowHeight) + 4);
const visibleItems = $derived(items.slice(startIndex, startIndex + visibleCount));
</script>
<div
class="overflow-auto rounded-md border {className}"
style="height: {viewportHeight}px"
onscroll={(e) => {
scrollTop = e.currentTarget.scrollTop;
}}
>
<div style="height: {totalHeight}px; position: relative">
{#each visibleItems as pfx, i (`${startIndex + i}-${pfx}`)}
<p
class="font-mono text-xs leading-5 truncate px-2"
style="position: absolute; top: {(startIndex + i) * rowHeight}px; left: 0; right: 0; height: {rowHeight}px"
>
{pfx}
</p>
{:else}
<p class="text-muted-foreground p-2 text-sm">Нет префиксов</p>
{/each}
</div>
</div>
+2 -9
View File
@@ -60,6 +60,7 @@
ReportRow
} from '$lib/components/operations/types.js';
import ScrollPreBlock from '$lib/components/app/scroll-pre-block.svelte';
import VirtualPrefixList from '$lib/ui/patterns/virtual-list/virtual-prefix-list.svelte';
import CardSkeleton from '$lib/ui/patterns/feedback/card-skeleton.svelte';
import KpiMetricsGrid from '$lib/ui/patterns/kpi/kpi-metrics-grid.svelte';
import { confirm } from '$lib/ui/patterns/confirm/confirm-state.svelte.js';
@@ -1105,15 +1106,7 @@
<span class="font-medium">Префиксов:</span>
{prefixesData.length}
</p>
<div
class="flex min-h-[10rem] min-w-0 flex-1 flex-col overflow-auto overscroll-contain rounded-lg border border-border bg-muted/40 p-3 [scrollbar-gutter:stable]"
>
{#each prefixesData as pfx, idx (`${idx}-${pfx}`)}
<p class="font-mono text-xs">{pfx}</p>
{:else}
<p class="text-muted-foreground text-xs">Нет префиксов</p>
{/each}
</div>
<VirtualPrefixList items={prefixesData} viewportHeight={360} />
</TabsContent>
</Tabs>
</div>