From e8d91bc4ceb08aae012a84e072f8a56eeead98a0 Mon Sep 17 00:00:00 2001 From: Donkie Date: Sun, 17 Sep 2023 11:11:05 +0200 Subject: [PATCH] Client: Show commit and build in version element --- client/src/components/version.tsx | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/client/src/components/version.tsx b/client/src/components/version.tsx index 2749145..9bf6352 100644 --- a/client/src/components/version.tsx +++ b/client/src/components/version.tsx @@ -1,5 +1,7 @@ import { useQuery } from "@tanstack/react-query"; -import { Spin } from "antd"; +import { Spin, Typography } from "antd"; + +const { Text } = Typography; interface IInfo { version: string; @@ -8,6 +10,8 @@ interface IInfo { data_dir: string; backups_dir: string; db_type: string; + git_commit?: string; + build_date?: string; } export const Version: React.FC = () => { @@ -33,5 +37,11 @@ export const Version: React.FC = () => { } const info = infoResult.data; - return {info.version}; + const commit_suffix = info.git_commit ? {` (${info.git_commit})`} : <>; + return ( + + {info.version} + {commit_suffix} + + ); };