diff --git a/src/lib/server/gitea.ts b/src/lib/server/gitea.ts index 5e7720b..b7fcd17 100644 --- a/src/lib/server/gitea.ts +++ b/src/lib/server/gitea.ts @@ -7,6 +7,13 @@ export interface GitCommit { url: string; timestamp: Date; user: string; + diff: Diff; +} + +export interface Diff { + additions: number; + deletions: number; + total: number; } const CACHE_TTL = 3 * 60 * 60 * 1000; @@ -68,12 +75,17 @@ async function fetchLatestCommits( let newCommit: GitCommit = { message: commit.commit.message, hash: commit.sha, - shortHash: commit.sha.substring(0, 8), + shortHash: commit.sha.substring(0, 6), timestamp: new Date(commit.created), url: commit.html_url, parentRepo: repo.full_name, parentBranch: 'main', // I know this is a shit solution - user: commit.commit.author.name + user: commit.commit.author.name, + diff: { + additions: commit.stats.additions, + deletions: commit.stats.deletions, + total: commit.stats.total + } }; commitList.push(newCommit); } diff --git a/src/routes/Commits.svelte b/src/routes/Commits.svelte index 3f339ab..4ca7f81 100644 --- a/src/routes/Commits.svelte +++ b/src/routes/Commits.svelte @@ -162,35 +162,53 @@
- + {#if visibleItems[index - 1]?.parentRepo != commit.parentRepo} +
+ + {commit.user} - {item.user} on - {item.parentRepo}@{item.parentBranch} + on + + {commit.parentRepo}@{commit.parentBranch} +
{/if} -{item.shortHash}
-{item.message}
-+ {commit.shortHash} +
+{commit.message}
+