1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00
jellyfin-web/src/routes/user/useredit.tsx

587 lines
30 KiB
TypeScript
Raw Normal View History

2022-09-16 12:47:59 -04:00
import type { SyncPlayUserAccessType, UserDto } from '@jellyfin/sdk/lib/generated-client';
2021-11-13 21:05:37 +03:00
import React, { FunctionComponent, useCallback, useEffect, useState, useRef } from 'react';
2022-06-29 23:35:56 +03:00
import Dashboard from '../../utils/dashboard';
import globalize from '../../scripts/globalize';
import LibraryMenu from '../../scripts/libraryMenu';
import ButtonElement from '../../elements/ButtonElement';
import CheckBoxElement from '../../elements/CheckBoxElement';
import InputElement from '../../elements/InputElement';
import LinkEditUserPreferences from '../../components/dashboard/users/LinkEditUserPreferences';
import SectionTitleContainer from '../../elements/SectionTitleContainer';
import SectionTabs from '../../components/dashboard/users/SectionTabs';
import loading from '../../components/loading/loading';
import toast from '../../components/toast/toast';
import { getParameterByName } from '../../utils/url';
2022-06-29 02:17:10 +03:00
import escapeHTML from 'escape-html';
2022-06-29 23:35:56 +03:00
import SelectElement from '../../elements/SelectElement';
import Page from '../../components/Page';
2021-10-15 23:38:03 +03:00
2022-07-07 23:51:59 +03:00
type ResetProvider = AuthProvider & {
2021-10-15 23:38:03 +03:00
checkedAttribute: string
}
2022-07-07 23:51:59 +03:00
type AuthProvider = {
2022-06-29 02:17:10 +03:00
Name?: string;
Id?: string;
}
2022-06-29 23:35:56 +03:00
const UserEdit: FunctionComponent = () => {
2021-10-15 23:38:03 +03:00
const [ userName, setUserName ] = useState('');
2022-07-07 23:51:59 +03:00
const [ deleteFoldersAccess, setDeleteFoldersAccess ] = useState<ResetProvider[]>([]);
const [ authProviders, setAuthProviders ] = useState<AuthProvider[]>([]);
const [ passwordResetProviders, setPasswordResetProviders ] = useState<ResetProvider[]>([]);
2021-10-15 23:38:03 +03:00
const [ authenticationProviderId, setAuthenticationProviderId ] = useState('');
const [ passwordResetProviderId, setPasswordResetProviderId ] = useState('');
2022-02-15 23:47:59 +03:00
const element = useRef<HTMLDivElement>(null);
2021-10-15 23:38:03 +03:00
2022-02-18 14:27:39 +03:00
const triggerChange = (select: HTMLInputElement) => {
2021-11-13 21:05:37 +03:00
const evt = document.createEvent('HTMLEvents');
evt.initEvent('change', false, true);
select.dispatchEvent(evt);
};
2021-10-15 23:38:03 +03:00
2021-11-13 21:05:37 +03:00
const getUser = () => {
const userId = getParameterByName('userId');
2021-11-13 21:05:37 +03:00
return window.ApiClient.getUser(userId);
};
2021-10-15 23:38:03 +03:00
2021-11-13 21:05:37 +03:00
const loadAuthProviders = useCallback((user, providers) => {
const page = element.current;
if (!page) {
console.error('Unexpected null reference');
return;
}
2022-02-16 22:01:13 +03:00
const fldSelectLoginProvider = page.querySelector('.fldSelectLoginProvider') as HTMLDivElement;
2021-11-13 21:05:37 +03:00
providers.length > 1 ? fldSelectLoginProvider.classList.remove('hide') : fldSelectLoginProvider.classList.add('hide');
2021-10-15 23:38:03 +03:00
2021-11-13 21:05:37 +03:00
setAuthProviders(providers);
2021-10-15 23:38:03 +03:00
2021-11-13 21:05:37 +03:00
const currentProviderId = user.Policy.AuthenticationProviderId;
setAuthenticationProviderId(currentProviderId);
}, []);
2021-10-15 23:38:03 +03:00
2021-11-13 21:05:37 +03:00
const loadPasswordResetProviders = useCallback((user, providers) => {
const page = element.current;
if (!page) {
console.error('Unexpected null reference');
return;
}
2022-02-16 22:01:13 +03:00
const fldSelectPasswordResetProvider = page.querySelector('.fldSelectPasswordResetProvider') as HTMLDivElement;
2021-11-13 21:05:37 +03:00
providers.length > 1 ? fldSelectPasswordResetProvider.classList.remove('hide') : fldSelectPasswordResetProvider.classList.add('hide');
2021-10-15 23:38:03 +03:00
2021-11-13 21:05:37 +03:00
setPasswordResetProviders(providers);
2021-10-15 23:38:03 +03:00
2021-11-13 21:05:37 +03:00
const currentProviderId = user.Policy.PasswordResetProviderId;
setPasswordResetProviderId(currentProviderId);
}, []);
2021-10-15 23:38:03 +03:00
2021-11-13 21:05:37 +03:00
const loadDeleteFolders = useCallback((user, mediaFolders) => {
const page = element.current;
if (!page) {
console.error('Unexpected null reference');
return;
}
2021-11-13 21:05:37 +03:00
window.ApiClient.getJSON(window.ApiClient.getUrl('Channels', {
SupportsMediaDeletion: true
})).then(function (channelsResult) {
let isChecked;
let checkedAttribute;
2022-07-07 23:51:59 +03:00
const itemsArr: ResetProvider[] = [];
2021-11-13 21:05:37 +03:00
for (const folder of mediaFolders) {
isChecked = user.Policy.EnableContentDeletion || user.Policy.EnableContentDeletionFromFolders.indexOf(folder.Id) != -1;
checkedAttribute = isChecked ? ' checked="checked"' : '';
itemsArr.push({
Id: folder.Id,
Name: folder.Name,
checkedAttribute: checkedAttribute
});
}
2021-10-15 23:38:03 +03:00
2021-11-13 21:05:37 +03:00
for (const folder of channelsResult.Items) {
isChecked = user.Policy.EnableContentDeletion || user.Policy.EnableContentDeletionFromFolders.indexOf(folder.Id) != -1;
checkedAttribute = isChecked ? ' checked="checked"' : '';
itemsArr.push({
Id: folder.Id,
Name: folder.Name,
checkedAttribute: checkedAttribute
});
}
2021-10-15 23:38:03 +03:00
2021-11-13 21:05:37 +03:00
setDeleteFoldersAccess(itemsArr);
2021-10-15 23:38:03 +03:00
2022-02-16 22:01:13 +03:00
const chkEnableDeleteAllFolders = page.querySelector('.chkEnableDeleteAllFolders') as HTMLInputElement;
2021-11-13 21:05:37 +03:00
chkEnableDeleteAllFolders.checked = user.Policy.EnableContentDeletion;
triggerChange(chkEnableDeleteAllFolders);
});
}, []);
2021-10-15 23:38:03 +03:00
2021-11-13 21:05:37 +03:00
const loadUser = useCallback((user) => {
const page = element.current;
if (!page) {
console.error('Unexpected null reference');
return;
}
2021-11-13 21:05:37 +03:00
window.ApiClient.getJSON(window.ApiClient.getUrl('Auth/Providers')).then(function (providers) {
loadAuthProviders(user, providers);
});
window.ApiClient.getJSON(window.ApiClient.getUrl('Auth/PasswordResetProviders')).then(function (providers) {
loadPasswordResetProviders(user, providers);
});
window.ApiClient.getJSON(window.ApiClient.getUrl('Library/MediaFolders', {
IsHidden: false
})).then(function (folders) {
loadDeleteFolders(user, folders.Items);
});
2022-02-16 22:01:13 +03:00
const disabledUserBanner = page.querySelector('.disabledUserBanner') as HTMLDivElement;
2021-11-13 21:05:37 +03:00
user.Policy.IsDisabled ? disabledUserBanner.classList.remove('hide') : disabledUserBanner.classList.add('hide');
2022-02-16 22:01:13 +03:00
const txtUserName = page.querySelector('#txtUserName') as HTMLInputElement;
2022-02-16 01:12:12 +03:00
txtUserName.disabled = false;
2021-11-13 21:05:37 +03:00
txtUserName.removeAttribute('disabled');
2022-02-16 22:01:13 +03:00
const lnkEditUserPreferences = page.querySelector('.lnkEditUserPreferences') as HTMLDivElement;
2021-11-13 21:05:37 +03:00
lnkEditUserPreferences.setAttribute('href', 'mypreferencesmenu.html?userId=' + user.Id);
LibraryMenu.setTitle(user.Name);
setUserName(user.Name);
2022-02-16 22:01:13 +03:00
(page.querySelector('#txtUserName') as HTMLInputElement).value = user.Name;
(page.querySelector('.chkIsAdmin') as HTMLInputElement).checked = user.Policy.IsAdministrator;
(page.querySelector('.chkDisabled') as HTMLInputElement).checked = user.Policy.IsDisabled;
(page.querySelector('.chkIsHidden') as HTMLInputElement).checked = user.Policy.IsHidden;
2023-01-08 19:38:01 +01:00
(page.querySelector('.chkEnableCollectionManagement') as HTMLInputElement).checked = user.Policy.EnableCollectionManagement;
2022-02-16 22:01:13 +03:00
(page.querySelector('.chkRemoteControlSharedDevices') as HTMLInputElement).checked = user.Policy.EnableSharedDeviceControl;
(page.querySelector('.chkEnableRemoteControlOtherUsers') as HTMLInputElement).checked = user.Policy.EnableRemoteControlOfOtherUsers;
(page.querySelector('.chkEnableDownloading') as HTMLInputElement).checked = user.Policy.EnableContentDownloading;
(page.querySelector('.chkManageLiveTv') as HTMLInputElement).checked = user.Policy.EnableLiveTvManagement;
(page.querySelector('.chkEnableLiveTvAccess') as HTMLInputElement).checked = user.Policy.EnableLiveTvAccess;
(page.querySelector('.chkEnableMediaPlayback') as HTMLInputElement).checked = user.Policy.EnableMediaPlayback;
(page.querySelector('.chkEnableAudioPlaybackTranscoding') as HTMLInputElement).checked = user.Policy.EnableAudioPlaybackTranscoding;
(page.querySelector('.chkEnableVideoPlaybackTranscoding') as HTMLInputElement).checked = user.Policy.EnableVideoPlaybackTranscoding;
(page.querySelector('.chkEnableVideoPlaybackRemuxing') as HTMLInputElement).checked = user.Policy.EnablePlaybackRemuxing;
(page.querySelector('.chkForceRemoteSourceTranscoding') as HTMLInputElement).checked = user.Policy.ForceRemoteSourceTranscoding;
(page.querySelector('.chkRemoteAccess') as HTMLInputElement).checked = user.Policy.EnableRemoteAccess == null || user.Policy.EnableRemoteAccess;
2022-02-16 01:12:12 +03:00
(page.querySelector('#txtRemoteClientBitrateLimit') as HTMLInputElement).value = user.Policy.RemoteClientBitrateLimit > 0 ?
2023-03-29 00:38:22 -04:00
(user.Policy.RemoteClientBitrateLimit / 1e6).toLocaleString(undefined, { maximumFractionDigits: 6 }) : '';
2022-02-16 22:01:13 +03:00
(page.querySelector('#txtLoginAttemptsBeforeLockout') as HTMLInputElement).value = user.Policy.LoginAttemptsBeforeLockout || '0';
(page.querySelector('#txtMaxActiveSessions') as HTMLInputElement).value = user.Policy.MaxActiveSessions || '0';
2021-11-13 21:05:37 +03:00
if (window.ApiClient.isMinServerVersion('10.6.0')) {
2022-06-29 02:17:10 +03:00
(page.querySelector('#selectSyncPlayAccess') as HTMLSelectElement).value = user.Policy.SyncPlayAccess;
2021-11-13 21:05:37 +03:00
}
loading.hide();
}, [loadAuthProviders, loadPasswordResetProviders, loadDeleteFolders ]);
const loadData = useCallback(() => {
loading.show();
getUser().then(function (user) {
loadUser(user);
});
}, [loadUser]);
useEffect(() => {
const page = element.current;
if (!page) {
console.error('Unexpected null reference');
return;
}
2021-11-13 21:05:37 +03:00
loadData();
2021-10-15 23:38:03 +03:00
function onSaveComplete() {
Dashboard.navigate('userprofiles.html');
loading.hide();
toast(globalize.translate('SettingsSaved'));
}
2022-02-18 14:27:39 +03:00
const saveUser = (user: UserDto) => {
if (!user.Id) {
throw new Error('Unexpected null user.Id');
}
if (!user.Policy) {
throw new Error('Unexpected null user.Policy');
}
2022-02-16 22:01:13 +03:00
user.Name = (page.querySelector('#txtUserName') as HTMLInputElement).value;
user.Policy.IsAdministrator = (page.querySelector('.chkIsAdmin') as HTMLInputElement).checked;
user.Policy.IsHidden = (page.querySelector('.chkIsHidden') as HTMLInputElement).checked;
user.Policy.IsDisabled = (page.querySelector('.chkDisabled') as HTMLInputElement).checked;
user.Policy.EnableRemoteControlOfOtherUsers = (page.querySelector('.chkEnableRemoteControlOtherUsers') as HTMLInputElement).checked;
user.Policy.EnableLiveTvManagement = (page.querySelector('.chkManageLiveTv') as HTMLInputElement).checked;
user.Policy.EnableLiveTvAccess = (page.querySelector('.chkEnableLiveTvAccess') as HTMLInputElement).checked;
user.Policy.EnableSharedDeviceControl = (page.querySelector('.chkRemoteControlSharedDevices') as HTMLInputElement).checked;
user.Policy.EnableMediaPlayback = (page.querySelector('.chkEnableMediaPlayback') as HTMLInputElement).checked;
user.Policy.EnableAudioPlaybackTranscoding = (page.querySelector('.chkEnableAudioPlaybackTranscoding') as HTMLInputElement).checked;
user.Policy.EnableVideoPlaybackTranscoding = (page.querySelector('.chkEnableVideoPlaybackTranscoding') as HTMLInputElement).checked;
user.Policy.EnablePlaybackRemuxing = (page.querySelector('.chkEnableVideoPlaybackRemuxing') as HTMLInputElement).checked;
2023-01-08 19:38:01 +01:00
user.Policy.EnableCollectionManagement = (page.querySelector('.chkEnableCollectionManagement') as HTMLInputElement).checked;
2022-02-16 22:01:13 +03:00
user.Policy.ForceRemoteSourceTranscoding = (page.querySelector('.chkForceRemoteSourceTranscoding') as HTMLInputElement).checked;
user.Policy.EnableContentDownloading = (page.querySelector('.chkEnableDownloading') as HTMLInputElement).checked;
user.Policy.EnableRemoteAccess = (page.querySelector('.chkRemoteAccess') as HTMLInputElement).checked;
user.Policy.RemoteClientBitrateLimit = Math.floor(1e6 * parseFloat((page.querySelector('#txtRemoteClientBitrateLimit') as HTMLInputElement).value || '0'));
2023-03-09 00:01:05 -05:00
user.Policy.LoginAttemptsBeforeLockout = parseInt((page.querySelector('#txtLoginAttemptsBeforeLockout') as HTMLInputElement).value || '0', 10);
user.Policy.MaxActiveSessions = parseInt((page.querySelector('#txtMaxActiveSessions') as HTMLInputElement).value || '0', 10);
2022-06-29 02:17:10 +03:00
user.Policy.AuthenticationProviderId = (page.querySelector('#selectLoginProvider') as HTMLSelectElement).value;
user.Policy.PasswordResetProviderId = (page.querySelector('#selectPasswordResetProvider') as HTMLSelectElement).value;
2022-02-16 22:01:13 +03:00
user.Policy.EnableContentDeletion = (page.querySelector('.chkEnableDeleteAllFolders') as HTMLInputElement).checked;
user.Policy.EnableContentDeletionFromFolders = user.Policy.EnableContentDeletion ? [] : Array.prototype.filter.call(page.querySelectorAll('.chkFolder'), function (c) {
2021-10-15 23:38:03 +03:00
return c.checked;
}).map(function (c) {
return c.getAttribute('data-id');
});
if (window.ApiClient.isMinServerVersion('10.6.0')) {
2022-06-29 02:17:10 +03:00
user.Policy.SyncPlayAccess = (page.querySelector('#selectSyncPlayAccess') as HTMLSelectElement).value as SyncPlayUserAccessType;
2021-10-15 23:38:03 +03:00
}
window.ApiClient.updateUser(user).then(function () {
window.ApiClient.updateUserPolicy(user.Id || '', user.Policy || {}).then(function () {
2021-10-15 23:38:03 +03:00
onSaveComplete();
});
});
};
2022-02-18 14:27:39 +03:00
const onSubmit = (e: Event) => {
2021-10-15 23:38:03 +03:00
loading.show();
getUser().then(function (result) {
saveUser(result);
});
e.preventDefault();
e.stopPropagation();
return false;
};
2022-02-16 22:01:13 +03:00
(page.querySelector('.chkEnableDeleteAllFolders') as HTMLInputElement).addEventListener('change', function (this: HTMLInputElement) {
2021-10-15 23:38:03 +03:00
if (this.checked) {
2022-02-16 22:01:13 +03:00
(page.querySelector('.deleteAccess') as HTMLDivElement).classList.add('hide');
2021-10-15 23:38:03 +03:00
} else {
2022-02-16 22:01:13 +03:00
(page.querySelector('.deleteAccess') as HTMLDivElement).classList.remove('hide');
2021-10-15 23:38:03 +03:00
}
});
window.ApiClient.getNamedConfiguration('network').then(function (config) {
2022-02-16 22:01:13 +03:00
const fldRemoteAccess = page.querySelector('.fldRemoteAccess') as HTMLDivElement;
2021-10-15 23:38:03 +03:00
config.EnableRemoteAccess ? fldRemoteAccess.classList.remove('hide') : fldRemoteAccess.classList.add('hide');
});
2022-02-16 22:01:13 +03:00
(page.querySelector('.editUserProfileForm') as HTMLFormElement).addEventListener('submit', onSubmit);
2021-10-15 23:38:03 +03:00
2022-06-29 02:17:10 +03:00
(page.querySelector('#btnCancel') as HTMLButtonElement).addEventListener('click', function() {
2021-10-15 23:38:03 +03:00
window.history.back();
});
2021-11-13 21:05:37 +03:00
}, [loadData]);
2021-10-15 23:38:03 +03:00
2022-06-29 02:17:10 +03:00
const optionLoginProvider = authProviders.map((provider) => {
const selected = provider.Id === authenticationProviderId || authProviders.length < 2 ? ' selected' : '';
return `<option value="${provider.Id}"${selected}>${escapeHTML(provider.Name)}</option>`;
});
const optionPasswordResetProvider = passwordResetProviders.map((provider) => {
const selected = provider.Id === passwordResetProviderId || passwordResetProviders.length < 2 ? ' selected' : '';
return `<option value="${provider.Id}"${selected}>${escapeHTML(provider.Name)}</option>`;
});
const optionSyncPlayAccess = () => {
let content = '';
content += `<option value='CreateAndJoinGroups'>${globalize.translate('LabelSyncPlayAccessCreateAndJoinGroups')}</option>`;
content += `<option value='JoinGroups'>${globalize.translate('LabelSyncPlayAccessJoinGroups')}</option>`;
content += `<option value='None'>${globalize.translate('LabelSyncPlayAccessNone')}</option>`;
return content;
};
2021-10-15 23:38:03 +03:00
return (
2022-06-29 03:16:05 +03:00
<Page
id='editUserPage'
className='mainAnimatedPage type-interior'
>
<div ref={element} className='content-primary'>
2022-06-29 02:17:10 +03:00
<div className='verticalSection'>
<SectionTitleContainer
title={userName}
url='https://jellyfin.org/docs/general/server/users/'
2022-06-29 02:17:10 +03:00
/>
</div>
2022-01-02 02:40:11 +03:00
<SectionTabs activeTab='useredit'/>
2021-10-15 23:38:03 +03:00
<div
className='lnkEditUserPreferencesContainer'
2023-03-29 00:38:22 -04:00
style={{ paddingBottom: '1em' }}
2021-10-15 23:38:03 +03:00
>
2021-11-20 16:15:42 +03:00
<LinkEditUserPreferences
2021-10-15 23:38:03 +03:00
className= 'lnkEditUserPreferences button-link'
title= 'ButtonEditOtherUserPreferences'
/>
</div>
<form className='editUserProfileForm'>
<div className='disabledUserBanner hide'>
<div className='btn btnDarkAccent btnStatic'>
<div>
{globalize.translate('HeaderThisUserIsCurrentlyDisabled')}
</div>
2023-03-29 00:38:22 -04:00
<div style={{ marginTop: 5 }}>
2021-10-15 23:38:03 +03:00
{globalize.translate('MessageReenableUser')}
</div>
</div>
</div>
<div id='fldUserName' className='inputContainer'>
<InputElement
type='text'
id='txtUserName'
label='LabelName'
options={'required'}
/>
</div>
<div className='selectContainer fldSelectLoginProvider hide'>
<SelectElement
2022-06-29 02:17:10 +03:00
id='selectLoginProvider'
label='LabelAuthProvider'
>
{optionLoginProvider}
</SelectElement>
2021-10-15 23:38:03 +03:00
<div className='fieldDescription'>
{globalize.translate('AuthProviderHelp')}
</div>
</div>
<div className='selectContainer fldSelectPasswordResetProvider hide'>
<SelectElement
2022-06-29 02:17:10 +03:00
id='selectPasswordResetProvider'
label='LabelPasswordResetProvider'
>
{optionPasswordResetProvider}
</SelectElement>
2021-10-15 23:38:03 +03:00
<div className='fieldDescription'>
{globalize.translate('PasswordResetProviderHelp')}
</div>
</div>
<div className='checkboxContainer checkboxContainer-withDescription fldRemoteAccess hide'>
<CheckBoxElement
className='chkRemoteAccess'
title='AllowRemoteAccess'
/>
<div className='fieldDescription checkboxFieldDescription'>
{globalize.translate('AllowRemoteAccessHelp')}
</div>
</div>
<CheckBoxElement
2022-01-02 02:40:11 +03:00
labelClassName='checkboxContainer'
2021-10-15 23:38:03 +03:00
className='chkIsAdmin'
title='OptionAllowUserToManageServer'
/>
2023-01-08 19:38:01 +01:00
<CheckBoxElement
labelClassName='checkboxContainer'
className='chkEnableCollectionManagement'
title='AllowCollectionManagement'
/>
2021-10-15 23:38:03 +03:00
<div id='featureAccessFields' className='verticalSection'>
<h2 className='paperListLabel'>
{globalize.translate('HeaderFeatureAccess')}
</h2>
2023-03-29 00:38:22 -04:00
<div className='checkboxList paperList' style={{ padding: '.5em 1em' }}>
2021-10-15 23:38:03 +03:00
<CheckBoxElement
className='chkEnableLiveTvAccess'
title='OptionAllowBrowsingLiveTv'
/>
<CheckBoxElement
className='chkManageLiveTv'
title='OptionAllowManageLiveTv'
/>
</div>
</div>
<div className='verticalSection'>
<h2 className='paperListLabel'>
{globalize.translate('HeaderPlayback')}
</h2>
2023-03-29 00:38:22 -04:00
<div className='checkboxList paperList' style={{ padding: '.5em 1em' }}>
2021-10-15 23:38:03 +03:00
<CheckBoxElement
className='chkEnableMediaPlayback'
title='OptionAllowMediaPlayback'
/>
<CheckBoxElement
className='chkEnableAudioPlaybackTranscoding'
title='OptionAllowAudioPlaybackTranscoding'
/>
<CheckBoxElement
className='chkEnableVideoPlaybackTranscoding'
title='OptionAllowVideoPlaybackTranscoding'
/>
<CheckBoxElement
className='chkEnableVideoPlaybackRemuxing'
title='OptionAllowVideoPlaybackRemuxing'
/>
<CheckBoxElement
className='chkForceRemoteSourceTranscoding'
title='OptionForceRemoteSourceTranscoding'
/>
</div>
<div className='fieldDescription'>
{globalize.translate('OptionAllowMediaPlaybackTranscodingHelp')}
</div>
</div>
<br />
<div className='verticalSection'>
<div className='inputContainer'>
<InputElement
type='number'
id='txtRemoteClientBitrateLimit'
label='LabelRemoteClientBitrateLimit'
options={'inputMode="decimal" pattern="[0-9]*(.[0-9]+)?" min="{0}" step=".25"'}
/>
<div className='fieldDescription'>
{globalize.translate('LabelRemoteClientBitrateLimitHelp')}
</div>
<div className='fieldDescription'>
{globalize.translate('LabelUserRemoteClientBitrateLimitHelp')}
</div>
</div>
</div>
<div className='verticalSection'>
<div className='selectContainer fldSelectSyncPlayAccess'>
2022-06-29 02:17:10 +03:00
<SelectElement
2021-10-15 23:38:03 +03:00
id='selectSyncPlayAccess'
label='LabelSyncPlayAccess'
2022-06-29 02:17:10 +03:00
>
{optionSyncPlayAccess()}
</SelectElement>
2021-10-15 23:38:03 +03:00
<div className='fieldDescription'>
{globalize.translate('SyncPlayAccessHelp')}
</div>
</div>
</div>
2022-01-02 02:40:11 +03:00
<div className='verticalSection'>
2023-03-29 00:38:22 -04:00
<h2 className='checkboxListLabel' style={{ marginBottom: '1em' }}>
2022-01-02 02:40:11 +03:00
{globalize.translate('HeaderAllowMediaDeletionFrom')}
</h2>
<div className='checkboxList paperList checkboxList-paperList'>
<CheckBoxElement
labelClassName='checkboxContainer'
className='chkEnableDeleteAllFolders'
title='AllLibraries'
/>
2021-10-15 23:38:03 +03:00
<div className='deleteAccess'>
2022-01-02 02:40:11 +03:00
{deleteFoldersAccess.map(Item => (
2022-06-29 02:17:10 +03:00
<CheckBoxElement
2022-01-02 02:40:11 +03:00
key={Item.Id}
className='chkFolder'
2022-06-29 02:17:10 +03:00
itemId={Item.Id}
itemName={Item.Name}
itemCheckedAttribute={Item.checkedAttribute}
2022-01-02 02:40:11 +03:00
/>
))}
2021-10-15 23:38:03 +03:00
</div>
</div>
</div>
<div className='verticalSection'>
<h2 className='checkboxListLabel'>
{globalize.translate('HeaderRemoteControl')}
</h2>
2023-03-29 00:38:22 -04:00
<div className='checkboxList paperList' style={{ padding: '.5em 1em' }}>
2021-10-15 23:38:03 +03:00
<CheckBoxElement
className='chkEnableRemoteControlOtherUsers'
title='OptionAllowRemoteControlOthers'
/>
<CheckBoxElement
className='chkRemoteControlSharedDevices'
title='OptionAllowRemoteSharedDevices'
/>
</div>
<div className='fieldDescription'>
{globalize.translate('OptionAllowRemoteSharedDevicesHelp')}
</div>
</div>
<h2 className='checkboxListLabel'>
{globalize.translate('Other')}
</h2>
<div className='checkboxContainer checkboxContainer-withDescription'>
<CheckBoxElement
className='chkEnableDownloading'
title='OptionAllowContentDownload'
/>
<div className='fieldDescription checkboxFieldDescription'>
{globalize.translate('OptionAllowContentDownloadHelp')}
</div>
</div>
<div className='checkboxContainer checkboxContainer-withDescription' id='fldIsEnabled'>
<CheckBoxElement
className='chkDisabled'
title='OptionDisableUser'
/>
<div className='fieldDescription checkboxFieldDescription'>
{globalize.translate('OptionDisableUserHelp')}
</div>
</div>
<div className='checkboxContainer checkboxContainer-withDescription' id='fldIsHidden'>
<CheckBoxElement
className='chkIsHidden'
title='OptionHideUser'
/>
<div className='fieldDescription checkboxFieldDescription'>
{globalize.translate('OptionHideUserFromLoginHelp')}
</div>
</div>
<br />
<div className='verticalSection'>
<div className='inputContainer' id='fldLoginAttemptsBeforeLockout'>
<InputElement
type='number'
id='txtLoginAttemptsBeforeLockout'
label='LabelUserLoginAttemptsBeforeLockout'
options={'min={-1} step={1}'}
/>
<div className='fieldDescription'>
{globalize.translate('OptionLoginAttemptsBeforeLockout')}
</div>
<div className='fieldDescription'>
{globalize.translate('OptionLoginAttemptsBeforeLockoutHelp')}
</div>
</div>
</div>
<br />
<div className='verticalSection'>
<div className='inputContainer' id='fldMaxActiveSessions'>
<InputElement
type='number'
id='txtMaxActiveSessions'
label='LabelUserMaxActiveSessions'
options={'min={0} step={1}'}
/>
<div className='fieldDescription'>
{globalize.translate('OptionMaxActiveSessions')}
</div>
<div className='fieldDescription'>
{globalize.translate('OptionMaxActiveSessionsHelp')}
</div>
</div>
</div>
<br />
<div>
<ButtonElement
type='submit'
className='raised button-submit block'
title='Save'
/>
<ButtonElement
type='button'
2022-06-29 02:17:10 +03:00
id='btnCancel'
className='raised button-cancel block'
2021-10-15 23:38:03 +03:00
title='ButtonCancel'
/>
</div>
</form>
</div>
2022-06-29 03:16:05 +03:00
</Page>
2021-10-15 23:38:03 +03:00
);
};
2022-06-29 23:35:56 +03:00
export default UserEdit;