Work on multi password fix
This commit is contained in:
parent
6fc7fd819f
commit
64de86dcf7
@ -5,9 +5,78 @@ $(document).ready(function () {
|
|||||||
let pass = togglePassword;
|
let pass = togglePassword;
|
||||||
|
|
||||||
if (pass) {
|
if (pass) {
|
||||||
togglePassword.addEventListener("click", function () {
|
togglePassword.addEventListener("click", function () {
|
||||||
// toggle the type attribute
|
// toggle the type attribute
|
||||||
|
const type = password.getAttribute("type") === "password" ? "text" : "password";
|
||||||
|
password.setAttribute("type", type);
|
||||||
|
// toggle the eye icon
|
||||||
|
if (type === "text") {
|
||||||
|
$(this).removeClass("bi-eye");
|
||||||
|
$(this).addClass("bi-eye-slash");
|
||||||
|
} else {
|
||||||
|
$(this).removeClass("bi-eye-slash");
|
||||||
|
$(this).addClass("bi-eye");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
$(document).ready(function () {
|
||||||
|
|
||||||
|
// Get the fields
|
||||||
|
const toggle = document.querySelector("#togglePasswords");
|
||||||
|
const passwords = document.querySelectorAll('[type="password"]');
|
||||||
|
|
||||||
|
|
||||||
|
// listen for click events on the toggle
|
||||||
|
toggle.addEventListener("click", function () {
|
||||||
|
// loop through each password field
|
||||||
|
for (let password of passwords) {
|
||||||
|
// if toggle is checked, change type to "text"
|
||||||
|
// otherwise, change it back to "password"
|
||||||
|
if (toggle.checked) {
|
||||||
|
password.type = "text";
|
||||||
|
} else {
|
||||||
|
password.type = "password";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
$(document).ready(function () {
|
||||||
|
// For each password input
|
||||||
|
$('.sme-password').each(function () {
|
||||||
|
// Create a new container
|
||||||
|
//alert("sme-password");
|
||||||
|
//var $inputContainer = $('<div class="input-container"></div>');
|
||||||
|
|
||||||
|
// Move the input into the new container
|
||||||
|
//$(this).wrap($inputContainer);
|
||||||
|
|
||||||
|
// Create the toggle image
|
||||||
|
//var $togglePassword = $('<img src="images/visible.png" alt="Show Password" class="toggle-password" />');
|
||||||
|
|
||||||
|
// Append the toggle image to the container
|
||||||
|
//$(this).after($togglePassword);
|
||||||
|
});
|
||||||
|
|
||||||
|
$('.toggle-password').on('click', function () {
|
||||||
|
|
||||||
|
alert("toggle-password");
|
||||||
|
// Find the associated password field
|
||||||
|
var input = $(this).siblings('.sme-password');
|
||||||
|
|
||||||
|
// Toggle the type attribute between password and text
|
||||||
|
//var inputType = input.attr('type') === 'password' ? 'text' : 'password';
|
||||||
|
//input.attr('type', inputType);
|
||||||
|
|
||||||
|
// Toggle the icon source based on the input type
|
||||||
|
//var iconSrc = inputType === 'password' ? 'images/visible.png' : 'images/visible-slash.png';
|
||||||
|
//$(this).attr('src', iconSrc);
|
||||||
|
|
||||||
const type = password.getAttribute("type") === "password" ? "text" : "password";
|
const type = password.getAttribute("type") === "password" ? "text" : "password";
|
||||||
|
|
||||||
password.setAttribute("type", type);
|
password.setAttribute("type", type);
|
||||||
// toggle the eye icon
|
// toggle the eye icon
|
||||||
if (type === "text") {
|
if (type === "text") {
|
||||||
@ -17,6 +86,9 @@ $(document).ready(function () {
|
|||||||
$(this).removeClass("bi-eye-slash");
|
$(this).removeClass("bi-eye-slash");
|
||||||
$(this).addClass("bi-eye");
|
$(this).addClass("bi-eye");
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
@ -4,117 +4,115 @@
|
|||||||
|
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
|
|
||||||
% if (config->{debug} == 1) {
|
% if (config->{debug} == 0) {
|
||||||
<p>
|
<pre>
|
||||||
%= dumper $c->current_route
|
<%= dumper $c->current_route %>
|
||||||
%= dumper $pwd_datas
|
<%= dumper $pwd_datas %>
|
||||||
</p>
|
</pre>
|
||||||
% }
|
% }
|
||||||
|
|
||||||
<h2><%= l 'pwd_ACCOUNT_PASSWORD_CHANGE' %></h2>
|
<h2><%= l 'pwd_ACCOUNT_PASSWORD_CHANGE' %></h2>
|
||||||
|
|
||||||
% if ( stash 'error' ) {
|
% if ( stash 'error' ) {
|
||||||
<br>
|
<br>
|
||||||
<div>
|
<div CLASS="text-danvgr">
|
||||||
%= $c->render_to_string(inline => stash 'error')
|
<%= $c->render_to_string(inline => stash 'error') %>
|
||||||
</div>
|
</div>
|
||||||
%}
|
% }
|
||||||
|
|
||||||
|
|
||||||
% my $btn = l('pwd_PASSWORD_CHANGE');
|
% my $btn = l('pwd_PASSWORD_CHANGE');
|
||||||
% my $url = '/userpassword';
|
% my $url = '/userpassword';
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
%= $c->render_to_string( inline => l('pwd_DESCRIPTION'));
|
<%= $c->render_to_string( inline => l('pwd_DESCRIPTION')); %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
% if ( $pwd_datas->{trt} eq 'RESET' ) {
|
% if ( $pwd_datas->{trt} eq 'RESET' ) {
|
||||||
% my $btn = l('pwd_PASSWORD_RESET');
|
% my $btn = l('pwd_PASSWORD_RESET');
|
||||||
% my $url = '/userpasswordr';
|
% my $url = '/userpasswordr';
|
||||||
%= $c->render_to_string( inline => l('pwd_DESCRIPTION_RESET'));
|
<%= $c->render_to_string( inline => l('pwd_DESCRIPTION_RESET')); %>
|
||||||
% }
|
% }
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
|
|
||||||
<!-- Start of Form -->
|
<!-- Start of Form -->
|
||||||
%= form_for $url => (method => 'POST') => begin
|
|
||||||
|
|
||||||
<table class="table table-bordered user-table-max-wdith">
|
<form action="smanager/userpassword" method="POST">
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th class="col-sm">
|
|
||||||
%= l 'pwd_YOUR_ACCOUNT'
|
|
||||||
</th>
|
|
||||||
<th class="col-sm">
|
|
||||||
%=l 'USER_NAME'
|
|
||||||
</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
<tr>
|
|
||||||
<td><%= $pwd_datas->{Account} %></td>
|
|
||||||
<td><%= $pwd_datas->{name} %>Not in pwd_datas-> name ? :-( </td>
|
|
||||||
</tr>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
|
|
||||||
<br>
|
<div class="row g-3 align-items-center">
|
||||||
|
<div class="col-md-1">
|
||||||
% if ( $pwd_datas->{trt} ne 'RESET' ) {
|
<label for="YourAccount" class="col-form-label"><%= l 'pwd_YOUR_ACCOUNT' %></label>
|
||||||
<div>
|
</div>
|
||||||
<%= l 'pwd_PASSWORD_OLD' %>
|
<div class="col-auto">
|
||||||
|
<input type="text" name="Account" id="YourAccount" class="form-control-plaintext" value="<%= $pwd_datas->{Account} %>" readonly>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
|
% if ( $pwd_datas->{trt} ne 'RESET' ) {
|
||||||
|
<div class="row g-3 align-items-center">
|
||||||
|
<div class="col-md-1">
|
||||||
|
<label for="OldPass" class="col-form-label"><%= l 'pwd_PASSWORD_OLD' %></label>
|
||||||
|
</div>
|
||||||
|
<div class="col-auto">
|
||||||
|
<input name="OldPass" type="password" id="OldPass" class="form-control" placeholder="Old Password">
|
||||||
|
</div>
|
||||||
|
<div class="col-auto">
|
||||||
|
<span id="togglePasswordVerify" class="bi bi-eye"></span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<br>
|
||||||
|
% }
|
||||||
|
|
||||||
<div class="row g-3 align-items-center">
|
<div class="row g-3 align-items-center">
|
||||||
<div class="col-md-2">
|
<div class="col-md-1">
|
||||||
<input name="OldPass" id="OldPass" type="password" class="form-control sme-password" placeholder="Password">
|
<label for="Pass" class="col-form-label"><%= l 'pwd_PASSWORD_NEW' %></label>
|
||||||
|
</div>
|
||||||
|
<div class="col-auto">
|
||||||
|
<input name="Pass" type="password" id="Pass" class="form-control" placeholder="New Password">
|
||||||
|
</div>
|
||||||
|
<div class="col-auto">
|
||||||
|
<span id="togglePasswordVerify" class="bi bi-eye"></span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
% }
|
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
<div>
|
<div class="row g-3 align-items-center sme-password">
|
||||||
<%= l 'pwd_PASSWORD_NEW' %>
|
<div class="col-md-1">
|
||||||
</div>
|
<label for="PassVerify" class="col-form-label"><%=l 'pwd_PASSWORD_VERIFY_NEW' %></label>
|
||||||
|
</div>
|
||||||
<br>
|
<div class="col-auto">
|
||||||
|
<input name="Passverify" type="password" id="PassVerify" class="form-control" placeholder="Verify Password">
|
||||||
<div class="row g-3 align-items-center">
|
</div>
|
||||||
<div class="col-md-2">
|
<div class="col-auto">
|
||||||
<input name="Pass" id="Pass" type="password" class="form-control sme-password" placeholder="Password">
|
<span id="togglePassword" class="bi bi-eye"></span>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
%=l 'pwd_PASSWORD_VERIFY_NEW'
|
Show All Passwords Test
|
||||||
</div>
|
<span id="togglePasswords" class="bi bi-eye"></span>
|
||||||
|
|
||||||
<br>
|
|
||||||
|
|
||||||
<div class="row g-3 align-items-center">
|
|
||||||
<div class="col-md-2">
|
|
||||||
<input name="Passverify" id="PassVerify" type="password" class="form-control sme-password" placeholder="Password">
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
<div class="row g-3 align-items-center">
|
<%= hidden_field 'User' => $pwd_datas->{Account} %>
|
||||||
<div class="col-md-2">
|
<%= hidden_field 'Trt' => $pwd_datas->{trt} %>
|
||||||
<button type="submit" class="btn btn-primary btn-sm"><%= $btn %></button>
|
<%= hidden_field 'jwt' => $pwd_datas->{jwt} %>
|
||||||
|
|
||||||
|
<div class="row g-3 align-items-center">
|
||||||
|
<div class="col-md-1">
|
||||||
|
<button type="submit" class="btn btn-primary btn-sm"><%= $btn %></button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
%= hidden_field 'User' => $pwd_datas->{Account}
|
</form>
|
||||||
%= hidden_field 'Trt' => $pwd_datas->{trt}
|
|
||||||
%= hidden_field 'jwt' => $pwd_datas->{jwt}
|
|
||||||
|
|
||||||
% end
|
|
||||||
<!-- End of Form -->
|
<!-- End of Form -->
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
%define name smeserver-manager-AdminLTE
|
%define name smeserver-manager-AdminLTE
|
||||||
%define version 11.0.0
|
%define version 11.0.0
|
||||||
%define release 46
|
%define release 47
|
||||||
|
|
||||||
Summary: AdminLTE is an html framework for admin consoles - this rpm adds it to smeserver manager2
|
Summary: AdminLTE is an html framework for admin consoles - this rpm adds it to smeserver manager2
|
||||||
Name: %{name}
|
Name: %{name}
|
||||||
@ -17,7 +17,7 @@ BuildArchitectures: noarch
|
|||||||
BuildRoot: /var/tmp/%{name}-%{version}-%{release}-buildroot
|
BuildRoot: /var/tmp/%{name}-%{version}-%{release}-buildroot
|
||||||
BuildRequires: smeserver-devtools
|
BuildRequires: smeserver-devtools
|
||||||
Requires: smeserver-release >= 11.0
|
Requires: smeserver-release >= 11.0
|
||||||
Requires: smeserver-manager >= 11.0.0-101
|
Requires: smeserver-manager >= 11.0.0-104
|
||||||
Requires: smeserver-lib >= 11.0.0-13
|
Requires: smeserver-lib >= 11.0.0-13
|
||||||
Requires: e-smith-manager >= 2.4.0-22
|
Requires: e-smith-manager >= 2.4.0-22
|
||||||
|
|
||||||
@ -29,6 +29,9 @@ AdminLTE is an html framework for admin consoles
|
|||||||
wget https://github.com/ColorlibHQ/AdminLTE/archive/master.zip
|
wget https://github.com/ColorlibHQ/AdminLTE/archive/master.zip
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Tue Jul 08 2025 John Crisp <jcrisp@safeandsoundit.co.uk> 11.0.0-47.sme
|
||||||
|
- Working on multipassword show/hide
|
||||||
|
|
||||||
* Mon Jul 07 2025 John Crisp <jcrisp@safeandsoundit.co.uk> 11.0.0-46.sme
|
* Mon Jul 07 2025 John Crisp <jcrisp@safeandsoundit.co.uk> 11.0.0-46.sme
|
||||||
- Too fast on the build button and missed some files
|
- Too fast on the build button and missed some files
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user