diff --git a/cron/package-lock.json b/cron/package-lock.json deleted file mode 100644 index 91cb478..0000000 --- a/cron/package-lock.json +++ /dev/null @@ -1,175 +0,0 @@ -{ - "name": "cron", - "version": "1.0.0", - "lockfileVersion": 3, - "requires": true, - "packages": { - "": { - "name": "cron", - "version": "1.0.0", - "license": "ISC", - "dependencies": { - "chalk": "^5.3.0", - "dotenv": "^16.4.5", - "mongodb": "^6.8.0" - } - }, - "node_modules/@mongodb-js/saslprep": { - "version": "1.1.8", - "resolved": "https://registry.npmjs.org/@mongodb-js/saslprep/-/saslprep-1.1.8.tgz", - "integrity": "sha512-qKwC/M/nNNaKUBMQ0nuzm47b7ZYWQHN3pcXq4IIcoSBc2hOIrflAxJduIvvqmhoz3gR2TacTAs8vlsCVPkiEdQ==", - "dependencies": { - "sparse-bitfield": "^3.0.3" - } - }, - "node_modules/@types/webidl-conversions": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/@types/webidl-conversions/-/webidl-conversions-7.0.3.tgz", - "integrity": "sha512-CiJJvcRtIgzadHCYXw7dqEnMNRjhGZlYK05Mj9OyktqV8uVT8fD2BFOB7S1uwBE3Kj2Z+4UyPmFw/Ixgw/LAlA==" - }, - "node_modules/@types/whatwg-url": { - "version": "11.0.5", - "resolved": "https://registry.npmjs.org/@types/whatwg-url/-/whatwg-url-11.0.5.tgz", - "integrity": "sha512-coYR071JRaHa+xoEvvYqvnIHaVqaYrLPbsufM9BF63HkwI5Lgmy2QR8Q5K/lYDYo5AK82wOvSOS0UsLTpTG7uQ==", - "dependencies": { - "@types/webidl-conversions": "*" - } - }, - "node_modules/bson": { - "version": "6.8.0", - "resolved": "https://registry.npmjs.org/bson/-/bson-6.8.0.tgz", - "integrity": "sha512-iOJg8pr7wq2tg/zSlCCHMi3hMm5JTOxLTagf3zxhcenHsFp+c6uOs6K7W5UE7A4QIJGtqh/ZovFNMP4mOPJynQ==", - "engines": { - "node": ">=16.20.1" - } - }, - "node_modules/chalk": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.3.0.tgz", - "integrity": "sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==", - "engines": { - "node": "^12.17.0 || ^14.13 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/dotenv": { - "version": "16.4.5", - "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.4.5.tgz", - "integrity": "sha512-ZmdL2rui+eB2YwhsWzjInR8LldtZHGDoQ1ugH85ppHKwpUHL7j7rN0Ti9NCnGiQbhaZ11FpR+7ao1dNsmduNUg==", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://dotenvx.com" - } - }, - "node_modules/memory-pager": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/memory-pager/-/memory-pager-1.5.0.tgz", - "integrity": "sha512-ZS4Bp4r/Zoeq6+NLJpP+0Zzm0pR8whtGPf1XExKLJBAczGMnSi3It14OiNCStjQjM6NU1okjQGSxgEZN8eBYKg==" - }, - "node_modules/mongodb": { - "version": "6.8.0", - "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-6.8.0.tgz", - "integrity": "sha512-HGQ9NWDle5WvwMnrvUxsFYPd3JEbqD3RgABHBQRuoCEND0qzhsd0iH5ypHsf1eJ+sXmvmyKpP+FLOKY8Il7jMw==", - "dependencies": { - "@mongodb-js/saslprep": "^1.1.5", - "bson": "^6.7.0", - "mongodb-connection-string-url": "^3.0.0" - }, - "engines": { - "node": ">=16.20.1" - }, - "peerDependencies": { - "@aws-sdk/credential-providers": "^3.188.0", - "@mongodb-js/zstd": "^1.1.0", - "gcp-metadata": "^5.2.0", - "kerberos": "^2.0.1", - "mongodb-client-encryption": ">=6.0.0 <7", - "snappy": "^7.2.2", - "socks": "^2.7.1" - }, - "peerDependenciesMeta": { - "@aws-sdk/credential-providers": { - "optional": true - }, - "@mongodb-js/zstd": { - "optional": true - }, - "gcp-metadata": { - "optional": true - }, - "kerberos": { - "optional": true - }, - "mongodb-client-encryption": { - "optional": true - }, - "snappy": { - "optional": true - }, - "socks": { - "optional": true - } - } - }, - "node_modules/mongodb-connection-string-url": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/mongodb-connection-string-url/-/mongodb-connection-string-url-3.0.1.tgz", - "integrity": "sha512-XqMGwRX0Lgn05TDB4PyG2h2kKO/FfWJyCzYQbIhXUxz7ETt0I/FqHjUeqj37irJ+Dl1ZtU82uYyj14u2XsZKfg==", - "dependencies": { - "@types/whatwg-url": "^11.0.2", - "whatwg-url": "^13.0.0" - } - }, - "node_modules/punycode": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", - "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", - "engines": { - "node": ">=6" - } - }, - "node_modules/sparse-bitfield": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/sparse-bitfield/-/sparse-bitfield-3.0.3.tgz", - "integrity": "sha512-kvzhi7vqKTfkh0PZU+2D2PIllw2ymqJKujUcyPMd9Y75Nv4nPbGJZXNhxsgdQab2BmlDct1YnfQCguEvHr7VsQ==", - "dependencies": { - "memory-pager": "^1.0.2" - } - }, - "node_modules/tr46": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-4.1.1.tgz", - "integrity": "sha512-2lv/66T7e5yNyhAAC4NaKe5nVavzuGJQVVtRYLyQ2OI8tsJ61PMLlelehb0wi2Hx6+hT/OJUWZcw8MjlSRnxvw==", - "dependencies": { - "punycode": "^2.3.0" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/webidl-conversions": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-7.0.0.tgz", - "integrity": "sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==", - "engines": { - "node": ">=12" - } - }, - "node_modules/whatwg-url": { - "version": "13.0.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-13.0.0.tgz", - "integrity": "sha512-9WWbymnqj57+XEuqADHrCJ2eSXzn8WXIW/YSGaZtb2WKAInQ6CHfaUUcTyyver0p8BDg5StLQq8h1vtZuwmOig==", - "dependencies": { - "tr46": "^4.1.1", - "webidl-conversions": "^7.0.0" - }, - "engines": { - "node": ">=16" - } - } - } -} diff --git a/src/app/sort/favorites/page.tsx b/src/app/sort/favorites/page.tsx deleted file mode 100644 index 50dbd63..0000000 --- a/src/app/sort/favorites/page.tsx +++ /dev/null @@ -1,17 +0,0 @@ -import FavoriteSortView from "@/components/FavoritesSortView"; -import type { Metadata } from "next"; - -export const metadata: Metadata = { - title: "Favorites Sort | MHSF", - description: "See all of the servers on Minehut in order of favorites.", -}; - -export default function FavoritesSort() { - return ( -
-
- -
-
- ); -} diff --git a/src/components/CommandBar.tsx b/src/components/CommandBar.tsx index 4ce65b7..a75511f 100644 --- a/src/components/CommandBar.tsx +++ b/src/components/CommandBar.tsx @@ -522,15 +522,6 @@ export function CommandBar() { +Shift+K - { - events.emit("cmd-event-sort"); - setOpen(false); - }} - > - - Sort Servers - { setOpen(false); @@ -688,49 +679,6 @@ export function RandomServerDialog() { ); } -export function SubSortCommandBar() { - const [open, setOpen] = useState(false); - const router = useRouter(); - - useEffectOnce(() => { - events.on("cmd-event-sort", () => { - setOpen(true); - }); - }); - - return ( - - - - No results found. - - - { - router.push("/sort/favorites"); - setOpen(false); - }} - > - - Favorites - - - - { - setOpen(false); - events.emit("cmd-event"); - }} - > - - Go back - - - - - ); -} - export function SubLinkCommandBar() { const [open, setOpen] = useState(false); const { resolvedTheme } = useTheme(); @@ -862,7 +810,6 @@ export function CommandBarer() { - diff --git a/src/components/FavoritesSortView.tsx b/src/components/FavoritesSortView.tsx deleted file mode 100644 index 8907041..0000000 --- a/src/components/FavoritesSortView.tsx +++ /dev/null @@ -1,292 +0,0 @@ -"use client"; -import { useEffect, useState } from "react"; -import { Spinner } from "./ui/spinner"; -import { sortedFavorites } from "@/lib/api"; -import InfiniteScroll from "react-infinite-scroll-component"; -import { Button } from "./ui/button"; -import { Popover, PopoverContent, PopoverTrigger } from "./ui/popover"; -import { RadioGroup, RadioGroupItem } from "./ui/radio-group"; -import { Label } from "./ui/label"; -import { useRouter } from "@/lib/useRouter"; -import { OnlineServer } from "@/lib/types/mh-server"; -import ServerCard from "./ServerCard"; -import { CircleUser, Copy, Info, Layers, Network } from "lucide-react"; -import { Tooltip, TooltipContent, TooltipTrigger } from "./ui/tooltip"; -import { BorderBeam } from "./effects/border-beam"; -import Stat from "./Stat"; -import { Separator } from "./ui/separator"; -import { Card, CardDescription, CardHeader, CardTitle } from "./ui/card"; -import Link from "next/link"; -import toast from "react-hot-toast"; -import { Skeleton } from "./ui/skeleton"; -import FadeIn from "react-fade-in/lib/FadeIn"; - -export default function FavoriteSortView() { - const [loading, setLoading] = useState(true); - const [list, setList] = useState<{ server: string; favorites: number }[]>([]); - const [allItems, setAllItems] = useState< - Array<{ server: string; favorites: number }> - >([]); - const [upNumber, setUpNumber] = useState(0); - const [hasMore, setHasMore] = useState(true); - const [totalServers, setTotalServers] = useState(0); - const [totalPlayers, setTotalPlayers] = useState(0); - const [online, setOnline] = useState({}); - const router = useRouter(); - - useEffect(() => { - sortedFavorites().then((c) => { - if (typeof c !== "boolean") { - const slicedArray = c.slice(0, 20); - setAllItems(slicedArray); - setList(c); - fetch("https://api.minehut.com/servers").then((b) => - b.json().then((c) => { - c.servers.forEach((v: OnlineServer) => - setOnline(setManipulate(online, v.name, v)) - ); - setLoading(false); - setTotalPlayers(c.total_players); - setTotalServers(c.total_servers); - }) - ); - - console.log(list); - } - }); - }, []); - - if (loading) { - return ( - <> -
- - -
-
- -
-
- - - - -
- - ); - } - - return ( -
-
- - = 3200 - ? "bg-clip-text text-transparent bg-gradient-to-r from-cyan-500 to-blue-500" - : "" - } - > - Servers online{" "} -
- } - className="relative z-0" - desc={ -
-
= 3200 - ? "bg-clip-text text-transparent bg-gradient-to-r from-cyan-500 to-blue-500 " - : "" - } - > - {totalServers.toString()} -
- {totalServers >= 3200 && ( - - - - - - The server amount is over 3.2k, meaning that new servers - have to go into a queue before being able to be online.{" "} -
- (the server count isn't entirely accurate, so sometimes you - might not go into a queue even when the server count is at - 3.2k) -
-
- )} -
- } - icon={Network} - > - {totalServers >= 3200 && ( - - )} - -
-
- -
- - - - - - router.push("/")} - > -
- - -
-
- - -
-
-
-
- -
-
- - { - const newUpNumber = upNumber + 1; - const slicedArray = list.slice( - newUpNumber * 20, - newUpNumber * 20 + 20 - ); - console.log(slicedArray.length); - - setAllItems((prev) => [...prev, ...slicedArray]); - if (slicedArray.length !== 20) setHasMore(false); - setUpNumber(newUpNumber); - }} - loader={
} - endMessage={ -

-
- You've seen it all -

- } - style={{ overflow: "hidden", paddingLeft: 6 }} - > - -
- {allItems.map((v) => { - if (v.favorites == 0) { - return <>; - } - - if (online[v.server] != undefined) - return ( - - ); - else - return ( - - - {v.server} - - {v.favorites} favorited -
- - - - - - - - - Open up the server page to see more information - about the server - - -
-
-
- ); - })} -
-
-
- - ); -} - -function setManipulate(object: any, change: string, value: any) { - let newObject = object; - newObject[change] = value; - return newObject; -} diff --git a/src/config/achievements.ts b/src/config/achievements.ts index fad95dd..3917e83 100644 --- a/src/config/achievements.ts +++ b/src/config/achievements.ts @@ -12,7 +12,7 @@ export const formalNames: FormalNames = { title: "At one time, this server had the most players on the platform!", description: - "This is awarded to servers that had the number 1 permission at the time of the achievements getting resolved.", + "This is awarded to servers that had the most players at the time of the achievements getting resolved.", color: "#9aedff", icon: Medal, }, diff --git a/src/config/version.tsx b/src/config/version.tsx index 9d54052..c515e85 100644 --- a/src/config/version.tsx +++ b/src/config/version.tsx @@ -103,7 +103,7 @@ export const Changelog = () => { } > - Star on GitHub + Star on GitHub ) => (