diff --git a/cron/package.json b/cron/package.json index bc345b4..4fc32d6 100644 --- a/cron/package.json +++ b/cron/package.json @@ -12,6 +12,7 @@ "dependencies": { "arguments-parser": "^3.2.1", "chalk": "^5.3.0", + "cron": "^3.1.7", "dotenv": "^16.4.5", "mongodb": "^6.8.0" }, diff --git a/cron/src/index.ts b/cron/src/index.ts index c8e03d5..3a7023b 100644 --- a/cron/src/index.ts +++ b/cron/src/index.ts @@ -116,21 +116,12 @@ async function periodicCronJob() { date: new Date(), }); - process.stdout.clearLine(0); - process.stdout.cursorTo(0); - process.stdout.write( - "[CRON] " + - INFO + - " Remaining servers: " + - (y + "/" + mh.servers.length), + console.log( + Date.now() + "[CRON] " + INFO + (y + "/" + mh.servers.length), ); y++; if (y == mh.servers.length) { - process.stdout.clearLine(0); - process.stdout.cursorTo(0); - process.stdout.write( - "[CRON] " + SUCCESS + " Finished! Closing MongoDB connection.", - ); + console.log(Date.now() + "[CRON] " + SUCCESS + "Done!"); return; } diff --git a/cron/yarn.lock b/cron/yarn.lock index d993200..44628be 100644 --- a/cron/yarn.lock +++ b/cron/yarn.lock @@ -9,6 +9,11 @@ dependencies: sparse-bitfield "^3.0.3" +"@types/luxon@~3.4.0": + version "3.4.2" + resolved "https://registry.yarnpkg.com/@types/luxon/-/luxon-3.4.2.tgz#e4fc7214a420173cea47739c33cdf10874694db7" + integrity sha512-TifLZlFudklWlMBfhubvgqTXRzLDI5pCbGa4P8a3wPyUQSW+1xQ5eDsreP9DWHX3tjq1ke96uYG/nwundroWcA== + "@types/webidl-conversions@*": version "7.0.3" resolved "https://registry.yarnpkg.com/@types/webidl-conversions/-/webidl-conversions-7.0.3.tgz#1306dbfa53768bcbcfc95a1c8cde367975581859" @@ -65,6 +70,14 @@ color-name@~1.1.4: resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== +cron@^3.1.7: + version "3.1.7" + resolved "https://registry.yarnpkg.com/cron/-/cron-3.1.7.tgz#3423d618ba625e78458fff8cb67001672d49ba0d" + integrity sha512-tlBg7ARsAMQLzgwqVxy8AZl/qlTc5nibqYwtNGoCrd+cV+ugI+tvZC1oT/8dFH8W455YrywGykx/KMmAqOr7Jw== + dependencies: + "@types/luxon" "~3.4.0" + luxon "~3.4.0" + dotenv@^16.4.5: version "16.4.5" resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-16.4.5.tgz#cdd3b3b604cb327e286b4762e13502f717cb099f" @@ -75,6 +88,11 @@ has-flag@^4.0.0: resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== +luxon@~3.4.0: + version "3.4.4" + resolved "https://registry.yarnpkg.com/luxon/-/luxon-3.4.4.tgz#cf20dc27dc532ba41a169c43fdcc0063601577af" + integrity sha512-zobTr7akeGHnv7eBOXcRgMeCP6+uyYsczwmeRCauvpvaAltgNyTbLH/+VaEAPUeWBT+1GuNmz4wC/6jtQzbbVA== + memory-pager@^1.0.2: version "1.5.0" resolved "https://registry.yarnpkg.com/memory-pager/-/memory-pager-1.5.0.tgz#d8751655d22d384682741c972f2c3d6dfa3e66b5" diff --git a/docs/advanced/achievements.mdx b/docs/advanced/achievements.mdx new file mode 100644 index 0000000..d9d6bf2 --- /dev/null +++ b/docs/advanced/achievements.mdx @@ -0,0 +1,10 @@ +--- +title: "Achievement Collection" +--- + +# Achievements +Achievements are a page that every server gets which contains certain requirements which could be embedded in an servers history. + + + +Achievements are *not* collected instantly, and are actually collected every 12 hours. (this is not timezone dependent) There are currently 5 possible achievements to get, ranging from easiest to hardest. \ No newline at end of file diff --git a/package.json b/package.json index 2c28c9c..db5231b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "mh-stats", - "version": "1.1.0", + "version": "1.3.0", "private": true, "packageManager": "yarn@1.22.22", "scripts": { diff --git a/src/components/SLCustomizePage.tsx b/src/components/SLCustomizePage.tsx index 92e5f27..550680a 100644 --- a/src/components/SLCustomizePage.tsx +++ b/src/components/SLCustomizePage.tsx @@ -31,7 +31,11 @@ export function SLCustomize() { setUsePaddingOnSides( (user?.publicMetadata.srv as boolean | undefined) || false ); - }); + }, [ + user?.publicMetadata.srv, + user?.publicMetadata.pad, + user?.publicMetadata.ipr, + ]); const handleSubmit = (e: React.FormEvent) => { e.preventDefault(); @@ -105,7 +109,20 @@ export function SLCustomize() {

- Better for larger screens. + Better for larger screens, can look more stylish. +

+
+ + +
+

+ When information needs to be crunched in-between, recommended + for larger screens only.

diff --git a/src/components/ServerList.tsx b/src/components/ServerList.tsx index 79d4cd7..7b3fb9f 100644 --- a/src/components/ServerList.tsx +++ b/src/components/ServerList.tsx @@ -853,7 +853,29 @@ export default function ServerList() { Grid - + { + if (am) + toast( + + These settings will not change over reloads + because you have account specific options enabled + + , + { icon: "⚠️" } + ); + setIPR(v); + }} + > 4 items per row diff --git a/src/components/feat/AchievementList.tsx b/src/components/feat/AchievementList.tsx index b4281e7..3099ce5 100644 --- a/src/components/feat/AchievementList.tsx +++ b/src/components/feat/AchievementList.tsx @@ -38,7 +38,7 @@ export default function AchievementList({ server }: { server: string }) {
Achievements are earned automatically when the server is online. See{" "} - Special:Root + Docs:Advanced/Achievements {achievements .filter( diff --git a/src/components/misc/Link.tsx b/src/components/misc/Link.tsx index 3d11137..1958581 100644 --- a/src/components/misc/Link.tsx +++ b/src/components/misc/Link.tsx @@ -10,9 +10,21 @@ export default function A({ alt: string | ReactNode; }) { return ( - - {children.startsWith("Docs:") && } + + {(children || "").startsWith("Docs:") && ( + + )} + {(children || "").startsWith("Wiki:") && ( + + )} {alt} + {(children || "").startsWith("https") && ( + + )} ); } @@ -28,6 +40,7 @@ export function ALegacy({ {(href || "").startsWith("Docs:") && ( @@ -45,7 +58,7 @@ export function ALegacy({ export const pageFind = (text: string) => { if (text.startsWith("Docs:")) { - return "/docs/" + text.substring(5); + return "/docs/" + text.substring(5).toLowerCase(); } if (text === "Special:Root") return "/"; if (text === "Special:Preferences") return "/account/settings"; diff --git a/src/config/docs.ts b/src/config/docs.ts index 1edec78..893fb13 100644 --- a/src/config/docs.ts +++ b/src/config/docs.ts @@ -1,52 +1,57 @@ export const allFolders: (DocsFolder | Docs)[] = [ - { - title: "Getting Started", - url: "/docs/getting-started", - }, - { - title: "Reading", - url: "/docs/reading", - }, - { - name: "Guides", - docs: [ - { - title: "Linking", - url: "/docs/guides/linking", - }, - { - title: "Owning a Server", - url: "/docs/guides/owning-a-server", - }, - { - title: "Server Customization", - url: "/docs/guides/customization", - }, - { title: "Reporting a server", url: "/docs/guides/reporting-server" }, - ], - }, - { - name: "Advanced", - docs: [ - { title: "Tech Stack", url: "/docs/advanced/tech-stack" }, - { title: "Using the Command-bar", url: "/docs/advanced/command-bar" }, - { title: "Tips with external servers", url: "/docs/advanced/external" }, - ], - }, - { - name: "Legal", - docs: [ - { title: "ECA Agreement", url: "/docs/legal/external-content-agreement" }, - ], - }, + { + title: "Getting Started", + url: "/docs/getting-started", + }, + { + title: "Server List", + url: "/", + }, + { + title: "Reading", + url: "/docs/reading", + }, + { + name: "Guides", + docs: [ + { + title: "Linking", + url: "/docs/guides/linking", + }, + { + title: "Owning a Server", + url: "/docs/guides/owning-a-server", + }, + { + title: "Server Customization", + url: "/docs/guides/customization", + }, + { title: "Reporting a server", url: "/docs/guides/reporting-server" }, + ], + }, + { + name: "Advanced", + docs: [ + { title: "Tech Stack", url: "/docs/advanced/tech-stack" }, + { title: "Using the Command-bar", url: "/docs/advanced/command-bar" }, + { title: "Tips with external servers", url: "/docs/advanced/external" }, + { title: "Achievements", url: "/docs/advanced/achievements" }, + ], + }, + { + name: "Legal", + docs: [ + { title: "ECA Agreement", url: "/docs/legal/external-content-agreement" }, + ], + }, ]; export type Docs = { - title: string; - url: string; + title: string; + url: string; }; export type DocsFolder = { - name: string; - docs: Array; + name: string; + docs: Array; }; diff --git a/src/config/version.tsx b/src/config/version.tsx index 42625e1..9d54052 100644 --- a/src/config/version.tsx +++ b/src/config/version.tsx @@ -5,7 +5,7 @@ import { Separator } from "../components/ui/separator"; import { Button } from "../components/ui/button"; import confetti from "canvas-confetti"; -export const version = "1.2.5"; +export const version = "1.3"; const User = ({ user }: { user: string }) => ( @@ -130,16 +130,21 @@ export const Changelog = () => {
- Version 1.2.0 (September 4th 2024) + Version 1.3.0 (September 9th 2024)
  • - • Removed sorting system in-favor of leaderboards coming soon :eyes: + • Docs:Reading
  • +
  • + • Achievements are here! See more at{" "} + Docs:Advanced/Achievements +
  • +
  • • Finally fixed Cron actions for the final time™
  • +
  • • Overhauled account preferences

-
Version 1.2.0 (September 3rd 2024) @@ -365,6 +370,7 @@ import type { SVGProps } from "react"; import Marquee from "@/components/effects/marquee"; import { useRouter } from "@/lib/useRouter"; import { BookIcon } from "lucide-react"; +import A from "@/components/misc/Link"; const Discord = (props: SVGProps) => (