mirror of
https://github.com/hamster1963/nezha-dash.git
synced 2025-04-24 21:10:45 +08:00
Compare commits
5 Commits
583a52cced
...
b21f4288a7
Author | SHA1 | Date | |
---|---|---|---|
|
b21f4288a7 | ||
|
6e6a3315b8 | ||
|
4de49cb3ab | ||
|
95530243a4 | ||
|
6f16d4b4eb |
@ -1,7 +1,7 @@
|
||||
"use client"
|
||||
|
||||
import NetworkChartLoading from "@/app/(main)/ClientComponents/NetworkChartLoading"
|
||||
import { NezhaAPIMonitor, ServerMonitorChart } from "@/app/types/nezha-api"
|
||||
import NetworkChartLoading from "@/components/loading/NetworkChartLoading"
|
||||
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card"
|
||||
import {
|
||||
ChartConfig,
|
@ -1,7 +1,7 @@
|
||||
"use client"
|
||||
|
||||
import { ServerDetailChartLoading } from "@/app/(main)/ClientComponents/ServerDetailLoading"
|
||||
import { NezhaAPISafe, ServerApi } from "@/app/types/nezha-api"
|
||||
import { ServerDetailChartLoading } from "@/components/loading/ServerDetailLoading"
|
||||
import AnimatedCircularProgressBar from "@/components/ui/animated-circular-progress-bar"
|
||||
import { Card, CardContent } from "@/components/ui/card"
|
||||
import { ChartConfig, ChartContainer } from "@/components/ui/chart"
|
@ -1,9 +1,9 @@
|
||||
"use client"
|
||||
|
||||
import { ServerDetailLoading } from "@/app/(main)/ClientComponents/ServerDetailLoading"
|
||||
import { NezhaAPISafe, ServerApi } from "@/app/types/nezha-api"
|
||||
import { BackIcon } from "@/components/Icon"
|
||||
import ServerFlag from "@/components/ServerFlag"
|
||||
import { ServerDetailLoading } from "@/components/loading/ServerDetailLoading"
|
||||
import { Badge } from "@/components/ui/badge"
|
||||
import { Card, CardContent } from "@/components/ui/card"
|
||||
import getEnv from "@/lib/env-entry"
|
@ -4,11 +4,11 @@ import { ServerApi } from "@/app/types/nezha-api"
|
||||
import { nezhaFetcher } from "@/lib/utils"
|
||||
import useSWRImmutable from "swr/immutable"
|
||||
|
||||
import { geoJsonString } from "../../../lib/geo-json-string"
|
||||
import GlobalLoading from "../../../../components/loading/GlobalLoading"
|
||||
import { geoJsonString } from "../../../../lib/geo-json-string"
|
||||
import { TooltipProvider } from "../detail/TooltipContext"
|
||||
import GlobalInfo from "./GlobalInfo"
|
||||
import GlobalLoading from "./GlobalLoading"
|
||||
import { InteractiveMap } from "./InteractiveMap"
|
||||
import { TooltipProvider } from "./TooltipContext"
|
||||
|
||||
export default function ServerGlobal() {
|
||||
const { data: nezhaServerList, error } = useSWRImmutable<ServerApi>("/api/server", nezhaFetcher)
|
@ -3,8 +3,8 @@
|
||||
import { countryCoordinates } from "@/lib/geo-limit"
|
||||
import { geoEquirectangular, geoPath } from "d3-geo"
|
||||
|
||||
import { useTooltip } from "../detail/TooltipContext"
|
||||
import MapTooltip from "./MapTooltip"
|
||||
import { useTooltip } from "./TooltipContext"
|
||||
|
||||
interface InteractiveMapProps {
|
||||
countries: string[]
|
@ -4,7 +4,7 @@ import { AnimatePresence, m } from "framer-motion"
|
||||
import { useTranslations } from "next-intl"
|
||||
import { memo } from "react"
|
||||
|
||||
import { useTooltip } from "./TooltipContext"
|
||||
import { useTooltip } from "../detail/TooltipContext"
|
||||
|
||||
const MapTooltip = memo(function MapTooltip() {
|
||||
const { tooltipData } = useTooltip()
|
@ -14,7 +14,7 @@ import dynamic from "next/dynamic"
|
||||
import { useEffect, useRef, useState } from "react"
|
||||
import useSWR from "swr"
|
||||
|
||||
import GlobalLoading from "./GlobalLoading"
|
||||
import GlobalLoading from "../../../../components/loading/GlobalLoading"
|
||||
|
||||
const ServerGlobal = dynamic(() => import("./Global"), {
|
||||
ssr: false,
|
@ -141,7 +141,7 @@ export default function ServerOverviewClient() {
|
||||
</div>
|
||||
{data?.result ? (
|
||||
<>
|
||||
<section className="flex items-start flex-row z-[999] pr-0 gap-1">
|
||||
<section className="flex items-start flex-row pr-0 gap-1">
|
||||
<p className="sm:text-[12px] text-[10px] text-blue-800 dark:text-blue-400 text-nowrap font-medium">
|
||||
↑{formatBytes(data?.total_out_bandwidth)}
|
||||
</p>
|
||||
@ -168,7 +168,7 @@ export default function ServerOverviewClient() {
|
||||
</section>
|
||||
{!disableCartoon && (
|
||||
<Image
|
||||
className="absolute right-3 top-[-85px] z-10 w-20 scale-90 group-hover:opacity-50 md:scale-100 transition-all"
|
||||
className="absolute right-3 top-[-85px] z-50 w-20 scale-90 group-hover:opacity-50 md:scale-100 transition-all"
|
||||
alt={"Hamster1963"}
|
||||
src={blogMan}
|
||||
priority
|
@ -1,11 +1,11 @@
|
||||
import ServerList from "@/components/ServerList"
|
||||
import ServerOverview from "@/components/ServerOverview"
|
||||
import ServerListClient from "./ClientComponents/main/ServerListClient"
|
||||
import ServerOverviewClient from "./ClientComponents/main/ServerOverviewClient"
|
||||
|
||||
export default async function Home() {
|
||||
return (
|
||||
<div className="mx-auto grid w-full max-w-5xl gap-4 md:gap-6">
|
||||
<ServerOverview />
|
||||
<ServerList />
|
||||
<ServerOverviewClient />
|
||||
<ServerListClient />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
@ -1,14 +1,14 @@
|
||||
"use client"
|
||||
|
||||
import { NetworkChartClient } from "@/app/(main)/ClientComponents/NetworkChart"
|
||||
import ServerDetailChartClient from "@/app/(main)/ClientComponents/ServerDetailChartClient"
|
||||
import ServerDetailClient from "@/app/(main)/ClientComponents/ServerDetailClient"
|
||||
import { NetworkChartClient } from "@/app/(main)/ClientComponents/detail/NetworkChart"
|
||||
import ServerDetailChartClient from "@/app/(main)/ClientComponents/detail/ServerDetailChartClient"
|
||||
import ServerDetailClient from "@/app/(main)/ClientComponents/detail/ServerDetailClient"
|
||||
import TabSwitch from "@/components/TabSwitch"
|
||||
import { Separator } from "@/components/ui/separator"
|
||||
import getEnv from "@/lib/env-entry"
|
||||
import { use, useState } from "react"
|
||||
|
||||
import ServerIPInfo from "../../ClientComponents/ServerIPInfo"
|
||||
import ServerIPInfo from "../../ClientComponents/detail/ServerIPInfo"
|
||||
|
||||
export default function Page(props: { params: Promise<{ id: string }> }) {
|
||||
const params = use(props.params)
|
||||
|
@ -10,7 +10,7 @@ export default function NotFoundPage() {
|
||||
<div className="flex min-h-screen w-full flex-col">
|
||||
<main className="flex min-h-[calc(100vh-calc(var(--spacing)*16))] flex-1 flex-col gap-4 bg-background p-4 md:p-10 md:pt-8">
|
||||
<Header />
|
||||
<section className="flex flex-col items-center min-h-44 justify-center gap-2">
|
||||
<section className="flex flex-col items-center flex-1 justify-center gap-2">
|
||||
<p className="text-sm font-semibold">{t("h1_490-590_404NotFound")}</p>
|
||||
<Link href="/" className="flex items-center gap-1">
|
||||
<p className="text-sm font-medium opacity-40">{t("h1_490-590_404NotFoundBack")}</p>
|
||||
|
@ -1,35 +0,0 @@
|
||||
import React from "react"
|
||||
|
||||
const BlurLayers = () => {
|
||||
const computeLayerStyle = (index: number) => {
|
||||
const blurAmount = index * 3.7037
|
||||
const maskStart = index * 10
|
||||
let maskEnd = maskStart + 20
|
||||
if (maskEnd > 100) {
|
||||
maskEnd = 100
|
||||
}
|
||||
return {
|
||||
backdropFilter: `blur-sm(${blurAmount}px)`,
|
||||
WebkitBackdropFilter: `blur-sm(${blurAmount}px)`,
|
||||
zIndex: index + 1,
|
||||
maskImage: `linear-gradient(rgba(0, 0, 0, 0) ${maskStart}%, rgb(0, 0, 0) ${maskEnd}%)`,
|
||||
}
|
||||
}
|
||||
|
||||
// 根据层数动态生成层
|
||||
const layers = Array.from({ length: 5 }).map((_, index) => (
|
||||
<div
|
||||
key={index}
|
||||
className={"absolute inset-0 h-full w-full"}
|
||||
style={computeLayerStyle(index)}
|
||||
/>
|
||||
))
|
||||
|
||||
return (
|
||||
<div className={"fixed bottom-0 left-0 right-0 z-50 h-[140px]"}>
|
||||
<div className={"relative h-full"}>{layers}</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export default BlurLayers
|
@ -1,5 +0,0 @@
|
||||
import ServerListClient from "@/app/(main)/ClientComponents/ServerListClient"
|
||||
|
||||
export default async function ServerList() {
|
||||
return <ServerListClient />
|
||||
}
|
@ -1,5 +0,0 @@
|
||||
import ServerOverviewClient from "@/app/(main)/ClientComponents/ServerOverviewClient"
|
||||
|
||||
export default async function ServerOverview() {
|
||||
return <ServerOverviewClient />
|
||||
}
|
14
package.json
14
package.json
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "nezha-dash",
|
||||
"version": "1.8.1",
|
||||
"version": "1.8.2",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "next dev -p 3040",
|
||||
@ -17,8 +17,8 @@
|
||||
"@heroicons/react": "^2.2.0",
|
||||
"@radix-ui/react-dialog": "^1.1.3",
|
||||
"@radix-ui/react-dropdown-menu": "^2.1.3",
|
||||
"@radix-ui/react-label": "^2.1.0",
|
||||
"@radix-ui/react-navigation-menu": "^1.2.1",
|
||||
"@radix-ui/react-label": "^2.1.1",
|
||||
"@radix-ui/react-navigation-menu": "^1.2.2",
|
||||
"@radix-ui/react-popover": "^1.1.3",
|
||||
"@radix-ui/react-progress": "^1.1.1",
|
||||
"@radix-ui/react-separator": "^1.1.1",
|
||||
@ -50,7 +50,7 @@
|
||||
"react": "^19.0.0",
|
||||
"react-device-detect": "^2.2.3",
|
||||
"react-dom": "^19.0.0",
|
||||
"react-intersection-observer": "^9.13.1",
|
||||
"react-intersection-observer": "^9.14.0",
|
||||
"react-wrap-balancer": "^1.1.1",
|
||||
"recharts": "^2.15.0",
|
||||
"sharp": "^0.33.5",
|
||||
@ -61,18 +61,18 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@next/bundle-analyzer": "^15.1.0",
|
||||
"@tailwindcss/postcss": "^4.0.0-beta.6",
|
||||
"@tailwindcss/postcss": "^4.0.0-beta.7",
|
||||
"@types/node": "^22.10.2",
|
||||
"@types/react": "^19.0.1",
|
||||
"@types/react-dom": "^19.0.2",
|
||||
"eslint": "^9.16.0",
|
||||
"eslint": "^9.17.0",
|
||||
"eslint-config-next": "^15.1.0",
|
||||
"eslint-plugin-turbo": "^2.3.3",
|
||||
"eslint-plugin-unused-imports": "^4.1.4",
|
||||
"postcss": "^8.4.49",
|
||||
"prettier": "^3.4.2",
|
||||
"prettier-plugin-tailwindcss": "^0.6.9",
|
||||
"tailwindcss": "^4.0.0-beta.6",
|
||||
"tailwindcss": "^4.0.0-beta.7",
|
||||
"typescript": "^5.7.2",
|
||||
"vercel": "^39.2.2"
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user