feat: enhance RefreshModule to support legacy ASN resolution and improve prefix handling. Introduce sorting of ASNs and manage announced prefixes with polite pauses for better API interaction. Update buildPreviewFragments to streamline route rendering for BIRD configurations.
CI / changes (push) Successful in 10s
CI / openapi (push) Has been skipped
CI / go (push) Successful in 35s
CI / docker-web (deploy/docker/evobgp-web/Dockerfile, , evobgp-web) (push) Successful in 1m27s
CI / docker-web (deploy/docker/evobgp-web/Dockerfile, evobgp-all, evobgp-web-all) (push) Successful in 1m16s
CI / docker-bird (push) Has been skipped
CI / bird2 (push) Successful in 19s
CI / docker-go (deploy/docker/evobgp-agent/Dockerfile, , evobgp-agent) (push) Successful in 1m17s
CI / docker-go (evobgp-all, 1, deploy/docker/gobinary/Dockerfile, , evobgp-all) (push) Successful in 1m48s
CI / docker-go (evobgp-api, 1, deploy/docker/gobinary/Dockerfile, , evobgp-api) (push) Successful in 1m49s
CI / docker-go (evobgp-deploy, 0, deploy/docker/gobinary/Dockerfile, , evobgp-deploy) (push) Successful in 1m28s
CI / docker-go (evobgp-ingest, 0, deploy/docker/gobinary/Dockerfile, , evobgp-ingest) (push) Successful in 1m35s
CI / docker-go (evobgp-node, 0, deploy/docker/gobinary/Dockerfile, , evobgp-node) (push) Successful in 1m15s
CI / docker-go (evobgp-render, 0, deploy/docker/gobinary/Dockerfile, , evobgp-render) (push) Successful in 1m27s
CI / docker-go (evobgp-scheduler, 0, deploy/docker/gobinary/Dockerfile, , evobgp-scheduler) (push) Successful in 1m23s

