diff --git a/anwendung/src/Tests/Login.jsx b/anwendung/src/Tests/Login.jsx deleted file mode 100644 index a76aa3d..0000000 --- a/anwendung/src/Tests/Login.jsx +++ /dev/null @@ -1,22 +0,0 @@ -import {useState} from "react"; -import Button from "@/components/Button"; - -export default function Login() { - - return ( -
- -

Login

-
-
-

Username

- -
-

Password

- -
-
- ); - } \ No newline at end of file diff --git a/anwendung/src/components/Login.jsx b/anwendung/src/components/Login.jsx new file mode 100644 index 0000000..f1416fc --- /dev/null +++ b/anwendung/src/components/Login.jsx @@ -0,0 +1,36 @@ +import {useState} from "react"; +import Button from "@/components/Button"; + +export default function Login() { + + let url = "http://localhost:8080/users" + + function on_login_click() + { + url += "?mail=" + inputUserName + "&password=" + inputPassword; + + fetch(url, { + method: "GET", + }).then(r => console.log()) + } + + const [inputUserName, setInputUserName] = useState("") + const [inputPassword, setInputPassword] = useState("") + + return ( +
+ +

Login

+
+
+

Username

+ setInputUserName(e.target.value)} placeholder="Type here" className="input input-bordered input-sm w-full max-w-xs"/> +
+

Password

+ setInputPassword(e.target.value)} placeholder="Type here" className="input input-bordered input-sm w-full max-w-xs"/> +
+
+ ); + } \ No newline at end of file diff --git a/anwendung/src/pages/index.js b/anwendung/src/pages/index.js index a1cf49d..a75537e 100644 --- a/anwendung/src/pages/index.js +++ b/anwendung/src/pages/index.js @@ -8,7 +8,7 @@ import PopUp from "@/components/PopUp"; import CalenderView from "@/components/CalenderView"; import DateElement from "@/components/DateElement"; import InputForm from "@/components/InputForm"; -import Login from "@/Tests/Login"; +import Login from "@/components/Login"; import Test from "@/components/Test"; @@ -20,13 +20,9 @@ export default function Home(p) { return ( - <> - - -
- - - +
+ +
) } \ No newline at end of file diff --git a/anwendung/src/styles/globals.css b/anwendung/src/styles/globals.css index 98541ea..eae2c95 100644 --- a/anwendung/src/styles/globals.css +++ b/anwendung/src/styles/globals.css @@ -8,19 +8,22 @@ --background-end-rgb: 255, 255, 255; } +/** +Page Layouts + */ -body { - color: rgb(var(--foreground-rgb)); - background: linear-gradient( - to bottom, - transparent, - rgb(var(--background-end-rgb)) - ) - rgb(var(--background-start-rgb)); +.login-window +{ + height: 100vh; display: flex; flex-direction: column; - align-items: center; justify-content: center; + align-items: center; +} + +body +{ + height: 100vh; } /* @@ -397,7 +400,6 @@ Login border-radius: 5px; font-family: Arial, serif; font-size: 16px; - font-color: black; } .border{ @@ -407,7 +409,7 @@ Login border-radius: 5px; border-width: 2px; border-color: #1e2428; - gap: 10px; + /*gap: 10px;*/ } .placement { display: flex; diff --git a/anwendung/tailwind.config.js b/anwendung/tailwind.config.js index 74da8f8..da61bc4 100644 --- a/anwendung/tailwind.config.js +++ b/anwendung/tailwind.config.js @@ -14,5 +14,4 @@ module.exports = { }, }, }, - plugins: [require("daisyui")], } diff --git a/backend/src/main/java/com/example/backend/anwprj/controller/ModuleController.java b/backend/src/main/java/com/example/backend/anwprj/controller/ModuleController.java index 1a6f4e0..830eca6 100644 --- a/backend/src/main/java/com/example/backend/anwprj/controller/ModuleController.java +++ b/backend/src/main/java/com/example/backend/anwprj/controller/ModuleController.java @@ -13,50 +13,50 @@ import org.springframework.web.bind.annotation.RestController; @RestController public class ModuleController { - private final DataBaseHandler db; - - { - db = DataBaseHandler.getInstance(); - } - - @CrossOrigin - @GetMapping("placeholder") - public ResponseEntity getModule( - @RequestParam(name="id") int id, - @RequestParam(name="sessionid") String sessionID) { - - User user = UserSessionIDHandler.getUserBySessionID(sessionID); - - if (user != null){ - Module module = db.getModule(id); - if(module != null) { - return new ResponseEntity<>(module, HttpStatus.OK); - } - - return new ResponseEntity<>(HttpStatus.NOT_FOUND); - } - - return new ResponseEntity<>(HttpStatus.FORBIDDEN); - } - - @CrossOrigin - @GetMapping("placeholder") - public ResponseEntity getModule( - @RequestParam(name="name") String name, - @RequestParam(name="sessionid") String sessionID) { - - User user = UserSessionIDHandler.getUserBySessionID(sessionID); - - if(user != null) - { - Module module = db.getModule(name); - if (module != null) { - return new ResponseEntity<>(module, HttpStatus.OK); - } - - return new ResponseEntity<>(HttpStatus.NOT_FOUND); - } - - return new ResponseEntity<>(HttpStatus.FORBIDDEN); - } +// private final DataBaseHandler db; +// +// { +// db = DataBaseHandler.getInstance(); +// } +// +// @CrossOrigin +// @GetMapping("placeholder") +// public ResponseEntity getModule( +// @RequestParam(name="id") int id, +// @RequestParam(name="sessionid") String sessionID) { +// +// User user = UserSessionIDHandler.getUserBySessionID(sessionID); +// +// if (user != null){ +// Module module = db.getModule(id); +// if(module != null) { +// return new ResponseEntity<>(module, HttpStatus.OK); +// } +// +// return new ResponseEntity<>(HttpStatus.NOT_FOUND); +// } +// +// return new ResponseEntity<>(HttpStatus.FORBIDDEN); +// } +// +// @CrossOrigin +// @GetMapping("placeholder") +// public ResponseEntity getModule( +// @RequestParam(name="name") String name, +// @RequestParam(name="sessionid") String sessionID) { +// +// User user = UserSessionIDHandler.getUserBySessionID(sessionID); +// +// if(user != null) +// { +// Module module = db.getModule(name); +// if (module != null) { +// return new ResponseEntity<>(module, HttpStatus.OK); +// } +// +// return new ResponseEntity<>(HttpStatus.NOT_FOUND); +// } +// +// return new ResponseEntity<>(HttpStatus.FORBIDDEN); +// } }