mirror of
https://github.com/hamster1963/nezha-dash.git
synced 2025-04-24 21:10:45 +08:00
feat: add custom header env
This commit is contained in:
parent
94d2d56a16
commit
05cbeacbdb
@ -7,4 +7,7 @@ NEXT_PUBLIC_ShowFlag=true
|
||||
NEXT_PUBLIC_DisableCartoon=false
|
||||
NEXT_PUBLIC_ShowTag=true
|
||||
NEXT_PUBLIC_ShowNetTransfer=false
|
||||
NEXT_PUBLIC_ForceUseSvgFlag=false
|
||||
NEXT_PUBLIC_ForceUseSvgFlag=false
|
||||
NEXT_PUBLIC_CustomLogo=https://nezha-cf.buycoffee.top/apple-touch-icon.png
|
||||
NEXT_PUBLIC_CustomTitle=NezhaDash
|
||||
NEXT_PUBLIC_CustomDescription=NezhaDash is a dashboard for Nezha.
|
||||
|
@ -3,6 +3,7 @@
|
||||
import { LanguageSwitcher } from "@/components/LanguageSwitcher";
|
||||
import { ModeToggle } from "@/components/ThemeSwitcher";
|
||||
import { Separator } from "@/components/ui/separator";
|
||||
import getEnv from "@/lib/env-entry";
|
||||
import { DateTime } from "luxon";
|
||||
import { useTranslations } from "next-intl";
|
||||
import Image from "next/image";
|
||||
@ -10,6 +11,10 @@ import React, { useEffect, useRef, useState } from "react";
|
||||
|
||||
function Header() {
|
||||
const t = useTranslations("Header");
|
||||
const customLogo = getEnv("NEXT_PUBLIC_CustomLogo");
|
||||
const customTitle = getEnv("NEXT_PUBLIC_CustomTitle");
|
||||
const customDescription = getEnv("NEXT_PUBLIC_CustomDescription");
|
||||
|
||||
return (
|
||||
<div className="mx-auto w-full max-w-5xl">
|
||||
<section className="flex items-center justify-between">
|
||||
@ -20,17 +25,19 @@ function Header() {
|
||||
height={40}
|
||||
unoptimized
|
||||
alt="apple-touch-icon"
|
||||
src={"/apple-touch-icon.png"}
|
||||
className="relative !m-0 h-6 w-6 border-2 border-white object-cover object-top !p-0 transition duration-500 group-hover:z-30 group-hover:scale-105"
|
||||
src={customLogo ? customLogo : "/apple-touch-icon.png"}
|
||||
className="relative !m-0 border-2 border-transparent h-6 w-6 object-cover object-top !p-0"
|
||||
/>
|
||||
</div>
|
||||
NezhaDash
|
||||
{customTitle ? customTitle : "NezhaDash"}
|
||||
<Separator
|
||||
orientation="vertical"
|
||||
className="mx-2 hidden h-4 w-[1px] md:block"
|
||||
/>
|
||||
<p className="hidden text-sm font-medium opacity-40 md:block">
|
||||
{t("p_1079-1199_Simpleandbeautifuldashbo")}
|
||||
{customDescription
|
||||
? customDescription
|
||||
: t("p_1079-1199_Simpleandbeautifuldashbo")}
|
||||
</p>
|
||||
</section>
|
||||
<section className="flex items-center gap-2">
|
||||
|
@ -7,4 +7,7 @@ NEXT_PUBLIC_ShowFlag=true
|
||||
NEXT_PUBLIC_DisableCartoon=false
|
||||
NEXT_PUBLIC_ShowTag=true
|
||||
NEXT_PUBLIC_ShowNetTransfer=false
|
||||
NEXT_PUBLIC_ForceUseSvgFlag=false
|
||||
NEXT_PUBLIC_ForceUseSvgFlag=false
|
||||
NEXT_PUBLIC_CustomLogo=https://nezha-cf.buycoffee.top/apple-touch-icon.png
|
||||
NEXT_PUBLIC_CustomTitle=NezhaDash
|
||||
NEXT_PUBLIC_CustomDescription=NezhaDash is a dashboard for Nezha.
|
Loading…
Reference in New Issue
Block a user