Skip to content

Commit

Permalink
Date strings in interface
Browse files Browse the repository at this point in the history
  • Loading branch information
nick-thompson committed Jun 26, 2023
1 parent f6f5c0a commit 9ddd309
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
4 changes: 3 additions & 1 deletion js/src/Interface.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,9 @@ export default function Interface(props) {
<div className="w-full h-screen min-w-[492px] min-h-[238px] bg-slate-800 bg-mesh p-8">
<div className="h-1/5 flex justify-between items-center text-md text-slate-400">
<img src={Lockup} className="h-8 w-auto" />
<span className="font-bold">SRVB</span>
<div>
<span className="font-bold">SRVB</span> &middot; {__BUILD_DATE__} &middot; {__COMMIT_HASH__}
</div>
</div>
<div className="flex flex-col h-4/5">
{props.error && (<ErrorAlert message={props.error.message} reset={props.resetErrorState} />)}
Expand Down
11 changes: 11 additions & 0 deletions js/vite.config.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,19 @@
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'

import { execSync } from 'node:child_process'

const currentCommit = execSync("git rev-parse --short HEAD").toString();
const date = new Date();
const dateString = `${date.getFullYear()}.${date.getMonth()}.${date.getDate()}`;


// https://vitejs.dev/config/
export default defineConfig({
base: './',
define: {
__COMMIT_HASH__: JSON.stringify(currentCommit),
__BUILD_DATE__: JSON.stringify(dateString),
},
plugins: [react()],
})

0 comments on commit 9ddd309

Please sign in to comment.