Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pull] main from hamster1963:main #24

Merged
merged 5 commits into from
Dec 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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[]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand All @@ -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
Expand Down
8 changes: 4 additions & 4 deletions app/(main)/page.tsx
Original file line number Diff line number Diff line change
@@ -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>
)
}
8 changes: 4 additions & 4 deletions app/(main)/server/[id]/page.tsx
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
2 changes: 1 addition & 1 deletion app/not-found.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
Binary file modified bun.lockb
Binary file not shown.
35 changes: 0 additions & 35 deletions components/BlurLayer.tsx

This file was deleted.

5 changes: 0 additions & 5 deletions components/ServerList.tsx

This file was deleted.

5 changes: 0 additions & 5 deletions components/ServerOverview.tsx

This file was deleted.

14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nezha-dash",
"version": "1.8.1",
"version": "1.8.2",
"private": true,
"scripts": {
"dev": "next dev -p 3040",
Expand All @@ -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",
Expand Down Expand Up @@ -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",
Expand All @@ -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"
},
Expand Down
Loading