mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Add show password button to wizardUserPage
This commit is contained in:
parent
655156d37c
commit
d636b15d88
3 changed files with 43 additions and 0 deletions
|
@ -12,10 +12,16 @@
|
|||
</div>
|
||||
<div class="inputContainer">
|
||||
<input is="emby-input" id="txtManualPassword" type="password" label="${LabelPassword}" required="required" />
|
||||
<button is="paper-icon-button-light" class="passwordToggle" type="button">
|
||||
<span class="material-icons visibility"></span>
|
||||
</button>
|
||||
<div class="fieldDescription">${PasswordRequiredForAdmin}</div>
|
||||
</div>
|
||||
<div class="inputContainer">
|
||||
<input is="emby-input" id="txtPasswordConfirm" type="password" label="${LabelPasswordConfirm}" required="required" />
|
||||
<button is="paper-icon-button-light" class="passwordToggle" type="button">
|
||||
<span class="material-icons visibility"></span>
|
||||
</button>
|
||||
</div>
|
||||
<p>${MoreUsersCanBeAddedLater}</p>
|
||||
</div>
|
||||
|
|
|
@ -5,6 +5,7 @@ import '../../../elements/emby-input/emby-input';
|
|||
import '../../../elements/emby-button/emby-button';
|
||||
import Dashboard from '../../../utils/dashboard';
|
||||
import toast from '../../../components/toast/toast';
|
||||
import './user.scss';
|
||||
|
||||
function getApiClient() {
|
||||
return ApiClient;
|
||||
|
@ -71,6 +72,16 @@ function onViewShow() {
|
|||
});
|
||||
}
|
||||
|
||||
function togglePassword() {
|
||||
const inputIds = ['txtManualPassword', 'txtPasswordConfirm'];
|
||||
inputIds.forEach(id => {
|
||||
const input = document.getElementById(id);
|
||||
if (input) {
|
||||
input.type = (input.type === 'password') ? 'text' : 'password';
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
export default function (view) {
|
||||
view.querySelector('.wizardUserForm').addEventListener('submit', onSubmit);
|
||||
view.addEventListener('viewshow', function () {
|
||||
|
@ -80,4 +91,7 @@ export default function (view) {
|
|||
document.querySelector('.skinHeader').classList.remove('noHomeButtonHeader');
|
||||
});
|
||||
view.addEventListener('viewshow', onViewShow);
|
||||
view.querySelectorAll('.passwordToggle').forEach(button => {
|
||||
button.addEventListener('click', togglePassword);
|
||||
});
|
||||
}
|
||||
|
|
23
src/controllers/wizard/user/user.scss
Normal file
23
src/controllers/wizard/user/user.scss
Normal file
|
@ -0,0 +1,23 @@
|
|||
.inputContainer {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.passwordToggle {
|
||||
position: absolute;
|
||||
width: 3em;
|
||||
height: 3em;
|
||||
top: 2.95em;
|
||||
transform: translateY(-50%);
|
||||
right: 0.1em;
|
||||
background: none;
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
padding: 0.1em;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.passwordToggle .material-icons {
|
||||
font-size: 1.8em;
|
||||
color: #666;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue