This commit is contained in:
2026-01-25 16:29:47 +01:00
parent 76834b0e10
commit b9bbfa787a
2 changed files with 22 additions and 3 deletions

View File

@@ -1,11 +1,13 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>ASF SSO - Admin Portal</title> <title>ASF SSO - Admin Portal</title>
<link rel="stylesheet" href="/static/css/style.css"> <link rel="stylesheet" href="/static/css/style.css">
</head> </head>
<body> <body>
<!-- Login Page --> <!-- Login Page -->
<div id="login-page" class="flex items-center justify-center" style="height: 100vh;"> <div id="login-page" class="flex items-center justify-center" style="height: 100vh;">
@@ -42,7 +44,7 @@
<section id="users-section"> <section id="users-section">
<div class="flex justify-between items-center mb-4"> <div class="flex justify-between items-center mb-4">
<h2 class="text-2xl">Users</h2> <h2 class="text-2xl">Users</h2>
<button class="btn btn-primary" onclick="openModal('user-modal')">Add User</button> <button class="btn btn-primary" onclick="addUser()">Add User</button>
</div> </div>
<div class="card"> <div class="card">
<table id="users-table"> <table id="users-table">
@@ -67,7 +69,7 @@
<section id="apps-section" class="hidden"> <section id="apps-section" class="hidden">
<div class="flex justify-between items-center mb-4"> <div class="flex justify-between items-center mb-4">
<h2 class="text-2xl">Applications</h2> <h2 class="text-2xl">Applications</h2>
<button class="btn btn-primary" onclick="openModal('app-modal')">Add Application</button> <button class="btn btn-primary" onclick="addApp()">Add Application</button>
</div> </div>
<div class="card"> <div class="card">
<table id="apps-table"> <table id="apps-table">
@@ -147,4 +149,5 @@
<script src="/static/js/app.js"></script> <script src="/static/js/app.js"></script>
</body> </body>
</html>
</html>

View File

@@ -183,6 +183,22 @@ userForm.addEventListener("submit", async (e) => {
} }
}); });
window.addUser = () => {
document.getElementById("user-id").value = "";
document.getElementById("user-username").value = "";
document.getElementById("user-email").value = "";
document.getElementById("user-password").value = "";
document.getElementById("user-is-admin").checked = false;
document.getElementById("user-is-active").checked = true;
openModal("user-modal");
};
window.addApp = () => {
document.getElementById("app-name").value = "";
document.getElementById("app-url").value = "";
openModal("app-modal");
};
window.editUser = (user) => { window.editUser = (user) => {
document.getElementById("user-id").value = user.id; document.getElementById("user-id").value = user.id;
document.getElementById("user-username").value = user.username; document.getElementById("user-username").value = user.username;