diff --git a/.github/workflows/Deploy.yml b/.github/workflows/Deploy.yml index 87187ba..118efc9 100644 --- a/.github/workflows/Deploy.yml +++ b/.github/workflows/Deploy.yml @@ -17,6 +17,8 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v4 + with: + fetch-depth: 0 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 @@ -48,21 +50,8 @@ jobs: push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} - - release: - runs-on: ubuntu-latest - needs: build-and-push - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Set node - uses: actions/setup-node@v4 - with: - registry-url: https://registry.npmjs.org/ - node-version: lts/* - - - run: npx changelogithub + + - name: Changelog + run: bun x changelogithub env: GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} diff --git a/app/layout.tsx b/app/layout.tsx index 8d6e950..2021515 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -1,5 +1,6 @@ // @auto-i18n-check. Please do not delete the line. import { MotionProvider } from "@/components/motion/motion-provider"; +import { ThemeColorManager } from "@/components/ThemeColorManager"; import getEnv from "@/lib/env-entry"; import { FilterProvider } from "@/lib/network-filter-context"; import { StatusProvider } from "@/lib/status-context"; @@ -81,7 +82,10 @@ export default async function LocaleLayout({ > - {children} + + + {children} + diff --git a/bun.lockb b/bun.lockb index e2a7cb8..912fe81 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/components/ThemeColorManager.tsx b/components/ThemeColorManager.tsx new file mode 100644 index 0000000..46b9148 --- /dev/null +++ b/components/ThemeColorManager.tsx @@ -0,0 +1,38 @@ +'use client'; + +import { useEffect } from 'react'; +import { useTheme } from 'next-themes'; + +export function ThemeColorManager() { + const { theme, systemTheme } = useTheme(); + + useEffect(() => { + const updateThemeColor = () => { + const currentTheme = theme === 'system' ? systemTheme : theme; + const meta = document.querySelector('meta[name="theme-color"]'); + + if (!meta) { + const newMeta = document.createElement('meta'); + newMeta.name = 'theme-color'; + document.head.appendChild(newMeta); + } + + const themeColor = currentTheme === 'dark' + ? 'hsl(30 15% 8%)' // 深色模式背景色 + : 'hsl(0 0% 98%)'; // 浅色模式背景色 + + document.querySelector('meta[name="theme-color"]')?.setAttribute('content', themeColor); + }; + + // Update on mount and theme change + updateThemeColor(); + + // Listen for system theme changes + const mediaQuery = window.matchMedia('(prefers-color-scheme: dark)'); + mediaQuery.addEventListener('change', updateThemeColor); + + return () => mediaQuery.removeEventListener('change', updateThemeColor); + }, [theme, systemTheme]); + + return null; +} diff --git a/package.json b/package.json index 9ea66a0..63477a4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "nezha-dash", - "version": "1.6.4", + "version": "1.6.5", "private": true, "scripts": { "dev": "next dev -p 3040", @@ -25,7 +25,7 @@ "@turf/turf": "^7.1.0", "@types/d3-geo": "^3.1.0", "@types/luxon": "^3.4.2", - "@typescript-eslint/eslint-plugin": "^8.16.0", + "@typescript-eslint/eslint-plugin": "^8.17.0", "caniuse-lite": "^1.0.30001685", "class-variance-authority": "^0.7.1", "clsx": "^2.1.1", @@ -47,12 +47,12 @@ "react-dom": "19.0.0-rc-02c0e824-20241028", "react-intersection-observer": "^9.13.1", "react-wrap-balancer": "^1.1.1", - "recharts": "^2.13.3", + "recharts": "^2.14.0", "sharp": "^0.33.5", "swr": "^2.2.6-beta.4", "tailwind-merge": "^2.5.5", "tailwindcss-animate": "^1.0.7", - "typescript-eslint": "^8.16.0" + "typescript-eslint": "^8.17.0" }, "devDependencies": { "@next/bundle-analyzer": "^15.0.3", diff --git a/public/manifest.json b/public/manifest.json index 7d0dadc..6f01c1f 100644 --- a/public/manifest.json +++ b/public/manifest.json @@ -14,8 +14,8 @@ "type": "image/png" } ], - "theme_color": "#000000", - "background_color": "#000000", + "theme_color": "hsl(0 0% 98%)", + "background_color": "hsl(0 0% 98%)", "start_url": "/", "display": "standalone", "orientation": "portrait"