From 4e75449c68a0dbc59b9bf6396b1f90ee062b1cca Mon Sep 17 00:00:00 2001 From: Damnae Date: Mon, 8 Apr 2024 19:29:17 +0200 Subject: [PATCH] Display compared versions. --- src/common/datasource.ts | 8 ++++++++ src/styles/main.css | 19 +++++++++++++++++++ src/views/pages/Changes.vue | 16 ++++++++++++++++ 3 files changed, 43 insertions(+) diff --git a/src/common/datasource.ts b/src/common/datasource.ts index 685c771..6f28544 100644 --- a/src/common/datasource.ts +++ b/src/common/datasource.ts @@ -187,6 +187,14 @@ export async function getLatestCommitId() return commits[0]?.sha } +export async function getCommitVersion(commitId:string) : Promise +{ + const commits = await retrieveCommits() + const entry = commits.find(c => c.sha == commitId) + const message = entry?.commit.message ?? 'missing' + return message.replace(/\s+/, ' ').split(' ')[0] ?? message +} + export interface DataSourceCompareFile { Path:string diff --git a/src/styles/main.css b/src/styles/main.css index 3ba4497..0241b1f 100644 --- a/src/styles/main.css +++ b/src/styles/main.css @@ -22,6 +22,25 @@ body min-height: 100vh; } +header +{ + display:flex; + align-items:center; + justify-content:end; + gap:.5rem; +} +header .header-info +{ + text-align:end; + order:-1; + color:#484848; + margin-bottom:.5rem; +} +header .header-info em +{ + color:grey; +} + h1 { font-weight: 100; diff --git a/src/views/pages/Changes.vue b/src/views/pages/Changes.vue index 79dc54a..fe94899 100644 --- a/src/views/pages/Changes.vue +++ b/src/views/pages/Changes.vue @@ -1,5 +1,6 @@