From 3ab620e3abdb8a8704d30c8bff5c15cc4e8e94fa Mon Sep 17 00:00:00 2001 From: ha-seungwon <12gktmddnjs@naver.com> Date: Fri, 18 Aug 2023 05:06:12 +0900 Subject: [PATCH] fix : admin-access code fix --- .../resources/static/html/admin-access.html | 7 ++ .../resources/static/html/admin-data.html | 85 +++++++++++++++++++ src/main/resources/static/js/admin-access.js | 28 +++++- 3 files changed, 119 insertions(+), 1 deletion(-) create mode 100644 src/main/resources/static/html/admin-data.html diff --git a/src/main/resources/static/html/admin-access.html b/src/main/resources/static/html/admin-access.html index 93aa9b4..5f080cd 100644 --- a/src/main/resources/static/html/admin-access.html +++ b/src/main/resources/static/html/admin-access.html @@ -39,6 +39,13 @@

Access users

+
+ + +
diff --git a/src/main/resources/static/html/admin-data.html b/src/main/resources/static/html/admin-data.html new file mode 100644 index 0000000..02d715d --- /dev/null +++ b/src/main/resources/static/html/admin-data.html @@ -0,0 +1,85 @@ + + + + + Admin + + + +
+ +

Access users

+
+
+
+ + +
+ + +
+ + +
+ + +
+ + +
+ + +
+ + +
+ + +
+
+
+ + + + + + + + + + + + + + +
last loginnameemailencrypt passwordblock
+ +
+
+
+ + + + + diff --git a/src/main/resources/static/js/admin-access.js b/src/main/resources/static/js/admin-access.js index 1e97867..ebc388e 100644 --- a/src/main/resources/static/js/admin-access.js +++ b/src/main/resources/static/js/admin-access.js @@ -92,13 +92,23 @@ async function displayUsers() { tableBody.innerHTML = ''; const startIndex = (currentPage - 1) * pageSize; const endIndex = startIndex + pageSize; + const displayOption = document.getElementById('displayOption').value; + for (let index = startIndex; index < endIndex && index < users.length; index++) { const user = users[index]; const row = document.createElement('tr'); row.id = `user-${user.id}`; + + let displayValue = ""; + if (displayOption === "data") { + displayValue = user.dateTime; + } else if (displayOption === "email") { + displayValue = user.memberEmail; + } + row.innerHTML = ` - ${user.dateTime} + ${displayValue} ${user.memberName} ${user.memberEmail} ${user.memberEncryptedPassword} @@ -106,6 +116,22 @@ async function displayUsers() { tableBody.appendChild(row); } } +function navigateToPage(option) { + if (option === "data") { + // Navigate to the data page (replace with the actual URL) + window.location.href = "./admin-data.html"; + } else if (option === "email") { + // Navigate to the email page (replace with the actual URL) + window.location.href = "./admin-access.html"; + } +} +const displayOptionSelection = document.getElementById('displayOption'); +displayOptionSelection.addEventListener('change', () => { + const selectedOption = displayOptionSelection.value; + navigateToPage(selectedOption); +}); + + async function updatePagination() { pagination.innerHTML = '';