mirror of
https://github.com/hamster1963/nezha-dash.git
synced 2025-04-24 21:10:45 +08:00
Compare commits
5 Commits
79ba408d9f
...
23a3261251
Author | SHA1 | Date | |
---|---|---|---|
|
23a3261251 | ||
|
a6aa91d35a | ||
|
e55a60c12e | ||
|
2164321e72 | ||
|
b5658d81ab |
@ -1,6 +1,8 @@
|
|||||||
|
"use client"
|
||||||
|
|
||||||
import pack from "@/package.json"
|
import pack from "@/package.json"
|
||||||
import { useTranslations } from "next-intl"
|
import { useTranslations } from "next-intl"
|
||||||
|
import { useEffect, useState } from "react"
|
||||||
const GITHUB_URL = "https://github.com/hamster1963/nezha-dash"
|
const GITHUB_URL = "https://github.com/hamster1963/nezha-dash"
|
||||||
const PERSONAL_URL = "https://buycoffee.top"
|
const PERSONAL_URL = "https://buycoffee.top"
|
||||||
|
|
||||||
@ -27,6 +29,11 @@ export default function Footer() {
|
|||||||
const t = useTranslations("Footer")
|
const t = useTranslations("Footer")
|
||||||
const version = pack.version
|
const version = pack.version
|
||||||
const currentYear = new Date().getFullYear()
|
const currentYear = new Date().getFullYear()
|
||||||
|
const [isMac, setIsMac] = useState(true)
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
setIsMac(/macintosh|mac os x/i.test(navigator.userAgent))
|
||||||
|
}, [])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<footer className="mx-auto w-full max-w-5xl flex items-center justify-between">
|
<footer className="mx-auto w-full max-w-5xl flex items-center justify-between">
|
||||||
@ -43,7 +50,7 @@ export default function Footer() {
|
|||||||
</section>
|
</section>
|
||||||
<p className={`mt-1 ${baseTextStyles}`}>
|
<p className={`mt-1 ${baseTextStyles}`}>
|
||||||
<kbd className="pointer-events-none mx-1 inline-flex h-4 select-none items-center gap-1 rounded border bg-muted px-1.5 font-mono text-[10px] font-medium text-muted-foreground opacity-100">
|
<kbd className="pointer-events-none mx-1 inline-flex h-4 select-none items-center gap-1 rounded border bg-muted px-1.5 font-mono text-[10px] font-medium text-muted-foreground opacity-100">
|
||||||
<span className="text-xs">⌘</span>K
|
{isMac ? <span className="text-xs">⌘</span> : "Ctrl "}K
|
||||||
</kbd>
|
</kbd>
|
||||||
</p>
|
</p>
|
||||||
</footer>
|
</footer>
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
import getEnv from "@/lib/env-entry"
|
import getEnv from "@/lib/env-entry"
|
||||||
import { cn } from "@/lib/utils"
|
import { cn } from "@/lib/utils"
|
||||||
import { useTranslations } from "next-intl"
|
import { useLocale, useTranslations } from "next-intl"
|
||||||
import { createRef, useEffect, useRef, useState } from "react"
|
import { createRef, useEffect, useRef, useState } from "react"
|
||||||
|
|
||||||
export default function Switch({
|
export default function Switch({
|
||||||
@ -19,6 +19,7 @@ export default function Switch({
|
|||||||
const scrollRef = useRef<HTMLDivElement>(null)
|
const scrollRef = useRef<HTMLDivElement>(null)
|
||||||
const tagRefs = useRef(allTag.map(() => createRef<HTMLDivElement>()))
|
const tagRefs = useRef(allTag.map(() => createRef<HTMLDivElement>()))
|
||||||
const t = useTranslations("ServerListClient")
|
const t = useTranslations("ServerListClient")
|
||||||
|
const locale = useLocale()
|
||||||
const [indicator, setIndicator] = useState<{ x: number; w: number }>({
|
const [indicator, setIndicator] = useState<{ x: number; w: number }>({
|
||||||
x: 0,
|
x: 0,
|
||||||
w: 0,
|
w: 0,
|
||||||
@ -58,7 +59,7 @@ export default function Switch({
|
|||||||
w: currentTagElement.offsetWidth,
|
w: currentTagElement.offsetWidth,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}, [nowTag])
|
}, [nowTag, locale])
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const currentTagElement = tagRefs.current[allTag.indexOf(nowTag)]?.current
|
const currentTagElement = tagRefs.current[allTag.indexOf(nowTag)]?.current
|
||||||
@ -75,7 +76,7 @@ export default function Switch({
|
|||||||
behavior: "smooth",
|
behavior: "smooth",
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}, [nowTag])
|
}, [nowTag, locale])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
"use client"
|
"use client"
|
||||||
|
|
||||||
import { cn } from "@/lib/utils"
|
import { cn } from "@/lib/utils"
|
||||||
import { useTranslations } from "next-intl"
|
import { useLocale, useTranslations } from "next-intl"
|
||||||
import { useEffect, useRef, useState } from "react"
|
import { useEffect, useRef, useState } from "react"
|
||||||
|
|
||||||
export default function TabSwitch({
|
export default function TabSwitch({
|
||||||
@ -19,6 +19,7 @@ export default function TabSwitch({
|
|||||||
w: 0,
|
w: 0,
|
||||||
})
|
})
|
||||||
const tabRefs = useRef<(HTMLDivElement | null)[]>([])
|
const tabRefs = useRef<(HTMLDivElement | null)[]>([])
|
||||||
|
const locale = useLocale()
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const currentTabElement = tabRefs.current[tabs.indexOf(currentTab)]
|
const currentTabElement = tabRefs.current[tabs.indexOf(currentTab)]
|
||||||
@ -32,7 +33,7 @@ export default function TabSwitch({
|
|||||||
w: currentTabElement.offsetWidth,
|
w: currentTabElement.offsetWidth,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}, [currentTab, tabs])
|
}, [currentTab, tabs, locale])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="z-50 flex flex-col items-start rounded-[50px]">
|
<div className="z-50 flex flex-col items-start rounded-[50px]">
|
||||||
|
14
package.json
14
package.json
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "nezha-dash",
|
"name": "nezha-dash",
|
||||||
"version": "2.7.0",
|
"version": "2.7.1",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "next dev -p 3040",
|
"dev": "next dev -p 3040",
|
||||||
@ -31,7 +31,7 @@
|
|||||||
"@types/d3-geo": "^3.1.0",
|
"@types/d3-geo": "^3.1.0",
|
||||||
"@types/luxon": "^3.4.2",
|
"@types/luxon": "^3.4.2",
|
||||||
"babel-plugin-react-compiler": "^19.0.0-beta-e552027-20250112",
|
"babel-plugin-react-compiler": "^19.0.0-beta-e552027-20250112",
|
||||||
"caniuse-lite": "^1.0.30001698",
|
"caniuse-lite": "^1.0.30001699",
|
||||||
"class-variance-authority": "^0.7.1",
|
"class-variance-authority": "^0.7.1",
|
||||||
"clsx": "^2.1.1",
|
"clsx": "^2.1.1",
|
||||||
"cmdk": "^1.0.4",
|
"cmdk": "^1.0.4",
|
||||||
@ -44,7 +44,7 @@
|
|||||||
"lucide-react": "^0.474.0",
|
"lucide-react": "^0.474.0",
|
||||||
"luxon": "^3.5.0",
|
"luxon": "^3.5.0",
|
||||||
"maxmind": "^4.3.24",
|
"maxmind": "^4.3.24",
|
||||||
"next": "^15.1.6",
|
"next": "^15.1.7",
|
||||||
"next-auth": "^5.0.0-beta.25",
|
"next-auth": "^5.0.0-beta.25",
|
||||||
"next-intl": "^3.26.3",
|
"next-intl": "^3.26.3",
|
||||||
"next-runtime-env": "^3.2.2",
|
"next-runtime-env": "^3.2.2",
|
||||||
@ -62,13 +62,13 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@biomejs/biome": "1.9.4",
|
"@biomejs/biome": "1.9.4",
|
||||||
"@next/bundle-analyzer": "^15.1.6",
|
"@next/bundle-analyzer": "^15.1.7",
|
||||||
"@tailwindcss/postcss": "^4.0.4",
|
"@tailwindcss/postcss": "^4.0.6",
|
||||||
"@types/node": "^22.13.1",
|
"@types/node": "^22.13.1",
|
||||||
"@types/react": "^19.0.8",
|
"@types/react": "^19.0.8",
|
||||||
"@types/react-dom": "^19.0.3",
|
"@types/react-dom": "^19.0.3",
|
||||||
"postcss": "^8.5.1",
|
"postcss": "^8.5.2",
|
||||||
"tailwindcss": "^4.0.4",
|
"tailwindcss": "^4.0.6",
|
||||||
"typescript": "^5.7.3",
|
"typescript": "^5.7.3",
|
||||||
"vercel": "^39.4.2"
|
"vercel": "^39.4.2"
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user