add build time

This commit is contained in:
Lee 2023-11-06 17:40:54 +00:00
parent 2e4842efd4
commit be998f068c
3 changed files with 18 additions and 5 deletions

@ -10,6 +10,13 @@ const nextConfig = {
env: { env: {
NEXT_PUBLIC_BUILD_ID: NEXT_PUBLIC_BUILD_ID:
process.env.GIT_REV || nextBuildId.sync({ dir: __dirname }), process.env.GIT_REV || nextBuildId.sync({ dir: __dirname }),
NEXT_PUBLIC_BUILD_TIME: new Date().toLocaleDateString("en-US", {
year: "numeric",
month: "long",
day: "numeric",
hour: "numeric",
minute: "numeric",
}),
}, },
images: { images: {
remotePatterns: [ remotePatterns: [
@ -58,6 +65,7 @@ module.exports = withBundleAnalyzer(nextConfig);
// // Injected content via Sentry wizard below // // Injected content via Sentry wizard below
const { withSentryConfig } = require("@sentry/nextjs"); const { withSentryConfig } = require("@sentry/nextjs");
const { format } = require("path");
module.exports = withSentryConfig( module.exports = withSentryConfig(
module.exports, module.exports,

@ -15,9 +15,14 @@ const buttons = [
]; ];
const buildId = process.env.NEXT_PUBLIC_BUILD_ID const buildId = process.env.NEXT_PUBLIC_BUILD_ID
? process.env.NEXT_PUBLIC_BUILD_ID.slice(0, 7) + ? isProduction()
(isProduction() ? "" : "-dev") ? process.env.NEXT_PUBLIC_BUILD_ID.slice(0, 7)
: "dev"
: ""; : "";
const buildTime = process.env.NEXT_PUBLIC_BUILD_TIME;
const gitUrl = isProduction()
? `https://git.fascinated.cc/Fascinated/scoresaber-reloaded-v2/commit/${buildId}`
: "https://git.fascinated.cc/Fascinated/scoresaber-reloaded-v2";
export default function Footer() { export default function Footer() {
return ( return (
@ -52,10 +57,10 @@ export default function Footer() {
<Link <Link
className="transform-gpu text-sm text-gray-400 transition-all hover:opacity-80" className="transform-gpu text-sm text-gray-400 transition-all hover:opacity-80"
href={`https://git.fascinated.cc/Fascinated/scoresaber-reloaded-v2/commit/${buildId}`} href={gitUrl}
target="_blank" target="_blank"
> >
Build ID: {buildId} Build ID: {buildId} ({buildTime})
</Link> </Link>
</Card> </Card>
</footer> </footer>

@ -14,7 +14,7 @@ export default function SongInfo() {
<div <div
className={clsx( className={clsx(
"flex transform-gpu gap-2 p-2 transition-all", "flex transform-gpu gap-2 p-2 transition-all",
paused ? "grayscale" : "grayscale-0", paused ? "grayscale" : "grayscale-0", // make the song info grayscale when paused
)} )}
> >
<Image <Image