This commit is contained in:
Denozordec
2026-04-06 00:01:16 +07:00
parent 1969a00151
commit e1aaa18377
9 changed files with 625 additions and 68 deletions
+56 -43
View File
@@ -505,8 +505,10 @@
<!-- Preview dialog -->
<Dialog bind:open={previewDialog}>
<DialogContent class="sm:max-w-4xl">
<DialogHeader>
<DialogContent
class="!flex max-h-[min(96vh,880px)] w-[min(100vw-2rem,56rem)] flex-col gap-4 overflow-hidden sm:max-w-4xl"
>
<DialogHeader class="shrink-0 space-y-1.5 pr-8">
<DialogTitle>Ревизия {previewRevision?.id.slice(0, 8)}</DialogTitle>
<DialogDescription>
Срендеренный конфиг BIRD 2 (фрагменты из control plane) и материализованные префиксы.
@@ -515,48 +517,59 @@
{#if previewLoading}
<p class="text-muted-foreground py-4 text-center text-sm">Загрузка…</p>
{:else}
<Tabs bind:value={previewSubTab} class="w-full">
<TabsList class="grid w-full max-w-md grid-cols-2">
<TabsTrigger value="bird">Конфиг BIRD</TabsTrigger>
<TabsTrigger value="prefixes">Префиксы</TabsTrigger>
</TabsList>
<TabsContent value="bird" class="mt-3 space-y-2">
{@const frags = asPreviewFragments(previewData)}
{#if Object.keys(frags).length === 0}
<p class="text-muted-foreground text-sm">Нет фрагментов превью (старая ревизия или пустой render).</p>
{:else}
<div class="flex flex-wrap items-center gap-2">
<label for="bird-frag" class="text-muted-foreground text-sm">Файл</label>
<select
id="bird-frag"
class="border-input bg-background ring-offset-background focus-visible:ring-ring max-w-xl flex-1 rounded-md border px-2 py-1.5 text-sm focus-visible:ring-2 focus-visible:outline-none"
bind:value={birdPreviewPath}
>
{#each Object.keys(frags).sort() as path}
<option value={path}>{path}</option>
{/each}
</select>
</div>
<p class="text-muted-foreground text-xs">
Совет: откройте <code class="bg-muted rounded px-1">_bird_full_expanded.conf</code> — один текст с
<code class="bg-muted rounded px-1">bird.conf</code> и содержимым всех include.
</p>
<ScrollArea class="max-h-[min(70vh,28rem)] rounded border">
<pre class="p-3 font-mono text-xs whitespace-pre-wrap break-words">{frags[birdPreviewPath] ?? ''}</pre>
</ScrollArea>
{/if}
</TabsContent>
<TabsContent value="prefixes" class="mt-3">
<p class="text-sm mb-2"><span class="font-medium">Префиксов:</span> {prefixesData.length}</p>
<ScrollArea class="max-h-80 rounded border p-3">
{#each prefixesData as pfx}
<p class="font-mono text-xs">{pfx}</p>
<div class="flex min-h-0 min-w-0 flex-1 flex-col">
<Tabs bind:value={previewSubTab} class="flex min-h-0 flex-1 flex-col gap-3">
<TabsList class="grid w-full max-w-md shrink-0 grid-cols-2">
<TabsTrigger value="bird">Конфиг BIRD</TabsTrigger>
<TabsTrigger value="prefixes">Префиксы</TabsTrigger>
</TabsList>
<TabsContent value="bird" class="mt-0 flex min-h-0 flex-1 flex-col gap-2 outline-none">
{@const frags = asPreviewFragments(previewData)}
{#if Object.keys(frags).length === 0}
<p class="text-muted-foreground text-sm">Нет фрагментов превью (старая ревизия или пустой render).</p>
{:else}
<p class="text-muted-foreground text-xs">Нет префиксов</p>
{/each}
</ScrollArea>
</TabsContent>
</Tabs>
<div class="flex shrink-0 flex-wrap items-center gap-2">
<label for="bird-frag" class="text-muted-foreground text-sm">Файл</label>
<select
id="bird-frag"
class="border-input bg-background ring-offset-background focus-visible:ring-ring max-w-xl min-w-0 flex-1 rounded-md border px-2 py-1.5 text-sm focus-visible:ring-2 focus-visible:outline-none"
bind:value={birdPreviewPath}
>
{#each Object.keys(frags).sort() as path}
<option value={path}>{path}</option>
{/each}
</select>
</div>
<p class="text-muted-foreground shrink-0 text-xs">
Совет: откройте <code class="bg-muted rounded px-1">_bird_full_expanded.conf</code> — один текст с
<code class="bg-muted rounded px-1">bird.conf</code> и содержимым всех include.
</p>
<div
class="border-border bg-muted/40 text-foreground relative isolate min-h-[12rem] min-w-0 flex-1 overflow-x-auto overflow-y-auto rounded-lg border [scrollbar-gutter:stable] overscroll-contain"
>
<pre
class="text-foreground m-0 block min-w-0 w-full max-w-none p-3 font-mono text-xs leading-relaxed whitespace-pre-wrap break-words select-text"
>{frags[birdPreviewPath] ?? ''}</pre>
</div>
{/if}
</TabsContent>
<TabsContent value="prefixes" class="mt-0 flex min-h-0 flex-1 flex-col gap-2 outline-none">
<p class="text-sm shrink-0">
<span class="font-medium">Префиксов:</span>
{prefixesData.length}
</p>
<div
class="border-border bg-muted/40 min-h-[10rem] min-w-0 flex-1 overflow-x-auto overflow-y-auto rounded-lg border p-3 [scrollbar-gutter:stable] overscroll-contain"
>
{#each prefixesData as pfx}
<p class="font-mono text-xs">{pfx}</p>
{:else}
<p class="text-muted-foreground text-xs">Нет префиксов</p>
{/each}
</div>
</TabsContent>
</Tabs>
</div>
{/if}
</DialogContent>
</Dialog>