feat: add commit SHA handling for development environment and update menu layout
This commit is contained in:
@@ -4,6 +4,7 @@ NEXT_PUBLIC_NAVIDROME_USERNAME=your_username
|
|||||||
NEXT_PUBLIC_NAVIDROME_PASSWORD=your_password
|
NEXT_PUBLIC_NAVIDROME_PASSWORD=your_password
|
||||||
NEXT_PUBLIC_POSTHOG_KEY=KEY
|
NEXT_PUBLIC_POSTHOG_KEY=KEY
|
||||||
NEXT_PUBLIC_POSTHOG_HOST=HOSTURL
|
NEXT_PUBLIC_POSTHOG_HOST=HOSTURL
|
||||||
|
# NEXT_PUBLIC_COMMIT_SHA=$(git rev-parse --short HEAD)
|
||||||
# Example for external server:
|
# Example for external server:
|
||||||
# NEXT_PUBLIC_NAVIDROME_URL=https://your-navidrome-server.com
|
# NEXT_PUBLIC_NAVIDROME_URL=https://your-navidrome-server.com
|
||||||
# NEXT_PUBLIC_NAVIDROME_USERNAME=your_username
|
# NEXT_PUBLIC_NAVIDROME_USERNAME=your_username
|
||||||
|
|||||||
1
.env.local
Normal file
1
.env.local
Normal file
@@ -0,0 +1 @@
|
|||||||
|
NEXT_PUBLIC_COMMIT_SHA=4b195af
|
||||||
@@ -266,25 +266,34 @@ export function Menu({ toggleSidebar, isSidebarVisible, toggleStatusBar, isStatu
|
|||||||
<DialogHeader>
|
<DialogHeader>
|
||||||
</DialogHeader>
|
</DialogHeader>
|
||||||
<div className="grid gap-4 py-4">
|
<div className="grid gap-4 py-4">
|
||||||
<div>
|
<div className="flex items-center gap-4">
|
||||||
<Image
|
<Image
|
||||||
src="/splash.png"
|
src="/icon-512.png"
|
||||||
alt="music"
|
alt="music"
|
||||||
width={400}
|
width={100}
|
||||||
height={400}
|
height={100}
|
||||||
/>
|
/>
|
||||||
|
<h1 className="text-5xl font-bold">mice</h1>
|
||||||
</div>
|
</div>
|
||||||
|
<p className="text-sm text-muted-foreground pt-0">
|
||||||
|
A Navidrome client built with Next.js and Shadcn/UI.
|
||||||
|
</p>
|
||||||
<Separator />
|
<Separator />
|
||||||
<p>
|
<p>
|
||||||
a music player that doesn't (yet) play music
|
built by <a href="https://github.com/sillyangel" target="_blank" rel="noreferrer" className="underline">sillyangel</a>
|
||||||
</p>
|
</p>
|
||||||
<div className="flex space-x-4">
|
<div className="flex flex-col items-center gap-1 text-xs w-full mt-2">
|
||||||
<a href="https://github.com/sillyangel/project-still" target="_blank" rel="noreferrer">
|
<div className="flex items-center gap-2">
|
||||||
<Github />
|
<span className={`h-2 w-2 rounded-full ${isConnected ? "bg-green-500" : "bg-red-400"}`} />
|
||||||
</a>
|
<span>
|
||||||
<a href="mailto:angel@sillyangel.xyz">
|
Navidrome: <span className={isConnected ? "text-green-600" : "text-red-500"}>{isConnected ? "Connected" : "Not connected"}</span>
|
||||||
<Mail />
|
</span>
|
||||||
</a>
|
</div>
|
||||||
|
<div className="truncate max-w-[220px] text-center text-muted-foreground">
|
||||||
|
URL: {typeof window !== "undefined"
|
||||||
|
? localStorage.getItem("navidromeUrl") || <span className="italic text-gray-400">Not set</span>
|
||||||
|
: <span className="italic text-gray-400">Not available</span>}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</DialogContent>
|
</DialogContent>
|
||||||
|
|||||||
@@ -3,10 +3,14 @@ import localFont from "next/font/local";
|
|||||||
import "./globals.css";
|
import "./globals.css";
|
||||||
import RootLayoutClient from "./components/RootLayoutClient";
|
import RootLayoutClient from "./components/RootLayoutClient";
|
||||||
|
|
||||||
|
// Get the short commit hash from env (set in dev via .env or prebuild script)
|
||||||
|
const isDev = process.env.NODE_ENV === 'development';
|
||||||
|
const shortCommit = isDev ? process.env.NEXT_PUBLIC_COMMIT_SHA || '' : '';
|
||||||
|
|
||||||
export const metadata = {
|
export const metadata = {
|
||||||
title: {
|
title: {
|
||||||
template: 'mice | %s',
|
template: isDev && shortCommit ? `mice (dev: ${shortCommit}) | %s` : 'mice | %s',
|
||||||
default: 'mice',
|
default: isDev && shortCommit ? `mice (dev: ${shortCommit})` : 'mice',
|
||||||
},
|
},
|
||||||
description: 'a very awesome music streaming service',
|
description: 'a very awesome music streaming service',
|
||||||
robots: {
|
robots: {
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
"predev": "echo NEXT_PUBLIC_COMMIT_SHA=$(git rev-parse --short HEAD) > .env.local",
|
||||||
"dev": "next dev -p 40624",
|
"dev": "next dev -p 40624",
|
||||||
"build": "next build",
|
"build": "next build",
|
||||||
"start": "next start -p 40624",
|
"start": "next start -p 40624",
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 172 KiB After Width: | Height: | Size: 62 KiB |
Reference in New Issue
Block a user