+
+ {/* Mobile menu button */}
+
+
+
+
+ Grasscutter Tools
-
-
- Grasscutter Tools
-
-
+
+
+
+
+ )
+}
\ No newline at end of file
diff --git a/src/components/RouteMenu.tsx b/src/components/RouteMenu.tsx
index 6df7131..19078d8 100644
--- a/src/components/RouteMenu.tsx
+++ b/src/components/RouteMenu.tsx
@@ -1,6 +1,7 @@
import {Routes, Route, RouteProps} from "react-router-dom";
import React from "react";
import Artifacts from "./pages/Artifacts";
+import GCAuth from "./pages/GCAuth";
interface RouteMenuProps extends RouteProps{
handleHeaderTitleChange: (title: string) => void;
@@ -17,6 +18,9 @@ export default function RouteMenu(props: RouteMenuProps) {
}/>
+
+ }/>
);
}
\ No newline at end of file
diff --git a/src/components/pages/GCAuth.tsx b/src/components/pages/GCAuth.tsx
new file mode 100644
index 0000000..b5f16e7
--- /dev/null
+++ b/src/components/pages/GCAuth.tsx
@@ -0,0 +1,74 @@
+import {useEffect, useState} from "react";
+import {Autocomplete, TextField} from "@mui/material";
+
+interface IGCAuthResponse{
+ status: string;
+ message: string;
+ jwt: string;
+}
+
+interface IJWTPayload{
+ token: string;
+ username: string;
+ uid: string;
+}
+
+interface IGCAuthLogin{
+ username: string;
+ password: string;
+}
+
+interface IGCAuthRegister{
+ username: string;
+ password: string;
+ password_confirmation: string;
+}
+
+interface IGCAuthChangePassword{
+ username: string;
+ new_password: string;
+ new_password_confirmation: string;
+ old_password: string;
+}
+
+export default function GCAuth() {
+ const [jwt, setJwt] = useState("");
+ const [dispatchServer, setDispatchServer] = useState("");
+ const [useSSl, setUseSSl] = useState(true);
+ const [baseUrl, setBaseUrl] = useState("");
+
+ const checkGCAuth = async ()=>{
+ fetch(baseUrl+"/authentication/type")
+ .then(res => res.text())
+ .then(res => {
+ if (res === "me.exzork.gcauth.handler.GCAuthAuthenticationHandler"){
+ console.log("GCAuth is installed");
+ }else{
+ console.log("GCAuth is not installed");
+ }
+ })
+ .catch(err => {
+ console.log(err);
+ });
+ }
+
+ useEffect(() => {
+ setBaseUrl(`http${useSSl ? "s" : ""}://${dispatchServer}`);
+ }, [useSSl, dispatchServer]);
+ return (
+ <>
+
+ >
+ )
+}
\ No newline at end of file
diff --git a/src/i18n.ts b/src/i18n.ts
index 3c5a4cd..2e6d058 100644
--- a/src/i18n.ts
+++ b/src/i18n.ts
@@ -13,7 +13,7 @@ i18n
interpolation: {
escapeValue: false, // not needed for react!!
},
- ns: ["artifact"],
+ ns: ["artifact","gcauth"],
defaultNS: "",
});