From 38dd0f8be185421a32ec5b3810eea4d10b4cf56a Mon Sep 17 00:00:00 2001 From: Egor Kondrashov Date: Tue, 20 Feb 2024 18:56:57 +0400 Subject: [PATCH 01/16] add table with column names to my.html --- src/main/webapp/html/my.html | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/main/webapp/html/my.html b/src/main/webapp/html/my.html index eb66ac55..9137f5d0 100644 --- a/src/main/webapp/html/my.html +++ b/src/main/webapp/html/my.html @@ -7,5 +7,18 @@

RPG admin panel

+ + + + + + + + + + + +
#NameTitleRaceProfessionLevelBirthdayBanned
+ \ No newline at end of file From 4e59a23d687b7928787ab6a853e1ee225812fa4b Mon Sep 17 00:00:00 2001 From: Egor Kondrashov Date: Tue, 20 Feb 2024 19:09:54 +0400 Subject: [PATCH 02/16] add script tag for functions --- src/main/webapp/html/my.html | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/webapp/html/my.html b/src/main/webapp/html/my.html index 9137f5d0..99ef1a5c 100644 --- a/src/main/webapp/html/my.html +++ b/src/main/webapp/html/my.html @@ -20,5 +20,9 @@

RPG admin panel

+ + \ No newline at end of file From 2cde143bd9f55edb81397ce4687c32a89fad48c3 Mon Sep 17 00:00:00 2001 From: Egor Kondrashov Date: Thu, 14 Mar 2024 23:37:39 +0400 Subject: [PATCH 03/16] add GET request in show_list function in my.html. And add borders for table in my.css --- src/main/webapp/css/my.css | 4 ++++ src/main/webapp/html/my.html | 22 +++++++++++++++++++--- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/src/main/webapp/css/my.css b/src/main/webapp/css/my.css index e69de29b..30bb76bf 100644 --- a/src/main/webapp/css/my.css +++ b/src/main/webapp/css/my.css @@ -0,0 +1,4 @@ +th, td { + border: 1px solid black; + padding: 3px; +} \ No newline at end of file diff --git a/src/main/webapp/html/my.html b/src/main/webapp/html/my.html index 99ef1a5c..6206956b 100644 --- a/src/main/webapp/html/my.html +++ b/src/main/webapp/html/my.html @@ -4,10 +4,10 @@ - +

RPG admin panel

- +
@@ -21,7 +21,23 @@

RPG admin panel

# Name
From d5882554601826dc73c2bab16c5a42e679806e8b Mon Sep 17 00:00:00 2001 From: Egor Kondrashov Date: Wed, 20 Mar 2024 13:53:09 +0400 Subject: [PATCH 04/16] add paging under the table, add get request for account amount, add list for numbers of accounts to show in page --- src/main/webapp/html/my.html | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/src/main/webapp/html/my.html b/src/main/webapp/html/my.html index 6206956b..e4073d90 100644 --- a/src/main/webapp/html/my.html +++ b/src/main/webapp/html/my.html @@ -7,6 +7,14 @@

RPG admin panel

+ + + @@ -17,9 +25,10 @@

RPG admin panel

-
# Level Birthday Banned
+
Pages:
+ From 41b7a7646ac3d297e052cd77a9b7c0b5d8823108 Mon Sep 17 00:00:00 2001 From: Egor Kondrashov Date: Wed, 20 Mar 2024 17:22:09 +0400 Subject: [PATCH 05/16] add page numbers with links under the table --- src/main/webapp/html/my.html | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/main/webapp/html/my.html b/src/main/webapp/html/my.html index e4073d90..532f84a5 100644 --- a/src/main/webapp/html/my.html +++ b/src/main/webapp/html/my.html @@ -7,7 +7,7 @@

RPG admin panel

- + + @@ -30,10 +30,23 @@

RPG admin panel

Pages:
From 85850b5d47cba7f543cda14f70978d7b7c0beedb Mon Sep 17 00:00:00 2001 From: Egor Kondrashov Date: Thu, 21 Mar 2024 00:39:25 +0400 Subject: [PATCH 09/16] add deleteAcc function for deleting users by id --- src/main/webapp/html/my.html | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/src/main/webapp/html/my.html b/src/main/webapp/html/my.html index 5b00cb17..462f1b5e 100644 --- a/src/main/webapp/html/my.html +++ b/src/main/webapp/html/my.html @@ -63,7 +63,7 @@

RPG admin panel

+ "
" ).appendTo("#table_1") @@ -103,6 +103,26 @@

RPG admin panel

return res; } + function deleteAcc(id) { + let url = "/rest/players/" + id; + $.ajax({ + url: url, + type: 'DELETE', + success: function () { + show_list(getCurrentPage()); + } + }); + } + + function getCurrentPage() { + let current_page = 1; + $('button:parent(div)').each(function () { + if ($(this).css('color') === 'rgb(0, 128, 0)') { + current_page = $(this).text(); + } + }); + return parseInt(current_page) - 1; + } From 3827da37ba3b75f8209afafab1c377aa2a48d661 Mon Sep 17 00:00:00 2001 From: Egor Kondrashov Date: Thu, 21 Mar 2024 12:19:31 +0400 Subject: [PATCH 10/16] add Edit account function and remove delete button after clicking edit button --- src/main/webapp/html/my.html | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/main/webapp/html/my.html b/src/main/webapp/html/my.html index 462f1b5e..36ae50e9 100644 --- a/src/main/webapp/html/my.html +++ b/src/main/webapp/html/my.html @@ -60,7 +60,7 @@

RPG admin panel

+ item.level + "
" - + " " + new Date(item.birthday).toLocaleDateString() + "" + item.banned + "" - + "" + "