mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
update routes for plugin and session pages
This commit is contained in:
parent
c0261ee487
commit
a085bb5269
24 changed files with 39 additions and 28 deletions
23
src/controllers/session/resetPassword/index.html
Normal file
23
src/controllers/session/resetPassword/index.html
Normal file
|
@ -0,0 +1,23 @@
|
|||
<div data-role="page" class="page standalonePage forgotPasswordPinPage">
|
||||
<div class="padded-left padded-right padded-bottom-page">
|
||||
<form class="forgotPasswordPinForm" style="text-align: center; margin: 0 auto;">
|
||||
<div style="text-align: left;">
|
||||
<h2>${HeaderPasswordReset}</h2>
|
||||
|
||||
<div class="inputContainer">
|
||||
<input is="emby-input" type="text" id="txtPin" label="${LabelPasswordRecoveryPinCode}" autocomplete="off" required="required"/>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<button is="emby-button" type="submit" class="raised submit block">
|
||||
<span>${ButtonSubmit}</span>
|
||||
</button>
|
||||
|
||||
<button is="emby-button" type="button" class="raised cancel block btnCancel" onclick="history.back();">
|
||||
<span>${ButtonCancel}</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
43
src/controllers/session/resetPassword/index.js
Normal file
43
src/controllers/session/resetPassword/index.js
Normal file
|
@ -0,0 +1,43 @@
|
|||
import globalize from 'globalize';
|
||||
|
||||
/* eslint-disable indent */
|
||||
|
||||
function processForgotPasswordResult(result) {
|
||||
if (result.Success) {
|
||||
let msg = globalize.translate('MessagePasswordResetForUsers');
|
||||
msg += '<br/>';
|
||||
msg += '<br/>';
|
||||
msg += result.UsersReset.join('<br/>');
|
||||
return void Dashboard.alert({
|
||||
message: msg,
|
||||
title: globalize.translate('HeaderPasswordReset'),
|
||||
callback: function () {
|
||||
window.location.href = 'index.html';
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Dashboard.alert({
|
||||
message: globalize.translate('MessageInvalidForgotPasswordPin'),
|
||||
title: globalize.translate('HeaderPasswordReset')
|
||||
});
|
||||
}
|
||||
|
||||
export default function (view, params) {
|
||||
function onSubmit(e) {
|
||||
ApiClient.ajax({
|
||||
type: 'POST',
|
||||
url: ApiClient.getUrl('Users/ForgotPassword/Pin'),
|
||||
dataType: 'json',
|
||||
data: {
|
||||
Pin: view.querySelector('#txtPin').value
|
||||
}
|
||||
}).then(processForgotPasswordResult);
|
||||
e.preventDefault();
|
||||
return false;
|
||||
}
|
||||
|
||||
view.querySelector('form').addEventListener('submit', onSubmit);
|
||||
}
|
||||
|
||||
/* eslint-enable indent */
|
Loading…
Add table
Add a link
Reference in a new issue