Merge branch 'main' into cloudflare-dev

This commit is contained in:
hamster1963 2024-10-24 21:48:38 +08:00
commit a105992323
6 changed files with 8 additions and 65 deletions

View File

@ -5,15 +5,13 @@ import ServerDetailChartClient from "@/app/(main)/ClientComponents/ServerDetailC
import ServerDetailClient from "@/app/(main)/ClientComponents/ServerDetailClient";
import TabSwitch from "@/components/TabSwitch";
import { Separator } from "@/components/ui/separator";
import { useTranslations } from "next-intl";
import { useState } from "react";
export const runtime = 'edge';
export default function Page({ params }: { params: { id: string } }) {
const t = useTranslations("TabSwitch");
const tabs = [t("Detail"), t("Network")];
const tabs = ["Detail", "Network"];
const [currentTab, setCurrentTab] = useState(tabs[0]);
return (
<div className="mx-auto grid w-full max-w-5xl gap-2">

View File

@ -7,7 +7,6 @@ import { Skeleton } from "@/components/ui/skeleton";
import getEnv from "@/lib/env-entry";
import { DateTime } from "luxon";
import { useTranslations } from "next-intl";
import { useLocale } from "next-intl";
import Image from "next/image";
import { useRouter } from "next/navigation";
import React, { useEffect, useRef, useState } from "react";

View File

@ -1,16 +1,9 @@
import ServerList from "@/components/ServerList";
import ServerOverview from "@/components/ServerOverview";
import { unstable_setRequestLocale } from "next-intl/server";
export const runtime = 'edge';
export default function Home({
params: { locale },
}: {
params: { locale: string };
}) {
unstable_setRequestLocale(locale);
export default function Home() {
return (
<div className="mx-auto grid w-full max-w-5xl gap-4 md:gap-6">
<ServerOverview />

View File

@ -2,7 +2,8 @@
import { cn } from "@/lib/utils";
import { motion } from "framer-motion";
import React, { useState } from "react";
import { useTranslations } from "next-intl";
import React from "react";
export default function TabSwitch({
tabs,
@ -13,6 +14,7 @@ export default function TabSwitch({
currentTab: string;
setCurrentTab: (tab: string) => void;
}) {
const t = useTranslations("TabSwitch");
return (
<div className="z-50 flex flex-col items-start rounded-[50px]">
<div className="flex items-center gap-1 rounded-[50px] bg-stone-100 p-[3px] dark:bg-stone-800">
@ -38,7 +40,7 @@ export default function TabSwitch({
/>
)}
<div className="relative z-20 flex items-center gap-1">
<p className="whitespace-nowrap">{tab}</p>
<p className="whitespace-nowrap">{t(tab)}</p>
</div>
</div>
))}

View File

@ -1,49 +0,0 @@
"use client"
import Footer from "@/app/[locale]/(main)/footer";
import Header from "@/app/[locale]/(main)/header";
import { getCsrfToken } from "next-auth/react"
import { useEffect, useState } from "react";
export function SignIn() {
const [csrfToken, setCsrfToken] = useState("")
useEffect(() => {
async function loadProviders() {
const csrf = await getCsrfToken()
setCsrfToken(csrf)
}
loadProviders()
}, [])
return (
<div className="flex min-h-screen w-full flex-col">
<main className="flex min-h-[calc(100vh_-_theme(spacing.16))] flex-1 flex-col gap-4 bg-muted/40 p-4 md:p-10 md:pt-8">
<Header />
<form
className="flex flex-col items-center justify-start gap-4 p-4 "
method="post"
action="/api/auth/callback/credentials"
>
<input type="hidden" name="csrfToken" value={csrfToken} />
<section className="flex flex-col items-start gap-2">
<label className="flex flex-col items-start gap-1 ">
<p className="text-base font-semibold"></p>
<input
className="px-1 border-[1px] rounded-[5px]"
name="password"
type="password"
/>
</label>
<button className=" px-1.5 py-0.5 w-fit text-sm font-semibold rounded-[8px] border bg-card hover:brightness-95 transition-all text-card-foreground shadow-lg shadow-neutral-200/40 dark:shadow-none">
</button>
</section>
</form>
<Footer />
</main>
</div>
);
}

View File

@ -1,6 +1,6 @@
{
"name": "nezha-dash",
"version": "0.8.0",
"version": "1.0.0",
"private": true,
"scripts": {
"dev": "next dev -p 3020",