added diff to commits
This commit is contained in:
@@ -52,9 +52,10 @@ async function getRepoCommits(fetch: typeof globalThis.fetch, url: string) {
|
||||
let finalData = [];
|
||||
|
||||
for (let commit of data) {
|
||||
// Filter out other users
|
||||
if (commit.author.login == 'voidarc') {
|
||||
// Filter out other users and do a null check for non-gitea commits that might exist
|
||||
if (commit.author != null && commit.author.login == 'voidarc') {
|
||||
finalData.push(commit);
|
||||
} else {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -71,7 +72,7 @@ async function fetchLatestCommits(
|
||||
for (let repo of repos) {
|
||||
let commits = await getRepoCommits(fetch, repo.url);
|
||||
for (let commit of commits) {
|
||||
console.log(commit);
|
||||
// console.log(commit);
|
||||
let newCommit: GitCommit = {
|
||||
message: commit.commit.message,
|
||||
hash: commit.sha,
|
||||
|
||||
@@ -206,7 +206,19 @@
|
||||
{commit.shortHash}
|
||||
</p>
|
||||
<p class="ml-2 line-clamp-1 group-hover:font-semibold">{commit.message}</p>
|
||||
<div class="justify-content-end flex text-align-right flex-1"><div>some</div></div>
|
||||
<div class="flex flex-1 flex-row">
|
||||
<!-- spacer -->
|
||||
<div class="flex-1"></div>
|
||||
|
||||
<div class="mx-1 mr-2 flex flex-row font-bold text-ctp-mantle">
|
||||
{#if commit.diff.deletions > 0}
|
||||
<div class="rounded-l-lg bg-ctp-green px-1">+{commit.diff.additions}</div>
|
||||
<div class="rounded-r-lg bg-ctp-red px-1">-{commit.diff.deletions}</div>
|
||||
{:else}
|
||||
<div class="rounded-lg bg-ctp-green px-1">+{commit.diff.additions}</div>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user