show extra snapshot details in ui

This commit is contained in:
Kiril Videlov 2024-05-06 15:34:42 +02:00
parent b1bb9bf51c
commit 42d8e6fd5d
No known key found for this signature in database

View File

@ -27,6 +27,9 @@
};
type Snapshot = {
id: string;
linesAdded: number;
linesRemoved: number;
filesChanged: string[];
details: SnapshotDetails | undefined;
createdAt: number;
};
@ -79,17 +82,23 @@
</div>
<div style="padding-left: 16px; hidden;">
{#if entry.details?.operation === 'RestoreFromSnapshot'}
from: {entry.details?.trailers
restored_from: {entry.details?.trailers
.find((t) => t.key === 'restored_from')
?.value?.slice(0, 7)}
{:else if entry.details?.operation === 'FileChanges'}
{#each entry.details?.trailers
.find((t) => t.key === 'files')
?.value?.split(',') || [] as file}
<div>{file}</div>
{/each}
{/if}
</div>
<div>
lines added: {entry.linesAdded}
</div>
<div>
lines removed: {entry.linesRemoved}
</div>
<div>
<div>files changed:</div>
{#each entry.filesChanged as filePath}
<div style="padding-left: 16px;">{filePath}</div>
{/each}
</div>
</div>
</div>
{/each}