mirror of
https://github.com/hamster1963/nezha-dash.git
synced 2025-04-24 21:10:45 +08:00
Merge branch 'main' into cloudflare
This commit is contained in:
commit
0170e16886
@ -8,3 +8,6 @@ NEXT_PUBLIC_DisableCartoon=false
|
||||
NEXT_PUBLIC_ShowTag=true
|
||||
NEXT_PUBLIC_ShowNetTransfer=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.
|
||||
|
27
README.md
27
README.md
@ -12,18 +12,21 @@
|
||||
|
||||
#### 环境变量
|
||||
|
||||
| 变量名 | 含义 | 示例 |
|
||||
| ------------------------------ | -------------------------------- | -------------------------------- |
|
||||
| NezhaBaseUrl | nezha 面板地址 | http://120.x.x.x:8008 |
|
||||
| NezhaAuth | nezha 面板 API Token | 5hAY3QX6Nl9B3Uxxxx26KMvOMyXS1Udi |
|
||||
| DefaultLocale | 面板默认显示语言(代码参考下表) | **默认**:en |
|
||||
| ForceShowAllServers | 是否强制显示所有服务器 | **默认**:false |
|
||||
| NEXT_PUBLIC_NezhaFetchInterval | 获取数据间隔(毫秒) | **默认**:2000 |
|
||||
| NEXT_PUBLIC_ShowFlag | 是否显示旗帜 | **默认**:false |
|
||||
| NEXT_PUBLIC_DisableCartoon | 是否禁用卡通人物 | **默认**:false |
|
||||
| NEXT_PUBLIC_ShowTag | 是否显示标签 | **默认**:false |
|
||||
| NEXT_PUBLIC_ShowNetTransfer | 是否显示流量信息 | **默认**:false |
|
||||
| NEXT_PUBLIC_ForceUseSvgFlag | 是否强制使用SVG旗帜 | **默认**:false |
|
||||
| 变量名 | 含义 | 示例 |
|
||||
| ------------------------------ | -------------------------------- | ------------------------------------------------------------- |
|
||||
| NezhaBaseUrl | nezha 面板地址 | http://120.x.x.x:8008 |
|
||||
| NezhaAuth | nezha 面板 API Token | 5hAY3QX6Nl9B3Uxxxx26KMvOMyXS1Udi |
|
||||
| DefaultLocale | 面板默认显示语言(代码参考下表) | **默认**:en |
|
||||
| ForceShowAllServers | 是否强制显示所有服务器 | **默认**:false |
|
||||
| NEXT_PUBLIC_NezhaFetchInterval | 获取数据间隔(毫秒) | **默认**:2000 |
|
||||
| NEXT_PUBLIC_ShowFlag | 是否显示旗帜 | **默认**:false |
|
||||
| NEXT_PUBLIC_DisableCartoon | 是否禁用卡通人物 | **默认**:false |
|
||||
| NEXT_PUBLIC_ShowTag | 是否显示标签 | **默认**:false |
|
||||
| NEXT_PUBLIC_ShowNetTransfer | 是否显示流量信息 | **默认**:false |
|
||||
| NEXT_PUBLIC_ForceUseSvgFlag | 是否强制使用SVG旗帜 | **默认**:false |
|
||||
| NEXT_PUBLIC_CustomLogo | 自定义Logo | **示例**:https://nezha-cf.buycoffee.top/apple-touch-icon.png |
|
||||
| NEXT_PUBLIC_CustomTitle | 自定义标题 | |
|
||||
| NEXT_PUBLIC_CustomDescription | 自定义描述(无多语言支持) | |
|
||||
|
||||
#### 多语言支持
|
||||
|
||||
|
@ -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">
|
||||
|
@ -8,3 +8,6 @@ NEXT_PUBLIC_DisableCartoon=false
|
||||
NEXT_PUBLIC_ShowTag=true
|
||||
NEXT_PUBLIC_ShowNetTransfer=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