|
67 | 67 | return `${value.toLocaleString()} B`; |
68 | 68 | } |
69 | 69 |
|
| 70 | + function formatDate(value: string | null): string { |
| 71 | + if (!value) return '기록 없음'; |
| 72 | + const date = new Date(value); |
| 73 | + if (Number.isNaN(date.getTime())) return value; |
| 74 | + return new Intl.DateTimeFormat('ko-KR', { dateStyle: 'medium', timeStyle: 'short' }).format(date); |
| 75 | + } |
| 76 | +
|
70 | 77 | function domainCount(domainId: UniverseKnowledgeDomainId): number | null { |
71 | 78 | return coverage?.domainCounts[domainId] |
72 | 79 | ?? overview?.domains.find((domain) => domain.domainId === domainId)?.itemCount |
|
405 | 412 | {#if content.receipt.truncated}<b>BOUNDED PREVIEW</b>{/if} |
406 | 413 | </footer> |
407 | 414 | </section> |
| 415 | + <section class="fileProvenance" aria-label={`${content.title} 파일 계보`}> |
| 416 | + <header><span>FILE PROVENANCE</span><b>{content.fileMeta.securityStatus ?? 'UNKNOWN'}</b></header> |
| 417 | + <div class="provenanceFacts"> |
| 418 | + <div><span>FILE SIZE</span><strong>{content.fileMeta.sizeBytes !== null ? formatBytes(content.fileMeta.sizeBytes) : '기록 없음'}</strong></div> |
| 419 | + <div><span>LAST COMMIT</span><strong>{formatDate(content.fileMeta.lastCommitAt)}</strong></div> |
| 420 | + <div><span>AV SCAN</span><strong>{content.fileMeta.antivirusStatus ?? '기록 없음'}</strong></div> |
| 421 | + </div> |
| 422 | + {#if content.fileMeta.lastCommitTitle}<p>{content.fileMeta.lastCommitTitle}</p>{/if} |
| 423 | + <div class="provenanceHashes"> |
| 424 | + {#if content.fileMeta.lastCommitId}<div><span>COMMIT</span><code title={content.fileMeta.lastCommitId}>{content.fileMeta.lastCommitId}</code></div>{/if} |
| 425 | + {#if content.fileMeta.blobId}<div><span>BLOB</span><code title={content.fileMeta.blobId}>{content.fileMeta.blobId}</code></div>{/if} |
| 426 | + {#if content.fileMeta.lfsOid}<div><span>LFS</span><code title={content.fileMeta.lfsOid}>{content.fileMeta.lfsOid}</code></div>{/if} |
| 427 | + {#if content.fileMeta.xetHash}<div><span>XET</span><code title={content.fileMeta.xetHash}>{content.fileMeta.xetHash}</code></div>{/if} |
| 428 | + </div> |
| 429 | + </section> |
408 | 430 | {/if} |
409 | 431 | {#if selectedAttributes.length > 0} |
410 | 432 | <dl>{#each selectedAttributes as [key, value] (key)}<div><dt>{key}</dt><dd>{typeof value === 'number' ? value.toLocaleString() : String(value)}</dd></div>{/each}</dl> |
|
562 | 584 | .contentPreview > footer span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } |
563 | 585 | .contentPreview > footer code { margin-left: auto; color: #6d84a0; } |
564 | 586 | .contentPreview > footer b { flex: 0 0 auto; color: #bc925b; font-size: 6px; letter-spacing: .06em; } |
| 587 | + .fileProvenance { margin-top: 8px; overflow: hidden; border: 1px solid rgba(93, 119, 152, .14); border-radius: 9px; background: rgba(8, 13, 21, .66); } |
| 588 | + .fileProvenance > header { min-height: 29px; display: flex; align-items: center; justify-content: space-between; padding: 0 10px; border-bottom: 1px solid rgba(84, 108, 139, .11); } |
| 589 | + .fileProvenance > header span { color: #58708d; font: 650 7px/1 ui-monospace, monospace; letter-spacing: .1em; } |
| 590 | + .fileProvenance > header b { border-radius: 999px; padding: 3px 5px; color: #b29362; background: rgba(178, 147, 98, .1); font: 650 6px/1 ui-monospace, monospace; letter-spacing: .06em; } |
| 591 | + .provenanceFacts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); } |
| 592 | + .provenanceFacts div { min-width: 0; padding: 9px; border-right: 1px solid rgba(84, 108, 139, .1); } |
| 593 | + .provenanceFacts div:last-child { border-right: 0; } |
| 594 | + .provenanceFacts span, .provenanceHashes span { display: block; color: #4f6279; font: 600 6px/1 ui-monospace, monospace; } |
| 595 | + .provenanceFacts strong { display: block; margin-top: 5px; overflow: hidden; color: #91a3b8; font: 550 7px/1.2 ui-monospace, monospace; text-overflow: ellipsis; white-space: nowrap; } |
| 596 | + .fileProvenance > p { margin: 0; padding: 9px 10px; border-top: 1px solid rgba(84, 108, 139, .08); color: #8395aa; font-size: 8px; line-height: 1.45; overflow-wrap: anywhere; } |
| 597 | + .provenanceHashes { border-top: 1px solid rgba(84, 108, 139, .08); padding: 5px 10px; } |
| 598 | + .provenanceHashes div { min-width: 0; display: grid; grid-template-columns: 48px minmax(0, 1fr); align-items: center; gap: 7px; padding: 4px 0; } |
| 599 | + .provenanceHashes code { min-width: 0; overflow: hidden; color: #677f9b; font: 500 7px/1 ui-monospace, monospace; text-overflow: ellipsis; white-space: nowrap; user-select: text; } |
565 | 600 | dl { margin: 16px 0 0; } |
566 | 601 | dl div { display: grid; grid-template-columns: 74px minmax(0, 1fr); gap: 8px; padding: 7px 0; border-bottom: 1px solid rgba(85, 106, 134, .1); } |
567 | 602 | dt { color: #53667e; font: 600 7px/1.3 ui-monospace, monospace; overflow-wrap: anywhere; } |
|
0 commit comments