feat(webpanel): make edit user username readonly
This commit is contained in:
@ -52,7 +52,7 @@ $(function () {
|
||||
$(inputElement).closest('form').find('button[type="submit"]').prop('disabled', !isValid);
|
||||
}
|
||||
|
||||
$('#addUsername, #addBulkPrefix, #editUsername').on('input', function() {
|
||||
$('#addUsername, #addBulkPrefix').on('input', function() {
|
||||
validateUsername(this, `#${this.id}Error`);
|
||||
});
|
||||
|
||||
@ -153,7 +153,6 @@ $(function () {
|
||||
$("#editExpirationDays").val(parseInt(expiryText) || 0);
|
||||
$("#editBlocked").prop("checked", !dataRow.find("td:eq(8) i").hasClass("text-success"));
|
||||
$("#editUnlimitedIp").prop("checked", dataRow.find(".unlimited-ip-cell i").hasClass("text-primary"));
|
||||
validateUsername('#editUsername', '#editUsernameError');
|
||||
});
|
||||
|
||||
$("#editUserForm").on("submit", function (e) {
|
||||
@ -166,7 +165,6 @@ $(function () {
|
||||
const jsonData = Object.fromEntries(formData.entries());
|
||||
jsonData.blocked = jsonData.blocked === 'on';
|
||||
jsonData.unlimited_ip = jsonData.unlimited_ip === 'on';
|
||||
if (jsonData.new_username === originalUsername) delete jsonData.new_username;
|
||||
|
||||
$.ajax({
|
||||
url: url,
|
||||
|
||||
@ -441,8 +441,12 @@
|
||||
<form id="editUserForm">
|
||||
<div class="form-group">
|
||||
<label for="editUsername">Username</label>
|
||||
<input type="text" class="form-control" id="editUsername" name="new_username">
|
||||
<small class="form-text text-danger" id="editUsernameError"></small>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fas fa-user"></i></span>
|
||||
</div>
|
||||
<input type="text" class="form-control" id="editUsername" readonly>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="editTrafficLimit">Traffic Limit (GB)</label>
|
||||
|
||||
Reference in New Issue
Block a user