Added resizable/scrollable lists on admin panel
This commit is contained in:
parent
a9f083dcc6
commit
3c37080cb7
9 changed files with 156 additions and 134 deletions
|
|
@ -15,8 +15,9 @@ You should have received a copy of the GNU Affero General Public License
|
||||||
along with this program. If not, see <https://www.gnu.org/licenses/>. %>
|
along with this program. If not, see <https://www.gnu.org/licenses/>. %>
|
||||||
<div id="admin-channel-list-div" class="admin-list-div">
|
<div id="admin-channel-list-div" class="admin-list-div">
|
||||||
<h3>Channel List:</h3>
|
<h3>Channel List:</h3>
|
||||||
<div class="dynamic-container">
|
<div class="dynamic-container resizable table-container">
|
||||||
<table id="admin-channel-list-table" class="admin-list-table">
|
<table id="admin-channel-list-table" class="admin-list-table">
|
||||||
|
<thead>
|
||||||
<tr id="admin-channel-list-entry-title" class="admin-list-entry-title-row">
|
<tr id="admin-channel-list-entry-title" class="admin-list-entry-title-row">
|
||||||
<td id="admin-channel-list-entry-img-title" class=" admin-list-entry-title admin-list-entry-item admin-list-entry-img-title">
|
<td id="admin-channel-list-entry-img-title" class=" admin-list-entry-title admin-list-entry-item admin-list-entry-img-title">
|
||||||
<h3>Img</h3>
|
<h3>Img</h3>
|
||||||
|
|
@ -28,6 +29,8 @@ along with this program. If not, see <https://www.gnu.org/licenses/>. %>
|
||||||
<h3>Description</h3>
|
<h3>Description</h3>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
<% chanGuide.forEach((channel) => { %>
|
<% chanGuide.forEach((channel) => { %>
|
||||||
<tr id="admin-channel-list-entry-<%= unescape(channel.name) %>" class="">
|
<tr id="admin-channel-list-entry-<%= unescape(channel.name) %>" class="">
|
||||||
<td id="admin-channel-list-entry-img-<%= unescape(channel.name) %>" class=" admin-list-entry-item">
|
<td id="admin-channel-list-entry-img-<%= unescape(channel.name) %>" class=" admin-list-entry-item">
|
||||||
|
|
@ -45,6 +48,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>. %>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<% }); %>
|
<% }); %>
|
||||||
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -23,6 +23,6 @@ along with this program. If not, see <https://www.gnu.org/licenses/>. %>
|
||||||
<div class="control-prompt">
|
<div class="control-prompt">
|
||||||
<input placeholder="Emote Link..." id="new-emote-link-input" class="control-prompt">
|
<input placeholder="Emote Link..." id="new-emote-link-input" class="control-prompt">
|
||||||
</div>
|
</div>
|
||||||
<div class="dynamic-container" id="emote-list">
|
<div class="dynamic-container resizable" id="emote-list">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -19,6 +19,6 @@ along with this program. If not, see <https://www.gnu.org/licenses/>. %>
|
||||||
!<input placeholder="Add Command..." id="new-toke-command-input" class="control-prompt">
|
!<input placeholder="Add Command..." id="new-toke-command-input" class="control-prompt">
|
||||||
<button id="new-toke-command-button" class="positive-button">Add</button>
|
<button id="new-toke-command-button" class="positive-button">Add</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="dynamic-container toke-command-list">
|
<div class="dynamic-container toke-command-list resizable">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -15,8 +15,9 @@ You should have received a copy of the GNU Affero General Public License
|
||||||
along with this program. If not, see <https://www.gnu.org/licenses/>. %>
|
along with this program. If not, see <https://www.gnu.org/licenses/>. %>
|
||||||
<div id="admin-ban-list-div" class="admin-list-div">
|
<div id="admin-ban-list-div" class="admin-list-div">
|
||||||
<h3>User Ban List:</h3>
|
<h3>User Ban List:</h3>
|
||||||
<div class="dynamic-container">
|
<div class="dynamic-container resizable table-container">
|
||||||
<table id="admin-ban-list-table" class="admin-list-table">
|
<table id="admin-ban-list-table" class="admin-list-table">
|
||||||
|
<thead>
|
||||||
<tr id="admin-ban-list-entry-title" class="admin-list-entry-title-row">
|
<tr id="admin-ban-list-entry-title" class="admin-list-entry-title-row">
|
||||||
<td id="admin-ban-list-entry-user-title" class="admin-list-entry-title admin-list-entry-item">
|
<td id="admin-ban-list-entry-user-title" class="admin-list-entry-title admin-list-entry-item">
|
||||||
<h3>Main<br>User</h3>
|
<h3>Main<br>User</h3>
|
||||||
|
|
@ -43,6 +44,9 @@ along with this program. If not, see <https://www.gnu.org/licenses/>. %>
|
||||||
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -15,8 +15,9 @@ You should have received a copy of the GNU Affero General Public License
|
||||||
along with this program. If not, see <https://www.gnu.org/licenses/>. %>
|
along with this program. If not, see <https://www.gnu.org/licenses/>. %>
|
||||||
<div id="admin-user-list-div" class="admin-list-div">
|
<div id="admin-user-list-div" class="admin-list-div">
|
||||||
<h3>User List:</h3>
|
<h3>User List:</h3>
|
||||||
<div class="dynamic-container resizable">
|
<div class="dynamic-container resizable table-container">
|
||||||
<table id="admin-user-list-table" class="admin-list-table">
|
<table id="admin-user-list-table" class="admin-list-table">
|
||||||
|
<thead>
|
||||||
<tr id="admin-user-list-entry-title" class="admin-list-entry-title-row">
|
<tr id="admin-user-list-entry-title" class="admin-list-entry-title-row">
|
||||||
<td id="admin-user-list-entry-img-title" class="admin-list-entry-title admin-list-entry-item admin-list-entry-img-title">
|
<td id="admin-user-list-entry-img-title" class="admin-list-entry-title admin-list-entry-item admin-list-entry-img-title">
|
||||||
<h3>Img</h3>
|
<h3>Img</h3>
|
||||||
|
|
@ -40,6 +41,8 @@ along with this program. If not, see <https://www.gnu.org/licenses/>. %>
|
||||||
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
<% userList.forEach((curUser) => { %>
|
<% userList.forEach((curUser) => { %>
|
||||||
<tr id="admin-user-list-entry-<%= unescape(curUser.user) %>" class="admin-list-entry" data-name="<%= unescape(curUser.user) %>" >
|
<tr id="admin-user-list-entry-<%= unescape(curUser.user) %>" class="admin-list-entry" data-name="<%= unescape(curUser.user) %>" >
|
||||||
<td class="admin-list-entry-item">
|
<td class="admin-list-entry-item">
|
||||||
|
|
@ -80,6 +83,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>. %>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<% }); %>
|
<% }); %>
|
||||||
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -71,10 +71,9 @@ div.dynamic-container, div.nested-dynamic-container{
|
||||||
|
|
||||||
div.dynamic-container.resizable{
|
div.dynamic-container.resizable{
|
||||||
resize: vertical;
|
resize: vertical;
|
||||||
width: fit-content;
|
|
||||||
height: fit-content;
|
height: fit-content;
|
||||||
min-height: 1.5em;
|
min-height: 1.5em;
|
||||||
max-height: 8em;
|
max-height: 17.5em;
|
||||||
padding: 0.5em 0.2em;
|
padding: 0.5em 0.2em;
|
||||||
border-bottom-right-radius: 0;
|
border-bottom-right-radius: 0;
|
||||||
}
|
}
|
||||||
|
|
@ -84,6 +83,15 @@ div.dynamic-container.resizable[style*="height"]{
|
||||||
max-height: 100%;
|
max-height: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
div.dynamic-container.table-container{
|
||||||
|
padding-top: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.dynamic-container.table-container table thead{
|
||||||
|
position: sticky;
|
||||||
|
top: 0;
|
||||||
|
}
|
||||||
|
|
||||||
.interactive{
|
.interactive{
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
user-select: none;
|
user-select: none;
|
||||||
|
|
|
||||||
|
|
@ -257,6 +257,10 @@ textarea{
|
||||||
color: var(--accent1);
|
color: var(--accent1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
div.dynamic-container.table-container table thead{
|
||||||
|
background-color: var(--bg1);
|
||||||
|
box-shadow: var(--accent1) 0px 1em 1px -2em, var(--accent1) 0px 1em 1px -1em;
|
||||||
|
}
|
||||||
|
|
||||||
tr{
|
tr{
|
||||||
box-shadow: var(--accent1) 0px 1em 1px -2em, var(--accent1) 0px -1em 1px -1em;
|
box-shadow: var(--accent1) 0px 1em 1px -2em, var(--accent1) 0px -1em 1px -1em;
|
||||||
|
|
|
||||||
|
|
@ -277,6 +277,11 @@ textarea{
|
||||||
color: var(--accent1);
|
color: var(--accent1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
div.dynamic-container.table-container table thead{
|
||||||
|
background-color: var(--bg2-alt1);
|
||||||
|
box-shadow: var(--accent1) 0px 1em 1px -2em, var(--accent1) 0px 1em 1px -1em;
|
||||||
|
}
|
||||||
|
|
||||||
tr{
|
tr{
|
||||||
box-shadow: var(--accent1) 0px 1em 1px -2em, var(--accent1) 0px -1em 1px -1em;
|
box-shadow: var(--accent1) 0px 1em 1px -2em, var(--accent1) 0px -1em 1px -1em;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -143,7 +143,7 @@ class adminPermissionList{
|
||||||
|
|
||||||
class adminUserBanList{
|
class adminUserBanList{
|
||||||
constructor(){
|
constructor(){
|
||||||
this.table = document.querySelector("#admin-ban-list-table");
|
this.tbody = document.querySelector("#admin-ban-list-table tbody");
|
||||||
|
|
||||||
this.getBanList();
|
this.getBanList();
|
||||||
}
|
}
|
||||||
|
|
@ -152,13 +152,6 @@ class adminUserBanList{
|
||||||
this.renderBanList(await adminUtil.getBans());
|
this.renderBanList(await adminUtil.getBans());
|
||||||
}
|
}
|
||||||
|
|
||||||
clearBanList(){
|
|
||||||
const oldRows = this.table.querySelectorAll('tr.gen-row');
|
|
||||||
oldRows.forEach((row) => {
|
|
||||||
row.remove();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
async unban(event){
|
async unban(event){
|
||||||
//Get username from target id
|
//Get username from target id
|
||||||
const user = event.target.dataset.name;
|
const user = event.target.dataset.name;
|
||||||
|
|
@ -168,7 +161,7 @@ class adminUserBanList{
|
||||||
|
|
||||||
renderBanList(banList){
|
renderBanList(banList){
|
||||||
//Clear out the ban list
|
//Clear out the ban list
|
||||||
this.clearBanList();
|
this.tbody.innerHTML = "";
|
||||||
|
|
||||||
//For each ban received
|
//For each ban received
|
||||||
banList.forEach((ban) => {
|
banList.forEach((ban) => {
|
||||||
|
|
@ -195,7 +188,7 @@ class adminUserBanList{
|
||||||
}
|
}
|
||||||
|
|
||||||
//Generate and append row to table
|
//Generate and append row to table
|
||||||
this.table.appendChild(utils.ux.newTableRow([
|
this.tbody.appendChild(utils.ux.newTableRow([
|
||||||
this.renderUser(ban.user, nuked),
|
this.renderUser(ban.user, nuked),
|
||||||
this.renderUsers(ban.alts, nuked),
|
this.renderUsers(ban.alts, nuked),
|
||||||
this.renderDeadUsers(ban.deletedNames),
|
this.renderDeadUsers(ban.deletedNames),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue