feat(webpanel): integrate user note functionality into UI

This commit is contained in:
ReturnFI
2025-10-28 16:37:59 +00:00
parent 886516a6f6
commit 1e763781ce
2 changed files with 17 additions and 0 deletions

View File

@ -146,11 +146,13 @@ $(function () {
const trafficText = dataRow.find("td:eq(4)").text(); const trafficText = dataRow.find("td:eq(4)").text();
const expiryText = dataRow.find("td:eq(6)").text(); const expiryText = dataRow.find("td:eq(6)").text();
const note = dataRow.find(".note-cell").data('note');
$("#originalUsername").val(user); $("#originalUsername").val(user);
$("#editUsername").val(user); $("#editUsername").val(user);
$("#editTrafficLimit").val(parseFloat(trafficText.split('/')[1]) || 0); $("#editTrafficLimit").val(parseFloat(trafficText.split('/')[1]) || 0);
$("#editExpirationDays").val(parseInt(expiryText) || 0); $("#editExpirationDays").val(parseInt(expiryText) || 0);
$("#editNote").val(note || '');
$("#editBlocked").prop("checked", !dataRow.find("td:eq(8) i").hasClass("text-success")); $("#editBlocked").prop("checked", !dataRow.find("td:eq(8) i").hasClass("text-success"));
$("#editUnlimitedIp").prop("checked", dataRow.find(".unlimited-ip-cell i").hasClass("text-primary")); $("#editUnlimitedIp").prop("checked", dataRow.find(".unlimited-ip-cell i").hasClass("text-primary"));
}); });

View File

@ -135,6 +135,7 @@
<th class="d-none d-md-table-cell text-nowrap">Expiry Days</th> <th class="d-none d-md-table-cell text-nowrap">Expiry Days</th>
<th class="d-none d-md-table-cell text-nowrap">Day Usage</th> <th class="d-none d-md-table-cell text-nowrap">Day Usage</th>
<th class="d-none d-md-table-cell">Enable</th> <th class="d-none d-md-table-cell">Enable</th>
<th class="d-none d-md-table-cell">Note</th>
<th class="d-none d-md-table-cell text-nowrap requires-iplimit-service" style="display: none;">Unlimited IP</th> <th class="d-none d-md-table-cell text-nowrap requires-iplimit-service" style="display: none;">Unlimited IP</th>
<th class="d-none d-md-table-cell text-nowrap">Configs</th> <th class="d-none d-md-table-cell text-nowrap">Configs</th>
<th class="d-none d-md-table-cell text-nowrap">Actions</th> <th class="d-none d-md-table-cell text-nowrap">Actions</th>
@ -176,6 +177,11 @@
<i class="fas fa-times-circle text-danger"></i> <i class="fas fa-times-circle text-danger"></i>
{% endif %} {% endif %}
</td> </td>
<td class="d-none d-md-table-cell note-cell" data-note="{{ user.note or '' }}">
{% if user.note %}
<span title="{{ user.note }}">{{ user.note | truncate(20, True) }}</span>
{% endif %}
</td>
<td class="d-none d-md-table-cell unlimited-ip-cell requires-iplimit-service" style="display: none;"> <td class="d-none d-md-table-cell unlimited-ip-cell requires-iplimit-service" style="display: none;">
{% if user.unlimited_ip %} {% if user.unlimited_ip %}
<i class="fas fa-shield-alt text-primary"></i> <i class="fas fa-shield-alt text-primary"></i>
@ -235,6 +241,7 @@
<p><strong>Expiry Date:</strong> <span>{{ user.expiry_date }}</span></p> <p><strong>Expiry Date:</strong> <span>{{ user.expiry_date }}</span></p>
<p><strong>Expiry Days:</strong> <span>{{ user.expiry_days }}</span></p> <p><strong>Expiry Days:</strong> <span>{{ user.expiry_days }}</span></p>
<p><strong>Day Usage:</strong> <span>{{ user.day_usage }}</span></p> <p><strong>Day Usage:</strong> <span>{{ user.day_usage }}</span></p>
<p><strong>Note:</strong> <span>{{ user.note or 'N/A' }}</span></p>
<p><strong>Enable:</strong> <p><strong>Enable:</strong>
<span> <span>
{% if user.enable %} {% if user.enable %}
@ -383,6 +390,10 @@
<label for="addExpirationDays">Expiration Days</label> <label for="addExpirationDays">Expiration Days</label>
<input type="number" class="form-control" id="addExpirationDays" name="expiration_days" required> <input type="number" class="form-control" id="addExpirationDays" name="expiration_days" required>
</div> </div>
<div class="form-group">
<label for="addNote">Note (Optional)</label>
<input type="text" class="form-control" id="addNote" name="note">
</div>
<div class="form-check mb-3 requires-iplimit-service" style="display: none;"> <div class="form-check mb-3 requires-iplimit-service" style="display: none;">
<input type="checkbox" class="form-check-input" id="addUnlimited" name="unlimited"> <input type="checkbox" class="form-check-input" id="addUnlimited" name="unlimited">
<label class="form-check-label" for="addUnlimited">Unlimited IP</label> <label class="form-check-label" for="addUnlimited">Unlimited IP</label>
@ -469,6 +480,10 @@
<input type="number" class="form-control" id="editExpirationDays" name="new_expiration_days"> <input type="number" class="form-control" id="editExpirationDays" name="new_expiration_days">
</div> </div>
</div> </div>
<div class="form-group">
<label for="editNote">Note</label>
<textarea class="form-control" id="editNote" name="note" rows="3"></textarea>
</div>
<div class="form-check"> <div class="form-check">
<input type="checkbox" class="form-check-input" id="editBlocked" name="blocked"> <input type="checkbox" class="form-check-input" id="editBlocked" name="blocked">
<label class="form-check-label" for="editBlocked"> <label class="form-check-label" for="editBlocked">