2024-06-02 20:58:11 +03:00
|
|
|
import React, { useCallback, useEffect, useState } from 'react';
|
2023-05-01 16:50:41 -04:00
|
|
|
|
|
|
|
import SectionTabs from '../../../../components/dashboard/users/SectionTabs';
|
|
|
|
import UserPasswordForm from '../../../../components/dashboard/users/UserPasswordForm';
|
|
|
|
import { getParameterByName } from '../../../../utils/url';
|
|
|
|
import SectionTitleContainer from '../../../../elements/SectionTitleContainer';
|
|
|
|
import Page from '../../../../components/Page';
|
|
|
|
import loading from '../../../../components/loading/loading';
|
2022-01-05 20:35:58 +03:00
|
|
|
|
2024-06-02 20:58:11 +03:00
|
|
|
const UserPassword = () => {
|
2022-04-11 11:20:53 -04:00
|
|
|
const userId = getParameterByName('userId');
|
2022-01-05 20:35:58 +03:00
|
|
|
const [ userName, setUserName ] = useState('');
|
|
|
|
|
2022-03-03 03:37:56 +03:00
|
|
|
const loadUser = useCallback(() => {
|
2022-06-29 04:16:20 +03:00
|
|
|
loading.show();
|
2022-03-03 03:37:56 +03:00
|
|
|
window.ApiClient.getUser(userId).then(function (user) {
|
|
|
|
if (!user.Name) {
|
|
|
|
throw new Error('Unexpected null user.Name');
|
|
|
|
}
|
2022-01-05 20:35:58 +03:00
|
|
|
setUserName(user.Name);
|
2022-06-29 04:16:20 +03:00
|
|
|
loading.hide();
|
2023-05-02 11:24:53 -04:00
|
|
|
}).catch(err => {
|
|
|
|
console.error('[userpassword] failed to fetch user', err);
|
2022-01-05 20:35:58 +03:00
|
|
|
});
|
|
|
|
}, [userId]);
|
2022-03-03 03:37:56 +03:00
|
|
|
useEffect(() => {
|
|
|
|
loadUser();
|
|
|
|
}, [loadUser]);
|
2022-01-05 20:35:58 +03:00
|
|
|
|
|
|
|
return (
|
2022-06-29 03:31:55 +03:00
|
|
|
<Page
|
|
|
|
id='userPasswordPage'
|
|
|
|
className='mainAnimatedPage type-interior userPasswordPage'
|
|
|
|
>
|
2022-01-05 20:35:58 +03:00
|
|
|
<div className='content-primary'>
|
2022-06-29 02:17:10 +03:00
|
|
|
<div className='verticalSection'>
|
|
|
|
<SectionTitleContainer
|
|
|
|
title={userName}
|
2022-10-22 13:23:04 +02:00
|
|
|
url='https://jellyfin.org/docs/general/server/users/'
|
2022-06-29 02:17:10 +03:00
|
|
|
/>
|
|
|
|
</div>
|
2022-01-05 20:35:58 +03:00
|
|
|
<SectionTabs activeTab='userpassword'/>
|
|
|
|
<div className='readOnlyContent'>
|
|
|
|
<UserPasswordForm
|
|
|
|
userId={userId}
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
</div>
|
2022-06-29 03:31:55 +03:00
|
|
|
</Page>
|
|
|
|
|
2022-01-05 20:35:58 +03:00
|
|
|
);
|
|
|
|
};
|
|
|
|
|
2022-06-29 23:35:56 +03:00
|
|
|
export default UserPassword;
|