Explorar o código

Added login front end code

Please implement the backend code for this login interface
TC %!s(int64=3) %!d(string=hai) anos
pai
achega
a0c78f37f4
Modificáronse 1 ficheiros con 32 adicións e 0 borrados
  1. 32 0
      files/login.html

+ 32 - 0
files/login.html

@@ -0,0 +1,32 @@
+    <!DOCTYPE html>
+    <html>
+        <head>
+            <title>Login</title>
+            <script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js">
+            </script>
+        </head>
+        <body>
+          <h1>Admin Login</h1>
+          <p>Please enter your password here</p>
+          <input id="password" type="password">
+
+        <button onclick="handleLogin()">Login</button>
+        
+        <script>
+        function handleLogin() {
+          var password = $("#password").val();
+          $.ajax({
+			url: "/login",
+            data: {password: password},
+            success: function(value){
+				if (value == true){
+                 	alert("You have logged in"); 
+                }else{
+                    alert("Incorrect Password");
+                }
+            }
+          });
+        }
+        </script>
+        </body>
+    </html>