diff --git a/.env.example b/.env.example index 936b3bd..112204c 100644 --- a/.env.example +++ b/.env.example @@ -13,4 +13,5 @@ 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. NEXT_PUBLIC_DisableIndex=false -NEXT_PUBLIC_BASE_PATH=/dash +NEXT_PUBLIC_BASE_PATH=/ +NEXT_PUBLIC_ShowTagCount=false diff --git a/components/Switch.tsx b/components/Switch.tsx index 79d6cda..8728774 100644 --- a/components/Switch.tsx +++ b/components/Switch.tsx @@ -1,5 +1,6 @@ "use client"; +import getEnv from "@/lib/env-entry"; import { cn } from "@/lib/utils"; import { m } from "framer-motion"; import { useTranslations } from "next-intl"; @@ -88,11 +89,12 @@ export default function Switch({
{tag === "defaultTag" ? t("defaultTag") : tag}{" "} - {tag !== "defaultTag" && ( -
- {tagCountMap[tag]} -
- )} + {getEnv("NEXT_PUBLIC_ShowTagCount") === "true" && + tag !== "defaultTag" && ( +
+ {tagCountMap[tag]} +
+ )}
diff --git a/docker/.env.example b/docker/.env.example index a5e2bb9..244fd71 100644 --- a/docker/.env.example +++ b/docker/.env.example @@ -12,4 +12,5 @@ NEXT_PUBLIC_FixedTopServerName=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. -NEXT_PUBLIC_DisableIndex=false \ No newline at end of file +NEXT_PUBLIC_DisableIndex=false +NEXT_PUBLIC_ShowTagCount=false \ No newline at end of file diff --git a/next.config.mjs b/next.config.mjs index 00d39a8..5fedc77 100644 --- a/next.config.mjs +++ b/next.config.mjs @@ -3,7 +3,6 @@ import withBundleAnalyzer from "@next/bundle-analyzer"; import createNextIntlPlugin from "next-intl/plugin"; import { env } from "next-runtime-env"; - const bundleAnalyzer = withBundleAnalyzer({ enabled: process.env.ANALYZE === "true", }); @@ -24,7 +23,7 @@ const withPWA = withPWAInit({ /** @type {import('next').NextConfig} */ const nextConfig = { output: "standalone", - basePath: env("NEXT_PUBLIC_BASE_PATH") || "", + basePath: env("NEXT_PUBLIC_BASE_PATH") || "", logging: { fetches: { fullUrl: true,