mirror of
https://github.com/DeveloLongScript/MHSF.git
synced 2026-05-08 00:25:00 -05:00
beauty: cleaning up lots of code, cleaning up changelog
This commit is contained in:
parent
88fac002fd
commit
3b869b2e8c
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"$schema": "https://ui.shadcn.com/schema.json",
|
"$schema": "https://ui.shadcn.com/schema.json",
|
||||||
"style": "default",
|
"style": "new-york",
|
||||||
"rsc": true,
|
"rsc": true,
|
||||||
"tsx": true,
|
"tsx": true,
|
||||||
"tailwind": {
|
"tailwind": {
|
||||||
|
|||||||
@ -1,6 +0,0 @@
|
|||||||
module.exports = {
|
|
||||||
enable: true,
|
|
||||||
mode: "simplify-seedable", // random | simplify | simplify-seedable
|
|
||||||
refreshClassConversionJson: false, // recommended set to true if not in production
|
|
||||||
allowExtensions: [".jsx", ".tsx", ".js", ".ts", ".html", ".rsc"],
|
|
||||||
};
|
|
||||||
@ -1,4 +1,5 @@
|
|||||||
import plugin from "@unocss/webpack";
|
import MangleCssClassPlugin from "mangle-css-class-webpack-plugin";
|
||||||
|
|
||||||
/** @type {import('next').NextConfig} */
|
/** @type {import('next').NextConfig} */
|
||||||
const nextConfig = {
|
const nextConfig = {
|
||||||
images: {
|
images: {
|
||||||
@ -9,6 +10,36 @@ const nextConfig = {
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
webpack: (config, { dev }) => {
|
||||||
|
config.resolve.modules.push(path.resolve("./"));
|
||||||
|
|
||||||
|
if (!dev) {
|
||||||
|
config.plugins.push(
|
||||||
|
new MangleCssClassPlugin({
|
||||||
|
classNameRegExp:
|
||||||
|
"(([a-zA-Z-:]*)[\\\\\\\\]*:)*([\\\\\\\\]*!)?tw-[a-zA-Z-]([a-zA-Z0-9-]*([\\\\\\\\]*(\\%|\\#|\\.|\\[|\\]))*)*",
|
||||||
|
// ignorePrefixRegExp: "((hover|focus|active|disabled|visited|first|last|odd|even|group-hover|focus-within|xs|sm|md||lg|xl)(\\\\\\\\\\\\\\\\|\\\\)?:)*",
|
||||||
|
|
||||||
|
classGenerator: (original, opts, context) => {
|
||||||
|
if (classNames[original]) {
|
||||||
|
return classNames[original];
|
||||||
|
}
|
||||||
|
|
||||||
|
let nextId;
|
||||||
|
|
||||||
|
do {
|
||||||
|
// Class name cannot start with a number.
|
||||||
|
nextId = `cfk-${Math.random()}`;
|
||||||
|
} while (/^[0-9_-]/.test(nextId));
|
||||||
|
|
||||||
|
return (classNames[original] = nextId);
|
||||||
|
},
|
||||||
|
// log: true
|
||||||
|
})
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return config;
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export default nextConfig;
|
export default nextConfig;
|
||||||
|
|||||||
@ -90,6 +90,7 @@
|
|||||||
"eslint": "^8",
|
"eslint": "^8",
|
||||||
"eslint-config-next": "14.2.3",
|
"eslint-config-next": "14.2.3",
|
||||||
"jotai": "^2.9.1",
|
"jotai": "^2.9.1",
|
||||||
|
"mangle-css-class-webpack-plugin": "^5.1.0",
|
||||||
"postcss": "^8",
|
"postcss": "^8",
|
||||||
"tailwindcss": "^3.4.1",
|
"tailwindcss": "^3.4.1",
|
||||||
"typescript": "^5"
|
"typescript": "^5"
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import { OnlineServer, ServerResponse } from "./lib/types/server";
|
import { OnlineServer, ServerResponse } from "./lib/types/mh-server";
|
||||||
|
|
||||||
const serverCache: any = {};
|
const serverCache: any = {};
|
||||||
|
|
||||||
|
|||||||
@ -1,16 +1,4 @@
|
|||||||
import { banner } from "@/banner";
|
|
||||||
import TopBar from "@/components/clerk/Topbar";
|
|
||||||
import FavoritesView from "@/components/FavoritesView";
|
import FavoritesView from "@/components/FavoritesView";
|
||||||
import {
|
|
||||||
Breadcrumb,
|
|
||||||
BreadcrumbItem,
|
|
||||||
BreadcrumbLink,
|
|
||||||
BreadcrumbList,
|
|
||||||
BreadcrumbPage,
|
|
||||||
BreadcrumbSeparator,
|
|
||||||
} from "@/components/ui/breadcrumb";
|
|
||||||
import { Server } from "lucide-react";
|
|
||||||
import Link from "next/link";
|
|
||||||
|
|
||||||
export default function Favorites() {
|
export default function Favorites() {
|
||||||
return (
|
return (
|
||||||
|
|||||||
@ -1,15 +1,6 @@
|
|||||||
"use client";
|
"use client";
|
||||||
import { ShowInfo } from "@/components/misc/InfoClaim";
|
|
||||||
import { TextCopyComp } from "@/components/misc/TextCopyComp";
|
|
||||||
import { Button } from "@/components/ui/button";
|
import { Button } from "@/components/ui/button";
|
||||||
import {
|
|
||||||
InputOTP,
|
|
||||||
InputOTPGroup,
|
|
||||||
InputOTPSeparator,
|
|
||||||
InputOTPSlot,
|
|
||||||
} from "@/components/ui/input-otp";
|
|
||||||
import { useClerk, useUser } from "@clerk/nextjs";
|
import { useClerk, useUser } from "@clerk/nextjs";
|
||||||
import { default as NextLink } from "next/link";
|
|
||||||
import { ExternalLink, KeyRound, Link, UserPen } from "lucide-react";
|
import { ExternalLink, KeyRound, Link, UserPen } from "lucide-react";
|
||||||
import {
|
import {
|
||||||
ResizableHandle,
|
ResizableHandle,
|
||||||
@ -19,7 +10,6 @@ import {
|
|||||||
import toast from "react-hot-toast";
|
import toast from "react-hot-toast";
|
||||||
import { unlinkMCAccount } from "@/lib/api";
|
import { unlinkMCAccount } from "@/lib/api";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { link } from "fs";
|
|
||||||
import { Dialog } from "@/components/ui/dialog";
|
import { Dialog } from "@/components/ui/dialog";
|
||||||
import { DialogContent, DialogTrigger } from "@/components/ui/dialog";
|
import { DialogContent, DialogTrigger } from "@/components/ui/dialog";
|
||||||
import CodeDialog from "@/components/misc/LinkDialog";
|
import CodeDialog from "@/components/misc/LinkDialog";
|
||||||
|
|||||||
@ -1,37 +1,24 @@
|
|||||||
import type { Metadata } from "next";
|
|
||||||
import { GeistSans } from "geist/font/sans";
|
import { GeistSans } from "geist/font/sans";
|
||||||
import { Github, CodeXml, Server, Command } from "lucide-react";
|
import { Server } from "lucide-react";
|
||||||
import { SpeedInsights } from "@vercel/speed-insights/next";
|
import { SpeedInsights } from "@vercel/speed-insights/next";
|
||||||
import { Analytics } from "@vercel/analytics/react";
|
import { Analytics } from "@vercel/analytics/react";
|
||||||
import "./globals.css";
|
import "./globals.css";
|
||||||
import { Toaster } from "react-hot-toast";
|
import { Toaster } from "react-hot-toast";
|
||||||
import { headers } from "next/headers";
|
|
||||||
|
|
||||||
import { Button } from "@/components/ui/button";
|
|
||||||
import { TooltipProvider } from "@/components/ui/tooltip";
|
import { TooltipProvider } from "@/components/ui/tooltip";
|
||||||
import { ThemeProvider } from "@/components/ThemeProvider";
|
import { ThemeProvider } from "@/components/ThemeProvider";
|
||||||
import Image from "next/image";
|
|
||||||
import { ClerkThemeProvider } from "@/components/clerk/ClerkThemeProvider";
|
import { ClerkThemeProvider } from "@/components/clerk/ClerkThemeProvider";
|
||||||
import { useEffectOnce } from "@/lib/useEffectOnce";
|
|
||||||
import NextTopLoader from "@/lib/top-loader";
|
import NextTopLoader from "@/lib/top-loader";
|
||||||
import { banner } from "@/banner";
|
import { banner } from "@/banner";
|
||||||
import {
|
import {
|
||||||
Breadcrumb,
|
Breadcrumb,
|
||||||
BreadcrumbItem,
|
|
||||||
BreadcrumbList,
|
BreadcrumbList,
|
||||||
BreadcrumbPage,
|
BreadcrumbPage,
|
||||||
BreadcrumbSeparator,
|
|
||||||
} from "@/components/ui/breadcrumb";
|
} from "@/components/ui/breadcrumb";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import TopBar from "@/components/clerk/Topbar";
|
import TopBar from "@/components/clerk/Topbar";
|
||||||
import TextFromPathname from "@/components/TextFromPathname";
|
import TextFromPathname from "@/components/TextFromPathname";
|
||||||
import { Inter as interFont } from "next/font/google";
|
import { Inter as interFont } from "next/font/google";
|
||||||
import {
|
import { CommandBarer } from "@/components/CommandBar";
|
||||||
CommandBar,
|
|
||||||
CommandBarer,
|
|
||||||
SearchCommandBar,
|
|
||||||
SubLinkCommandBar,
|
|
||||||
} from "@/components/CommandBar";
|
|
||||||
|
|
||||||
const inter = interFont({ variable: "--font-inter", subsets: ["latin"] });
|
const inter = interFont({ variable: "--font-inter", subsets: ["latin"] });
|
||||||
export default async function RootLayout({
|
export default async function RootLayout({
|
||||||
|
|||||||
@ -1,34 +1,10 @@
|
|||||||
import Image from "next/image";
|
|
||||||
import { GeistSans } from "geist/font/sans";
|
|
||||||
import ServerList from "@/components/ServerList";
|
import ServerList from "@/components/ServerList";
|
||||||
import { Button } from "@/components/ui/button";
|
import { Metadata } from "next";
|
||||||
import { ModeToggle as ThemeSwitcher } from "@/components/ThemeSwitcher";
|
|
||||||
import {
|
export const metadata: Metadata = {
|
||||||
SignInButton,
|
title: "the MHSF project by dvelo",
|
||||||
SignedIn,
|
description: `currently running in ${process.env.NEXT_PUBLIC_VERCEL_ENV} | commit (${process.env.NEXT_PUBLIC_VERCEL_GIT_COMMIT_SHA}) ${process.env.NEXT_PUBLIC_VERCEL_GIT_COMMIT_MESSAGE} by ${process.env.NEXT_PUBLIC_VERCEL_GIT_COMMIT_AUTHOR_NAME}`,
|
||||||
SignedOut,
|
};
|
||||||
UserProfile,
|
|
||||||
useUser,
|
|
||||||
useClerk,
|
|
||||||
} from "@clerk/nextjs";
|
|
||||||
import {
|
|
||||||
Popover,
|
|
||||||
PopoverContent,
|
|
||||||
PopoverTrigger,
|
|
||||||
} from "@/components/ui/popover";
|
|
||||||
import {
|
|
||||||
Breadcrumb,
|
|
||||||
BreadcrumbItem,
|
|
||||||
BreadcrumbLink,
|
|
||||||
BreadcrumbList,
|
|
||||||
BreadcrumbPage,
|
|
||||||
BreadcrumbSeparator,
|
|
||||||
} from "@/components/ui/breadcrumb";
|
|
||||||
import { X, UserCog, Server } from "lucide-react";
|
|
||||||
import TopBar from "@/components/clerk/Topbar";
|
|
||||||
import { banner } from "@/banner";
|
|
||||||
import { ResolvingMetadata, Metadata } from "next";
|
|
||||||
import Link from "next/link";
|
|
||||||
|
|
||||||
export default function Home() {
|
export default function Home() {
|
||||||
return (
|
return (
|
||||||
|
|||||||
@ -1,26 +1,4 @@
|
|||||||
import ServerView from "@/components/ServerView";
|
|
||||||
import {
|
|
||||||
Breadcrumb,
|
|
||||||
BreadcrumbItem,
|
|
||||||
BreadcrumbLink,
|
|
||||||
BreadcrumbList,
|
|
||||||
BreadcrumbPage,
|
|
||||||
BreadcrumbSeparator,
|
|
||||||
} from "@/components/ui/breadcrumb";
|
|
||||||
import TopBar from "@/components/clerk/Topbar";
|
|
||||||
import { CornerDownLeft, Server, X } from "lucide-react";
|
|
||||||
import type { Metadata, ResolvingMetadata } from "next";
|
import type { Metadata, ResolvingMetadata } from "next";
|
||||||
import { IconDisplayClient } from "@/components/IconDisplay";
|
|
||||||
import { banner } from "@/banner";
|
|
||||||
import Link from "next/link";
|
|
||||||
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
|
|
||||||
import TabServer from "@/components/misc/TabServer";
|
|
||||||
import { Button } from "@/components/ui/button";
|
|
||||||
import { Label } from "@/components/ui/label";
|
|
||||||
import { Textarea } from "@/components/ui/textarea";
|
|
||||||
import { Tooltip } from "@/components/ui/tooltip";
|
|
||||||
import ServerCustomize from "@/components/ServerCustomize";
|
|
||||||
import { useColor } from "@/lib/use-color";
|
|
||||||
import CustomizeRoot from "@/components/CustomizeRoot";
|
import CustomizeRoot from "@/components/CustomizeRoot";
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
|
|||||||
@ -1,21 +1,6 @@
|
|||||||
import ServerView from "@/components/ServerView";
|
import ServerView from "@/components/ServerView";
|
||||||
import {
|
|
||||||
Breadcrumb,
|
|
||||||
BreadcrumbItem,
|
|
||||||
BreadcrumbLink,
|
|
||||||
BreadcrumbList,
|
|
||||||
BreadcrumbPage,
|
|
||||||
BreadcrumbSeparator,
|
|
||||||
} from "@/components/ui/breadcrumb";
|
|
||||||
import TopBar from "@/components/clerk/Topbar";
|
|
||||||
import { Server } from "lucide-react";
|
|
||||||
import type { Metadata, ResolvingMetadata } from "next";
|
import type { Metadata, ResolvingMetadata } from "next";
|
||||||
import { IconDisplayClient } from "@/components/IconDisplay";
|
|
||||||
import { banner } from "@/banner";
|
|
||||||
import Link from "next/link";
|
|
||||||
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
|
|
||||||
import TabServer from "@/components/misc/TabServer";
|
import TabServer from "@/components/misc/TabServer";
|
||||||
import { useColor } from "@/lib/use-color";
|
|
||||||
import ColorProvider from "@/components/ColorProvider";
|
import ColorProvider from "@/components/ColorProvider";
|
||||||
import AfterServerView from "@/components/AfterServerView";
|
import AfterServerView from "@/components/AfterServerView";
|
||||||
import Banner from "@/components/Banner";
|
import Banner from "@/components/Banner";
|
||||||
|
|||||||
@ -1,21 +1,7 @@
|
|||||||
import ServerView from "@/components/ServerView";
|
import ServerView from "@/components/ServerView";
|
||||||
import {
|
|
||||||
Breadcrumb,
|
|
||||||
BreadcrumbItem,
|
|
||||||
BreadcrumbLink,
|
|
||||||
BreadcrumbList,
|
|
||||||
BreadcrumbPage,
|
|
||||||
BreadcrumbSeparator,
|
|
||||||
} from "@/components/ui/breadcrumb";
|
|
||||||
import TopBar from "@/components/clerk/Topbar";
|
|
||||||
import { Server } from "lucide-react";
|
|
||||||
import type { Metadata, ResolvingMetadata } from "next";
|
import type { Metadata, ResolvingMetadata } from "next";
|
||||||
import { IconDisplayClient } from "@/components/IconDisplay";
|
|
||||||
import { banner } from "@/banner";
|
|
||||||
import Link from "next/link";
|
|
||||||
import TabServer from "@/components/misc/TabServer";
|
import TabServer from "@/components/misc/TabServer";
|
||||||
import { NewChart } from "@/components/NewChart";
|
import { NewChart } from "@/components/NewChart";
|
||||||
import { useColor } from "@/lib/use-color";
|
|
||||||
import ColorProvider from "@/components/ColorProvider";
|
import ColorProvider from "@/components/ColorProvider";
|
||||||
import Banner from "@/components/Banner";
|
import Banner from "@/components/Banner";
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,5 @@
|
|||||||
"use client";
|
"use client";
|
||||||
import {
|
import {
|
||||||
Command,
|
|
||||||
CommandDialog,
|
CommandDialog,
|
||||||
CommandEmpty,
|
CommandEmpty,
|
||||||
CommandGroup,
|
CommandGroup,
|
||||||
@ -11,11 +10,10 @@ import {
|
|||||||
CommandShortcut,
|
CommandShortcut,
|
||||||
} from "@/components/ui/command";
|
} from "@/components/ui/command";
|
||||||
import { TagShower } from "./ServerList";
|
import { TagShower } from "./ServerList";
|
||||||
import { useEffect, useState } from "react";
|
import { useState } from "react";
|
||||||
import { OnlineServer } from "@/lib/types/server";
|
import { OnlineServer } from "@/lib/types/mh-server";
|
||||||
import events from "@/lib/commandEvent";
|
import events from "@/lib/commandEvent";
|
||||||
import { useHotkeys } from "react-hotkeys-hook";
|
import { useHotkeys } from "react-hotkeys-hook";
|
||||||
import Link from "next/link";
|
|
||||||
import {
|
import {
|
||||||
ArrowDown01,
|
ArrowDown01,
|
||||||
ArrowLeft,
|
ArrowLeft,
|
||||||
@ -27,14 +25,16 @@ import {
|
|||||||
} from "lucide-react";
|
} from "lucide-react";
|
||||||
import { useEffectOnce } from "@/lib/useEffectOnce";
|
import { useEffectOnce } from "@/lib/useEffectOnce";
|
||||||
import { useClerk, useUser } from "@clerk/nextjs";
|
import { useClerk, useUser } from "@clerk/nextjs";
|
||||||
import { useRouter } from '@/lib/useRouter'
|
import { useRouter } from "@/lib/useRouter";
|
||||||
|
import type { SVGProps } from "react";
|
||||||
|
import { getAccountFavorites } from "@/lib/api";
|
||||||
|
|
||||||
export function SearchCommandBar() {
|
export function SearchCommandBar() {
|
||||||
const [serverList, setServerList] = useState<OnlineServer[]>([]);
|
const [serverList, setServerList] = useState<OnlineServer[]>([]);
|
||||||
const [open, setOpen] = useState(false);
|
const [open, setOpen] = useState(false);
|
||||||
const [backEnabled, setBackEnabled] = useState(false);
|
const [backEnabled, setBackEnabled] = useState(false);
|
||||||
const [searchRes, setSearchRes] = useState<any>(undefined);
|
const [searchRes, setSearchRes] = useState<any>(undefined);
|
||||||
const router = useRouter()
|
const router = useRouter();
|
||||||
useHotkeys("mod+shift+k", () => setOpen(true), []);
|
useHotkeys("mod+shift+k", () => setOpen(true), []);
|
||||||
|
|
||||||
useEffectOnce(() => {
|
useEffectOnce(() => {
|
||||||
@ -252,9 +252,6 @@ export function SubLinkCommandBar() {
|
|||||||
</CommandDialog>
|
</CommandDialog>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
import * as React from "react";
|
|
||||||
import type { SVGProps } from "react";
|
|
||||||
import { getAccountFavorites } from "@/lib/api";
|
|
||||||
const Github = (props: SVGProps<SVGSVGElement>) => (
|
const Github = (props: SVGProps<SVGSVGElement>) => (
|
||||||
<svg
|
<svg
|
||||||
viewBox="0 0 256 250"
|
viewBox="0 0 256 250"
|
||||||
@ -274,7 +271,7 @@ export function FavoriteBar() {
|
|||||||
undefined
|
undefined
|
||||||
);
|
);
|
||||||
const clerk = useClerk();
|
const clerk = useClerk();
|
||||||
const router = useRouter()
|
const router = useRouter();
|
||||||
|
|
||||||
useEffectOnce(() => {
|
useEffectOnce(() => {
|
||||||
events.on("cmd-event-favorites", () => setOpen(true));
|
events.on("cmd-event-favorites", () => setOpen(true));
|
||||||
|
|||||||
@ -1,20 +1,20 @@
|
|||||||
"use client";
|
"use client";
|
||||||
import { useEffect, useState } from "react";
|
import { useState } from "react";
|
||||||
import { Spinner } from "./ui/spinner";
|
import { Spinner } from "./ui/spinner";
|
||||||
import { Card, CardHeader, CardTitle } from "./ui/card";
|
import { Card, CardHeader, CardTitle } from "./ui/card";
|
||||||
import { ServerResponse } from "@/lib/types/server";
|
import { ServerResponse } from "@/lib/types/mh-server";
|
||||||
import { useEffectOnce } from "@/lib/useEffectOnce";
|
import { useEffectOnce } from "@/lib/useEffectOnce";
|
||||||
import { Button } from "./ui/button";
|
import { Button } from "./ui/button";
|
||||||
import { Copy, Layers, XIcon } from "lucide-react";
|
import { Copy, Layers, XIcon } from "lucide-react";
|
||||||
import toast from "react-hot-toast";
|
import toast from "react-hot-toast";
|
||||||
import { Tooltip, TooltipContent, TooltipTrigger } from "./ui/tooltip";
|
import { Tooltip, TooltipContent, TooltipTrigger } from "./ui/tooltip";
|
||||||
import { getAccountFavorites } from "@/lib/api";
|
import { getAccountFavorites } from "@/lib/api";
|
||||||
import { useRouter } from '@/lib/useRouter'
|
import { useRouter } from "@/lib/useRouter";
|
||||||
|
|
||||||
export default function FavoritesView() {
|
export default function FavoritesView() {
|
||||||
const [apiFavorites, setApiFavorites] = useState<any>([]);
|
const [apiFavorites, setApiFavorites] = useState<any>([]);
|
||||||
const [loading, setLoading] = useState(true);
|
const [loading, setLoading] = useState(true);
|
||||||
const router = useRouter()
|
const router = useRouter();
|
||||||
|
|
||||||
useEffectOnce(() => {
|
useEffectOnce(() => {
|
||||||
getAccountFavorites().then((d) => {
|
getAccountFavorites().then((d) => {
|
||||||
|
|||||||
@ -17,7 +17,7 @@ import {
|
|||||||
ChartTooltipContent,
|
ChartTooltipContent,
|
||||||
} from "@/components/ui/chart";
|
} from "@/components/ui/chart";
|
||||||
import { useEffectOnce } from "@/lib/useEffectOnce";
|
import { useEffectOnce } from "@/lib/useEffectOnce";
|
||||||
import { ServerResponse } from "@/lib/types/server";
|
import { ServerResponse } from "@/lib/types/mh-server";
|
||||||
import { getCommunityServerFavorites, getShortTermData } from "@/lib/api";
|
import { getCommunityServerFavorites, getShortTermData } from "@/lib/api";
|
||||||
|
|
||||||
const chartConfig = {
|
const chartConfig = {
|
||||||
|
|||||||
@ -15,25 +15,16 @@ import {
|
|||||||
} from "./ui/card";
|
} from "./ui/card";
|
||||||
import IconDisplay from "./IconDisplay";
|
import IconDisplay from "./IconDisplay";
|
||||||
import { TagShower } from "./ServerList";
|
import { TagShower } from "./ServerList";
|
||||||
import {
|
import { Copy, EllipsisVertical, Layers } from "lucide-react";
|
||||||
Copy,
|
|
||||||
EllipsisVertical,
|
|
||||||
Layers,
|
|
||||||
MoveRight,
|
|
||||||
Router,
|
|
||||||
} from "lucide-react";
|
|
||||||
import { Button } from "./ui/button";
|
import { Button } from "./ui/button";
|
||||||
import {
|
import {
|
||||||
Drawer,
|
Drawer,
|
||||||
DrawerClose,
|
|
||||||
DrawerContent,
|
DrawerContent,
|
||||||
DrawerDescription,
|
|
||||||
DrawerFooter,
|
DrawerFooter,
|
||||||
DrawerHeader,
|
DrawerHeader,
|
||||||
DrawerTitle,
|
DrawerTitle,
|
||||||
DrawerTrigger,
|
DrawerTrigger,
|
||||||
} from "@/components/ui/drawer";
|
} from "@/components/ui/drawer";
|
||||||
import { useEffect, useState } from "react";
|
|
||||||
import { Tooltip } from "@radix-ui/react-tooltip";
|
import { Tooltip } from "@radix-ui/react-tooltip";
|
||||||
import { TooltipContent, TooltipTrigger } from "./ui/tooltip";
|
import { TooltipContent, TooltipTrigger } from "./ui/tooltip";
|
||||||
import { useRouter } from "@/lib/useRouter";
|
import { useRouter } from "@/lib/useRouter";
|
||||||
|
|||||||
@ -1,8 +1,7 @@
|
|||||||
"use client";
|
"use client";
|
||||||
import { Label } from "./ui/label";
|
|
||||||
import { Button } from "./ui/button";
|
import { Button } from "./ui/button";
|
||||||
import { Textarea } from "./ui/textarea";
|
import { Textarea } from "./ui/textarea";
|
||||||
import { CheckIcon, CornerDownLeft, X } from "lucide-react";
|
import { CheckIcon, X } from "lucide-react";
|
||||||
import { Dispatch, SetStateAction, useEffect, useState } from "react";
|
import { Dispatch, SetStateAction, useEffect, useState } from "react";
|
||||||
import {
|
import {
|
||||||
getCustomization,
|
getCustomization,
|
||||||
@ -14,9 +13,8 @@ import {
|
|||||||
} from "@/lib/api";
|
} from "@/lib/api";
|
||||||
import toast from "react-hot-toast";
|
import toast from "react-hot-toast";
|
||||||
import { SignedIn, SignedOut, useUser } from "@clerk/nextjs";
|
import { SignedIn, SignedOut, useUser } from "@clerk/nextjs";
|
||||||
import { OnlineServer } from "@/lib/types/server";
|
import { OnlineServer } from "@/lib/types/mh-server";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import { useEffectOnce } from "@/lib/useEffectOnce";
|
|
||||||
import Setting from "./ui/setting";
|
import Setting from "./ui/setting";
|
||||||
import {
|
import {
|
||||||
FormControl,
|
FormControl,
|
||||||
@ -30,7 +28,6 @@ import {
|
|||||||
import { z } from "zod";
|
import { z } from "zod";
|
||||||
import { useForm } from "react-hook-form";
|
import { useForm } from "react-hook-form";
|
||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { zodResolver } from "@hookform/resolvers/zod";
|
||||||
import { Input } from "./ui/input";
|
|
||||||
import "@/themes.css";
|
import "@/themes.css";
|
||||||
import {
|
import {
|
||||||
Card,
|
Card,
|
||||||
@ -43,7 +40,6 @@ import {
|
|||||||
import { Popover, PopoverContent, PopoverTrigger } from "./ui/popover";
|
import { Popover, PopoverContent, PopoverTrigger } from "./ui/popover";
|
||||||
import { themes } from "@/lib/themes";
|
import { themes } from "@/lib/themes";
|
||||||
import { useTheme } from "next-themes";
|
import { useTheme } from "next-themes";
|
||||||
import { useColor } from "@/lib/use-color";
|
|
||||||
import { DiscordPopover } from "./misc/DiscordPopover";
|
import { DiscordPopover } from "./misc/DiscordPopover";
|
||||||
import { Spinner } from "./ui/spinner";
|
import { Spinner } from "./ui/spinner";
|
||||||
import { BannerPopover } from "./misc/BannerPopover";
|
import { BannerPopover } from "./misc/BannerPopover";
|
||||||
|
|||||||
@ -1,27 +1,10 @@
|
|||||||
"use client";
|
"use client";
|
||||||
import { useEffect, useState } from "react";
|
import { useState } from "react";
|
||||||
import {
|
|
||||||
Card,
|
|
||||||
CardContent,
|
|
||||||
CardDescription,
|
|
||||||
CardFooter,
|
|
||||||
CardHeader,
|
|
||||||
CardTitle,
|
|
||||||
} from "@/components/ui/card";
|
|
||||||
import { Separator } from "@/components/ui/separator";
|
import { Separator } from "@/components/ui/separator";
|
||||||
import { Button } from "@/components/ui/button";
|
import { Button } from "@/components/ui/button";
|
||||||
import { Badge } from "./ui/badge";
|
import { Badge } from "./ui/badge";
|
||||||
import ServersList from "@/lib/list";
|
import ServersList from "@/lib/list";
|
||||||
import {
|
import { CircleUser, Network, Sun, Check, XIcon, Info } from "lucide-react";
|
||||||
CircleUser,
|
|
||||||
Network,
|
|
||||||
Copy,
|
|
||||||
Sun,
|
|
||||||
SlidersHorizontal,
|
|
||||||
Check,
|
|
||||||
XIcon,
|
|
||||||
Info,
|
|
||||||
} from "lucide-react";
|
|
||||||
import Stat from "./Stat";
|
import Stat from "./Stat";
|
||||||
import {
|
import {
|
||||||
Dialog,
|
Dialog,
|
||||||
@ -31,37 +14,6 @@ import {
|
|||||||
DialogTitle,
|
DialogTitle,
|
||||||
DialogTrigger,
|
DialogTrigger,
|
||||||
} from "@/components/ui/dialog";
|
} from "@/components/ui/dialog";
|
||||||
import {
|
|
||||||
ResizableHandle,
|
|
||||||
ResizablePanel,
|
|
||||||
ResizablePanelGroup,
|
|
||||||
} from "@/components/ui/resizable";
|
|
||||||
import {
|
|
||||||
ContextMenu,
|
|
||||||
ContextMenuCheckboxItem,
|
|
||||||
ContextMenuContent,
|
|
||||||
ContextMenuItem,
|
|
||||||
ContextMenuLabel,
|
|
||||||
ContextMenuRadioGroup,
|
|
||||||
ContextMenuRadioItem,
|
|
||||||
ContextMenuSeparator,
|
|
||||||
ContextMenuShortcut,
|
|
||||||
ContextMenuSub,
|
|
||||||
ContextMenuSubContent,
|
|
||||||
ContextMenuSubTrigger,
|
|
||||||
ContextMenuTrigger,
|
|
||||||
} from "@/components/ui/context-menu";
|
|
||||||
import {
|
|
||||||
Command,
|
|
||||||
CommandDialog,
|
|
||||||
CommandEmpty,
|
|
||||||
CommandGroup,
|
|
||||||
CommandInput,
|
|
||||||
CommandItem,
|
|
||||||
CommandList,
|
|
||||||
CommandSeparator,
|
|
||||||
CommandShortcut,
|
|
||||||
} from "@/components/ui/command";
|
|
||||||
import {
|
import {
|
||||||
Tooltip,
|
Tooltip,
|
||||||
TooltipContent,
|
TooltipContent,
|
||||||
@ -71,23 +23,18 @@ import toast from "react-hot-toast";
|
|||||||
import { allTags, allCategories } from "@/allTags";
|
import { allTags, allCategories } from "@/allTags";
|
||||||
import IconDisplay from "./IconDisplay";
|
import IconDisplay from "./IconDisplay";
|
||||||
import InfiniteScroll from "react-infinite-scroll-component";
|
import InfiniteScroll from "react-infinite-scroll-component";
|
||||||
import Markdown from "react-markdown";
|
|
||||||
import {
|
import {
|
||||||
Popover,
|
Popover,
|
||||||
PopoverContent,
|
PopoverContent,
|
||||||
PopoverTrigger,
|
PopoverTrigger,
|
||||||
} from "@/components/ui/popover";
|
} from "@/components/ui/popover";
|
||||||
import remarkGfm from "remark-gfm";
|
|
||||||
import { Checkbox } from "@/components/ui/checkbox";
|
import { Checkbox } from "@/components/ui/checkbox";
|
||||||
import { Spinner } from "./ui/spinner";
|
import { Spinner } from "./ui/spinner";
|
||||||
import { CommandIcon } from "lucide-react";
|
import { CommandIcon } from "lucide-react";
|
||||||
import { Input } from "@/components/ui/input";
|
import { OnlineServer } from "@/lib/types/mh-server";
|
||||||
import { Label } from "@/components/ui/label";
|
|
||||||
import { OnlineServer, ServerResponse } from "@/lib/types/server";
|
|
||||||
import { RadioGroup, RadioGroupItem } from "@/components/ui/radio-group";
|
import { RadioGroup, RadioGroupItem } from "@/components/ui/radio-group";
|
||||||
import { useEffectOnce } from "@/lib/useEffectOnce";
|
import { useEffectOnce } from "@/lib/useEffectOnce";
|
||||||
import ServerCard from "./ServerCard";
|
import ServerCard from "./ServerCard";
|
||||||
import { useHotkeys } from "react-hotkeys-hook";
|
|
||||||
import events from "@/lib/commandEvent";
|
import events from "@/lib/commandEvent";
|
||||||
import { BorderBeam } from "@/components/effects/border-beam";
|
import { BorderBeam } from "@/components/effects/border-beam";
|
||||||
|
|
||||||
|
|||||||
@ -1,7 +1,6 @@
|
|||||||
"use client";
|
"use client";
|
||||||
import { useState, useEffect } from "react";
|
import { useState, useEffect } from "react";
|
||||||
import { Spinner } from "./ui/spinner";
|
import { Spinner } from "./ui/spinner";
|
||||||
import IconDisplay from "./IconDisplay";
|
|
||||||
import {
|
import {
|
||||||
Card,
|
Card,
|
||||||
CardContent,
|
CardContent,
|
||||||
@ -11,34 +10,18 @@ import {
|
|||||||
CardTitle,
|
CardTitle,
|
||||||
BetterHeader,
|
BetterHeader,
|
||||||
} from "@/components/ui/card";
|
} from "@/components/ui/card";
|
||||||
import { motion, AnimatePresence } from "framer-motion";
|
import { motion } from "framer-motion";
|
||||||
import {
|
|
||||||
Dialog,
|
|
||||||
DialogContent,
|
|
||||||
DialogDescription,
|
|
||||||
DialogHeader,
|
|
||||||
DialogTitle,
|
|
||||||
DialogTrigger,
|
|
||||||
} from "@/components/ui/dialog";
|
|
||||||
import beautify from "json-beautify";
|
|
||||||
import {
|
import {
|
||||||
Tooltip,
|
Tooltip,
|
||||||
TooltipContent,
|
TooltipContent,
|
||||||
TooltipTrigger,
|
TooltipTrigger,
|
||||||
} from "@/components/ui/tooltip";
|
} from "@/components/ui/tooltip";
|
||||||
import { Badge } from "./ui/badge";
|
import { Badge } from "./ui/badge";
|
||||||
import Editor from "@monaco-editor/react";
|
|
||||||
import { allTags } from "@/allTags";
|
|
||||||
import ServerSingle from "@/lib/single";
|
import ServerSingle from "@/lib/single";
|
||||||
import { parse, parseExpression } from "@babel/parser";
|
import { SignedIn, SignedOut } from "@clerk/nextjs";
|
||||||
import { NEXT_ROUTER_STATE_TREE } from "next/dist/client/components/app-router-headers";
|
|
||||||
import { Button } from "./ui/button";
|
|
||||||
import * as prettierPluginBabel from "prettier/plugins/babel";
|
|
||||||
import toast from "react-hot-toast";
|
|
||||||
import { SignedIn, SignedOut, SignInButton } from "@clerk/nextjs";
|
|
||||||
import SignInPopoverButton from "./clerk/SignInPopoverButton";
|
import SignInPopoverButton from "./clerk/SignInPopoverButton";
|
||||||
import { Sparkle, Star, X } from "lucide-react";
|
import { Star, X } from "lucide-react";
|
||||||
import { favoriteServer, getCustomization, isFavorited } from "@/lib/api";
|
import { favoriteServer, isFavorited } from "@/lib/api";
|
||||||
import { LoadingButton } from "./ui/loading-button";
|
import { LoadingButton } from "./ui/loading-button";
|
||||||
import { useTheme } from "next-themes";
|
import { useTheme } from "next-themes";
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,4 @@
|
|||||||
import { DollarSign } from "lucide-react";
|
|
||||||
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
|
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
|
||||||
import { Children } from "react";
|
|
||||||
|
|
||||||
export default function Component(props: {
|
export default function Component(props: {
|
||||||
title: string | JSX.Element;
|
title: string | JSX.Element;
|
||||||
|
|||||||
@ -5,23 +5,30 @@ import {
|
|||||||
PopoverTrigger,
|
PopoverTrigger,
|
||||||
} from "@/components/ui/popover";
|
} from "@/components/ui/popover";
|
||||||
import { Button } from "../ui/button";
|
import { Button } from "../ui/button";
|
||||||
import { AtSign, LogIn, UserCog } from "lucide-react";
|
import { AtSign, LogIn } from "lucide-react";
|
||||||
import { useState } from "react";
|
import { useClerk } from "@clerk/nextjs";
|
||||||
import { SignIn, useClerk } from "@clerk/nextjs";
|
|
||||||
|
|
||||||
export default function SignInPopoverButton({
|
export default function SignInPopoverButton({
|
||||||
className,
|
className,
|
||||||
variant
|
variant,
|
||||||
}: {
|
}: {
|
||||||
className?: string;
|
className?: string;
|
||||||
variant?: "default" | "destructive" | "secondary" | "outline" | "ghost" | "link";
|
variant?:
|
||||||
|
| "default"
|
||||||
|
| "destructive"
|
||||||
|
| "secondary"
|
||||||
|
| "outline"
|
||||||
|
| "ghost"
|
||||||
|
| "link";
|
||||||
}) {
|
}) {
|
||||||
const clerk = useClerk();
|
const clerk = useClerk();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Popover>
|
<Popover>
|
||||||
<PopoverTrigger asChild>
|
<PopoverTrigger asChild>
|
||||||
<Button className={className} variant={variant}>Sign In</Button>
|
<Button className={className} variant={variant}>
|
||||||
|
Sign In
|
||||||
|
</Button>
|
||||||
</PopoverTrigger>
|
</PopoverTrigger>
|
||||||
<PopoverContent className="w-full">
|
<PopoverContent className="w-full">
|
||||||
<div className=" grid w-[200px]">
|
<div className=" grid w-[200px]">
|
||||||
|
|||||||
@ -1,17 +1,14 @@
|
|||||||
"use client";
|
"use client";
|
||||||
import { useState, useEffect } from "react";
|
|
||||||
import { useClerk, useUser } from "@clerk/nextjs";
|
import { useClerk, useUser } from "@clerk/nextjs";
|
||||||
import { SignedOut, SignedIn, SignInButton } from "@clerk/nextjs";
|
import { SignedOut, SignedIn } from "@clerk/nextjs";
|
||||||
import { Button } from "../ui/button";
|
import { Button } from "../ui/button";
|
||||||
import { ModeToggle as ThemeSwitcher } from "../ThemeSwitcher";
|
import { ModeToggle as ThemeSwitcher } from "../ThemeSwitcher";
|
||||||
import { Popover, PopoverTrigger, PopoverContent } from "../ui/popover";
|
import { Popover, PopoverTrigger, PopoverContent } from "../ui/popover";
|
||||||
import Image from "next/image";
|
import Image from "next/image";
|
||||||
import { Circle, InfoIcon, UserCog, X } from "lucide-react";
|
import { InfoIcon } from "lucide-react";
|
||||||
import LoggedInPopover from "./LoggedInPopover";
|
import LoggedInPopover from "./LoggedInPopover";
|
||||||
import SignInPopoverButton from "./SignInPopoverButton";
|
import SignInPopoverButton from "./SignInPopoverButton";
|
||||||
import { version } from "@/version";
|
|
||||||
import InfoPopover from "../misc/InfoPopover";
|
import InfoPopover from "../misc/InfoPopover";
|
||||||
import Link from "next/link";
|
|
||||||
|
|
||||||
export default function TopBar({ inter }: { inter: string }) {
|
export default function TopBar({ inter }: { inter: string }) {
|
||||||
const clerk = useClerk();
|
const clerk = useClerk();
|
||||||
@ -21,7 +18,7 @@ export default function TopBar({ inter }: { inter: string }) {
|
|||||||
<>
|
<>
|
||||||
<SignedOut>
|
<SignedOut>
|
||||||
<div className=" mt-1 gap-1 grid grid-cols-5">
|
<div className=" mt-1 gap-1 grid grid-cols-5">
|
||||||
<SignInPopoverButton className="col-span-2" variant="outline"/>
|
<SignInPopoverButton className="col-span-2" variant="outline" />
|
||||||
<Popover>
|
<Popover>
|
||||||
<PopoverTrigger>
|
<PopoverTrigger>
|
||||||
<Button size="icon" variant="ghost">
|
<Button size="icon" variant="ghost">
|
||||||
|
|||||||
@ -61,20 +61,20 @@ const Confetti = forwardRef<ConfettiRef, Props>((props, ref) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
[globalOptions],
|
[globalOptions]
|
||||||
);
|
);
|
||||||
|
|
||||||
// `fire` is a function that calls the instance() with `opts` merged with `options`
|
// `fire` is a function that calls the instance() with `opts` merged with `options`
|
||||||
const fire = useCallback(
|
const fire = useCallback(
|
||||||
(opts = {}) => instanceRef.current?.({ ...options, ...opts }),
|
(opts = {}) => instanceRef.current?.({ ...options, ...opts }),
|
||||||
[options],
|
[options]
|
||||||
);
|
);
|
||||||
|
|
||||||
const api = useMemo(
|
const api = useMemo(
|
||||||
() => ({
|
() => ({
|
||||||
fire,
|
fire,
|
||||||
}),
|
}),
|
||||||
[fire],
|
[fire]
|
||||||
);
|
);
|
||||||
|
|
||||||
useImperativeHandle(ref, () => api, [api]);
|
useImperativeHandle(ref, () => api, [api]);
|
||||||
|
|||||||
@ -8,7 +8,6 @@ import { Button } from "@/components/ui/button";
|
|||||||
import {
|
import {
|
||||||
Form,
|
Form,
|
||||||
FormControl,
|
FormControl,
|
||||||
FormDescription,
|
|
||||||
FormField,
|
FormField,
|
||||||
FormItem,
|
FormItem,
|
||||||
FormLabel,
|
FormLabel,
|
||||||
|
|||||||
@ -8,7 +8,6 @@ import { Button } from "@/components/ui/button";
|
|||||||
import {
|
import {
|
||||||
Form,
|
Form,
|
||||||
FormControl,
|
FormControl,
|
||||||
FormDescription,
|
|
||||||
FormField,
|
FormField,
|
||||||
FormItem,
|
FormItem,
|
||||||
FormLabel,
|
FormLabel,
|
||||||
|
|||||||
@ -1,17 +1,9 @@
|
|||||||
import Link from "next/link";
|
|
||||||
import { Button } from "../ui/button";
|
import { Button } from "../ui/button";
|
||||||
import { Activity, Calendar, Star, TerminalIcon } from "lucide-react";
|
import { Calendar, Star, TerminalIcon } from "lucide-react";
|
||||||
import {
|
import { Dialog, DialogContent, DialogHeader, DialogTitle } from "../ui/dialog";
|
||||||
Dialog,
|
|
||||||
DialogContent,
|
|
||||||
DialogDescription,
|
|
||||||
DialogHeader,
|
|
||||||
DialogTitle,
|
|
||||||
DialogTrigger,
|
|
||||||
} from "../ui/dialog";
|
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { Changelog, version } from "@/version";
|
import { Changelog, version } from "@/version";
|
||||||
import events from "@/lib/commandEvent"
|
import events from "@/lib/commandEvent";
|
||||||
|
|
||||||
export default function InfoPopover() {
|
export default function InfoPopover() {
|
||||||
const [changeLog, setChangelog] = useState(false);
|
const [changeLog, setChangelog] = useState(false);
|
||||||
|
|||||||
@ -12,12 +12,10 @@ import {
|
|||||||
FormLabel,
|
FormLabel,
|
||||||
FormMessage,
|
FormMessage,
|
||||||
} from "@/components/ui/form";
|
} from "@/components/ui/form";
|
||||||
import { TextCopyComp } from "@/components/misc/TextCopyComp";
|
|
||||||
import { Button } from "@/components/ui/button";
|
import { Button } from "@/components/ui/button";
|
||||||
import {
|
import {
|
||||||
InputOTP,
|
InputOTP,
|
||||||
InputOTPGroup,
|
InputOTPGroup,
|
||||||
InputOTPSeparator,
|
|
||||||
InputOTPSlot,
|
InputOTPSlot,
|
||||||
} from "@/components/ui/input-otp";
|
} from "@/components/ui/input-otp";
|
||||||
import { linkMCAccount } from "@/lib/api";
|
import { linkMCAccount } from "@/lib/api";
|
||||||
@ -26,14 +24,11 @@ import {
|
|||||||
Dialog,
|
Dialog,
|
||||||
DialogContent,
|
DialogContent,
|
||||||
DialogDescription,
|
DialogDescription,
|
||||||
DialogFooter,
|
|
||||||
DialogHeader,
|
DialogHeader,
|
||||||
DialogTitle,
|
DialogTitle,
|
||||||
DialogTrigger,
|
|
||||||
} from "@/components/ui/dialog";
|
} from "@/components/ui/dialog";
|
||||||
import { SetStateAction, useEffect, useState } from "react";
|
import { SetStateAction, useState } from "react";
|
||||||
import Confetti from "@/components/effects/confetti";
|
import Confetti from "@/components/effects/confetti";
|
||||||
import { useUser } from "@clerk/nextjs";
|
|
||||||
|
|
||||||
const FormSchema = z.object({
|
const FormSchema = z.object({
|
||||||
code: z.string().min(6, {
|
code: z.string().min(6, {
|
||||||
|
|||||||
@ -1,8 +1,6 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { Tabs, TabsList, TabsTrigger } from "../ui/tabs";
|
import { Tabs, TabsList, TabsTrigger } from "../ui/tabs";
|
||||||
import { Spinner } from "../ui/spinner";
|
|
||||||
import { useRouter } from "@/lib/useRouter";
|
import { useRouter } from "@/lib/useRouter";
|
||||||
import { Database, Home, Paintbrush } from "lucide-react";
|
import { Database, Home, Paintbrush } from "lucide-react";
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import { OnlineServer } from "./types/server";
|
import { OnlineServer } from "./types/mh-server";
|
||||||
import toast from "react-hot-toast";
|
import toast from "react-hot-toast";
|
||||||
import { getMOTDFromServer } from "./api";
|
import { getMOTDFromServer } from "./api";
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import { OnlineServer, ServerResponse } from "./types/server";
|
import { OnlineServer, ServerResponse } from "./types/mh-server";
|
||||||
import toast from "react-hot-toast";
|
import toast from "react-hot-toast";
|
||||||
|
|
||||||
export default class ServerSingle {
|
export default class ServerSingle {
|
||||||
|
|||||||
@ -1,5 +0,0 @@
|
|||||||
import { useAtom, atom } from "jotai";
|
|
||||||
|
|
||||||
export function useColor() {
|
|
||||||
return useAtom(atom("zinc"));
|
|
||||||
}
|
|
||||||
@ -1,12 +1,7 @@
|
|||||||
// inngest in mh-stats provides information periodicly. like every 30 minutes for historical data.
|
import { OnlineServer } from "@/lib/types/mh-server";
|
||||||
// its fully automatic
|
|
||||||
|
|
||||||
import Favorites from "@/app/account/favorites/page";
|
|
||||||
import { OnlineServer } from "@/lib/types/server";
|
|
||||||
import { Inngest } from "inngest";
|
import { Inngest } from "inngest";
|
||||||
import { serve } from "inngest/next";
|
import { serve } from "inngest/next";
|
||||||
import { MongoClient } from "mongodb";
|
import { MongoClient } from "mongodb";
|
||||||
import { Noto_Sans_Mahajani } from "next/font/google";
|
|
||||||
|
|
||||||
// Create a client to send and receive events
|
// Create a client to send and receive events
|
||||||
export const inngest = new Inngest({ id: "my-app" });
|
export const inngest = new Inngest({ id: "my-app" });
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import { NextApiRequest, NextApiResponse } from "next";
|
import { NextApiRequest, NextApiResponse } from "next";
|
||||||
import { getAuth, clerkClient } from "@clerk/nextjs/server";
|
import { getAuth, clerkClient } from "@clerk/nextjs/server";
|
||||||
import { MongoClient, ObjectId } from "mongodb";
|
import { MongoClient } from "mongodb";
|
||||||
|
|
||||||
export default async function handler(
|
export default async function handler(
|
||||||
req: NextApiRequest,
|
req: NextApiRequest,
|
||||||
|
|||||||
@ -1,5 +1,4 @@
|
|||||||
import { NextApiRequest, NextApiResponse } from "next";
|
import { NextApiRequest, NextApiResponse } from "next";
|
||||||
import { getAuth } from "@clerk/nextjs/server";
|
|
||||||
import { MongoClient } from "mongodb";
|
import { MongoClient } from "mongodb";
|
||||||
|
|
||||||
export default async function handler(
|
export default async function handler(
|
||||||
|
|||||||
@ -1,8 +1,7 @@
|
|||||||
import { NextApiRequest, NextApiResponse } from "next";
|
import { NextApiRequest, NextApiResponse } from "next";
|
||||||
import { clerkClient, getAuth } from "@clerk/nextjs/server";
|
import { clerkClient, getAuth } from "@clerk/nextjs/server";
|
||||||
import { MongoClient } from "mongodb";
|
import { MongoClient } from "mongodb";
|
||||||
import ServersList from "@/lib/list";
|
import { OnlineServer } from "@/lib/types/mh-server";
|
||||||
import { OnlineServer } from "@/lib/types/server";
|
|
||||||
|
|
||||||
export default async function handler(
|
export default async function handler(
|
||||||
req: NextApiRequest,
|
req: NextApiRequest,
|
||||||
|
|||||||
@ -1,8 +1,6 @@
|
|||||||
import { NextApiRequest, NextApiResponse } from "next";
|
import { NextApiRequest, NextApiResponse } from "next";
|
||||||
import { clerkClient, getAuth } from "@clerk/nextjs/server";
|
import { clerkClient, getAuth } from "@clerk/nextjs/server";
|
||||||
import { MongoClient } from "mongodb";
|
import { MongoClient } from "mongodb";
|
||||||
import ServersList from "@/lib/list";
|
|
||||||
import { OnlineServer } from "@/lib/types/server";
|
|
||||||
|
|
||||||
export default async function handler(
|
export default async function handler(
|
||||||
req: NextApiRequest,
|
req: NextApiRequest,
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import { NextApiRequest, NextApiResponse } from "next";
|
import { NextApiRequest, NextApiResponse } from "next";
|
||||||
import { getAuth, clerkClient, clerkMiddleware } from "@clerk/nextjs/server";
|
import { getAuth, clerkClient } from "@clerk/nextjs/server";
|
||||||
import { MongoClient, ObjectId } from "mongodb";
|
import { MongoClient } from "mongodb";
|
||||||
|
|
||||||
export default async function handler(
|
export default async function handler(
|
||||||
req: NextApiRequest,
|
req: NextApiRequest,
|
||||||
|
|||||||
@ -1,8 +1,6 @@
|
|||||||
import { NextApiRequest, NextApiResponse } from "next";
|
import { NextApiRequest, NextApiResponse } from "next";
|
||||||
import { clerkClient, getAuth } from "@clerk/nextjs/server";
|
import { clerkClient, getAuth } from "@clerk/nextjs/server";
|
||||||
import { MongoClient } from "mongodb";
|
import { MongoClient } from "mongodb";
|
||||||
import ServersList from "@/lib/list";
|
|
||||||
import { OnlineServer } from "@/lib/types/server";
|
|
||||||
|
|
||||||
export default async function handler(
|
export default async function handler(
|
||||||
req: NextApiRequest,
|
req: NextApiRequest,
|
||||||
|
|||||||
@ -1,5 +1,4 @@
|
|||||||
import { NextApiRequest, NextApiResponse } from "next";
|
import { NextApiRequest, NextApiResponse } from "next";
|
||||||
import { getAuth } from "@clerk/nextjs/server";
|
|
||||||
import { MongoClient } from "mongodb";
|
import { MongoClient } from "mongodb";
|
||||||
|
|
||||||
export default async function handler(
|
export default async function handler(
|
||||||
|
|||||||
@ -1,5 +1,4 @@
|
|||||||
import { NextApiRequest, NextApiResponse } from "next";
|
import { NextApiRequest, NextApiResponse } from "next";
|
||||||
import { getAuth } from "@clerk/nextjs/server";
|
|
||||||
import { MongoClient } from "mongodb";
|
import { MongoClient } from "mongodb";
|
||||||
|
|
||||||
export default async function handler(
|
export default async function handler(
|
||||||
|
|||||||
@ -1,6 +1,5 @@
|
|||||||
import type { NextApiResponse, NextApiRequest } from "next";
|
import type { NextApiResponse, NextApiRequest } from "next";
|
||||||
import { MongoClient, ObjectId } from "mongodb";
|
import { MongoClient } from "mongodb";
|
||||||
import { getAuth } from "@clerk/nextjs/server";
|
|
||||||
|
|
||||||
export default async function handler(
|
export default async function handler(
|
||||||
req: NextApiRequest,
|
req: NextApiRequest,
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import type { NextApiResponse, NextApiRequest } from "next";
|
import type { NextApiResponse, NextApiRequest } from "next";
|
||||||
import { MongoClient, ObjectId } from "mongodb";
|
import { MongoClient } from "mongodb";
|
||||||
import { getAuth } from "@clerk/nextjs/server";
|
import { getAuth } from "@clerk/nextjs/server";
|
||||||
|
|
||||||
export default async function handler(
|
export default async function handler(
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import type { NextApiResponse, NextApiRequest } from "next";
|
import type { NextApiResponse, NextApiRequest } from "next";
|
||||||
import { MongoClient, ObjectId } from "mongodb";
|
import { MongoClient } from "mongodb";
|
||||||
import { getAuth } from "@clerk/nextjs/server";
|
import { getAuth } from "@clerk/nextjs/server";
|
||||||
|
|
||||||
export default async function handler(
|
export default async function handler(
|
||||||
|
|||||||
@ -3,7 +3,7 @@ import { NextApiRequest, NextApiResponse } from "next";
|
|||||||
|
|
||||||
export default async function handler(
|
export default async function handler(
|
||||||
req: NextApiRequest,
|
req: NextApiRequest,
|
||||||
res: NextApiResponse,
|
res: NextApiResponse
|
||||||
) {
|
) {
|
||||||
const client = new MongoClient(process.env.MONGO_DB as string);
|
const client = new MongoClient(process.env.MONGO_DB as string);
|
||||||
const db = client.db("mhsf").collection("mh");
|
const db = client.db("mhsf").collection("mh");
|
||||||
|
|||||||
@ -1,4 +1,3 @@
|
|||||||
import { OnlineServer } from "@/lib/types/server";
|
|
||||||
import { MongoClient } from "mongodb";
|
import { MongoClient } from "mongodb";
|
||||||
import { NextApiRequest, NextApiResponse } from "next";
|
import { NextApiRequest, NextApiResponse } from "next";
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,4 @@
|
|||||||
import { NextApiRequest, NextApiResponse } from "next";
|
import { NextApiRequest, NextApiResponse } from "next";
|
||||||
import { getAuth } from "@clerk/nextjs/server";
|
|
||||||
import { MongoClient } from "mongodb";
|
import { MongoClient } from "mongodb";
|
||||||
|
|
||||||
export default async function handler(
|
export default async function handler(
|
||||||
|
|||||||
@ -1,36 +1,33 @@
|
|||||||
import { NextApiRequest, NextApiResponse } from "next";
|
import { NextApiRequest, NextApiResponse } from "next";
|
||||||
import parseToHTML from "@/lib/motdEngine";
|
import parseToHTML from "@/lib/motdEngine";
|
||||||
|
|
||||||
let num = 0;
|
|
||||||
|
|
||||||
export default async function handler(
|
export default async function handler(
|
||||||
req: NextApiRequest,
|
req: NextApiRequest,
|
||||||
res: NextApiResponse
|
res: NextApiResponse
|
||||||
) {
|
) {
|
||||||
num++;
|
const initalList: Array<{ server: string; motd: string }> = req.body.motd;
|
||||||
var body: Array<{ server: string; motd: string }> = req.body.motd;
|
const resultedList: Array<{ server: string; motd: string }> = [];
|
||||||
var list: Array<{ server: string; motd: string }> = [];
|
var interval = 0;
|
||||||
var yes = 0;
|
if (initalList != undefined && initalList.forEach != undefined) {
|
||||||
if (body != undefined && body.forEach != undefined) {
|
initalList.forEach((c, i) => {
|
||||||
body.forEach((c, i) => {
|
|
||||||
parseToHTML(c.motd)
|
parseToHTML(c.motd)
|
||||||
.then((m) => {
|
.then((m) => {
|
||||||
yes++;
|
interval++;
|
||||||
list.push({ motd: m, server: c.server });
|
resultedList.push({ motd: m, server: c.server });
|
||||||
if (yes == body.length) {
|
if (interval == initalList.length) {
|
||||||
res.send({ result: list });
|
res.send({ result: resultedList });
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
list.push({ motd: "Error to grab MOTD", server: c.server });
|
resultedList.push({ motd: "Error to grab MOTD", server: c.server });
|
||||||
if (i == body.length - 1) {
|
if (i == initalList.length - 1) {
|
||||||
res.send({ result: list });
|
res.send({ result: resultedList });
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
res
|
res.status(400).send({
|
||||||
.status(400)
|
message: "Wrong structure.. you might be using the legacy MOTD.",
|
||||||
.send({ mes: "Wrong structure.. you might be using the legacy MOTD." });
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
8
src/types/index.d.ts
vendored
8
src/types/index.d.ts
vendored
@ -1,8 +0,0 @@
|
|||||||
declare module "json-beautify" {
|
|
||||||
export default function beautify(
|
|
||||||
value: any,
|
|
||||||
replacer: Function | object | any[] | null,
|
|
||||||
space: number | string,
|
|
||||||
limit?: number,
|
|
||||||
): string;
|
|
||||||
}
|
|
||||||
@ -8,6 +8,38 @@ const User = ({ user }: { user: string }) => (
|
|||||||
|
|
||||||
export const Changelog = () => (
|
export const Changelog = () => (
|
||||||
<>
|
<>
|
||||||
|
<div>
|
||||||
|
Running on commit{" "}
|
||||||
|
<code>
|
||||||
|
<a
|
||||||
|
href={`https://github.com/DeveloLongScript/mhsf/commit/${process.env.NEXT_PUBLIC_VERCEL_GIT_COMMIT_SHA}`}
|
||||||
|
>
|
||||||
|
{(
|
||||||
|
process.env.NEXT_PUBLIC_VERCEL_GIT_COMMIT_SHA || "unknown"
|
||||||
|
).substring(0, 7)}
|
||||||
|
</a>{" "}
|
||||||
|
{process.env.NEXT_PUBLIC_VERCEL_GIT_PULL_REQUEST_ID != undefined &&
|
||||||
|
process.env.NEXT_PUBLIC_VERCEL_GIT_PULL_REQUEST_ID != "" && (
|
||||||
|
<>
|
||||||
|
{" "}
|
||||||
|
| on PR{" "}
|
||||||
|
<a
|
||||||
|
href={`https://github.com/DeveloLongScript/MHSF/pull/${process.env.NEXT_PUBLIC_VERCEL_GIT_PULL_REQUEST_ID}`}
|
||||||
|
>
|
||||||
|
{process.env.NEXT_PUBLIC_VERCEL_GIT_PULL_REQUEST_ID}
|
||||||
|
</a>{" "}
|
||||||
|
by{" "}
|
||||||
|
<a
|
||||||
|
href={`https://github.com/${process.env.NEXT_PUBLIC_VERCEL_GIT_COMMIT_AUTHOR_NAME}`}
|
||||||
|
>
|
||||||
|
{process.env.NEXT_PUBLIC_VERCEL_GIT_COMMIT_AUTHOR_NAME}
|
||||||
|
</a>
|
||||||
|
</>
|
||||||
|
)}{" "}
|
||||||
|
{process.env.NEXT_PUBLIC_VERCEL_GIT_COMMIT_MESSAGE != undefined &&
|
||||||
|
`| ${process.env.NEXT_PUBLIC_VERCEL_GIT_COMMIT_MESSAGE}`}
|
||||||
|
</code>
|
||||||
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<strong className="flex items-center">
|
<strong className="flex items-center">
|
||||||
Version b-0.7.2 (August 7th 2024)
|
Version b-0.7.2 (August 7th 2024)
|
||||||
|
|||||||
@ -4065,6 +4065,11 @@ magic-string@^0.30.10:
|
|||||||
dependencies:
|
dependencies:
|
||||||
"@jridgewell/sourcemap-codec" "^1.4.15"
|
"@jridgewell/sourcemap-codec" "^1.4.15"
|
||||||
|
|
||||||
|
mangle-css-class-webpack-plugin@^5.1.0:
|
||||||
|
version "5.1.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/mangle-css-class-webpack-plugin/-/mangle-css-class-webpack-plugin-5.1.0.tgz#42008a8fbe0257f491968796320eb94b17a36321"
|
||||||
|
integrity sha512-/K5ADYUFBLE8c6on3SCduDuOTJ6Wg0BrQ8JQuX8XNOvXI5Pz4SczaRNN2qv0Ocks7kSTXeGaGXIgQZe4lX2m9A==
|
||||||
|
|
||||||
map-obj@^4.1.0:
|
map-obj@^4.1.0:
|
||||||
version "4.3.0"
|
version "4.3.0"
|
||||||
resolved "https://registry.npmjs.org/map-obj/-/map-obj-4.3.0.tgz"
|
resolved "https://registry.npmjs.org/map-obj/-/map-obj-4.3.0.tgz"
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user