From 1d7523490cc67091dc1a98d8f105139fba32a9be Mon Sep 17 00:00:00 2001 From: Seyed Mahdi <39972836+SeyedHashtag@users.noreply.github.com> Date: Wed, 24 Dec 2025 15:17:14 +0330 Subject: [PATCH] feat(users): update user table to include status, traffic usage, and expiry date with improved class names --- core/scripts/webpanel/assets/js/users.js | 16 ++++++++-------- core/scripts/webpanel/templates/users.html | 2 +- core/scripts/webpanel/templates/users_rows.html | 12 ++++++------ 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/core/scripts/webpanel/assets/js/users.js b/core/scripts/webpanel/assets/js/users.js index f55695f..fa51688 100644 --- a/core/scripts/webpanel/assets/js/users.js +++ b/core/scripts/webpanel/assets/js/users.js @@ -180,10 +180,10 @@ $(function () { $("#userTable tbody tr.user-main-row").each(function () { let showRow; switch (filter) { - case "on-hold": showRow = $(this).find("td:eq(3) i").hasClass("text-warning"); break; - case "online": showRow = $(this).find("td:eq(3) i").hasClass("text-success"); break; - case "enable": showRow = $(this).find("td:eq(8) i").hasClass("text-success"); break; - case "disable": showRow = $(this).find("td:eq(8) i").hasClass("text-danger"); break; + case "on-hold": showRow = $(this).find("td.status-cell i").hasClass("text-warning"); break; + case "online": showRow = $(this).find("td.status-cell i").hasClass("text-success"); break; + case "enable": showRow = $(this).find("td.enable-cell i").hasClass("text-success"); break; + case "disable": showRow = $(this).find("td.enable-cell i").hasClass("text-danger"); break; default: showRow = true; } $(this).toggle(showRow).find(".user-checkbox").prop("checked", false); @@ -278,11 +278,11 @@ $(function () { const dataRow = $(event.relatedTarget).closest("tr.user-main-row"); const url = GET_USER_URL_TEMPLATE.replace('U', user); - const trafficText = dataRow.find("td:eq(4)").text(); - const usageDaysText = dataRow.find("td:eq(6)").text(); + const trafficText = dataRow.find("td.traffic-cell").text(); + const usageDaysText = dataRow.find("td.usage-days-cell").text(); const expiryText = usageDaysText.split('/')[1] || "0"; const note = dataRow.data('note'); - const statusText = dataRow.find("td:eq(3)").text().trim(); + const statusText = dataRow.find("td.status-cell").text().trim(); $('#editPasswordError').text(''); $('#editExpirationDaysError').text(''); @@ -299,7 +299,7 @@ $(function () { } $("#editNote").val(note || ''); - $("#editBlocked").prop("checked", !dataRow.find("td:eq(8) i").hasClass("text-success")); + $("#editBlocked").prop("checked", !dataRow.find("td.enable-cell i").hasClass("text-success")); $("#editUnlimitedIp").prop("checked", dataRow.find(".unlimited-ip-cell i").hasClass("text-primary")); const passwordInput = $("#editPassword"); diff --git a/core/scripts/webpanel/templates/users.html b/core/scripts/webpanel/templates/users.html index 96decf6..c0c3da6 100644 --- a/core/scripts/webpanel/templates/users.html +++ b/core/scripts/webpanel/templates/users.html @@ -128,8 +128,8 @@ Username Status Traffic Usage - Expiry Date Day Usage + Expiry Date Enable Note Unlimited IP diff --git a/core/scripts/webpanel/templates/users_rows.html b/core/scripts/webpanel/templates/users_rows.html index e10961c..ff473ef 100644 --- a/core/scripts/webpanel/templates/users_rows.html +++ b/core/scripts/webpanel/templates/users_rows.html @@ -12,7 +12,7 @@ {{ loop.index + (offset if offset is defined else 0) }} {{ user.username }} - + {% if user.status == "Online" %} Online {% if user.online_count and user.online_count > 0 %} @@ -28,10 +28,10 @@ {{ user.status }} {% endif %} - {{ user.traffic_used }} - {{ user.expiry_date }} - {{ user.usage_days_display }} - + {{ user.traffic_used }} + {{ user.usage_days_display }} + {{ user.expiry_date }} + {% if user.enable %} {% else %} @@ -99,8 +99,8 @@

Traffic Usage: {{ user.traffic_used }}

-

Expiry Date: {{ user.expiry_date }}

Day Usage: {{ user.usage_days_display }}

+

Expiry Date: {{ user.expiry_date }}

Note: {{ user.note or 'N/A' }}

Enable: