mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
migrate User Parental Control
This commit is contained in:
parent
5d29529562
commit
2d115bc6c8
4 changed files with 31 additions and 28 deletions
|
@ -1,3 +0,0 @@
|
||||||
<div id="userParentalControlPage" data-role="page" class="page type-interior">
|
|
||||||
|
|
||||||
</div>
|
|
|
@ -1,18 +1,19 @@
|
||||||
import { AccessSchedule, DynamicDayOfWeek, UserDto } from '@thornbill/jellyfin-sdk/dist/generated-client';
|
import { AccessSchedule, DynamicDayOfWeek, UserDto } from '@thornbill/jellyfin-sdk/dist/generated-client';
|
||||||
import React, { FunctionComponent, useCallback, useEffect, useState, useRef } from 'react';
|
import React, { FunctionComponent, useCallback, useEffect, useState, useRef } from 'react';
|
||||||
import globalize from '../../scripts/globalize';
|
import globalize from '../scripts/globalize';
|
||||||
import LibraryMenu from '../../scripts/libraryMenu';
|
import LibraryMenu from '../scripts/libraryMenu';
|
||||||
import AccessScheduleList from '../dashboard/users/AccessScheduleList';
|
import AccessScheduleList from '../components/dashboard/users/AccessScheduleList';
|
||||||
import BlockedTagList from '../dashboard/users/BlockedTagList';
|
import BlockedTagList from '../components/dashboard/users/BlockedTagList';
|
||||||
import ButtonElement from '../dashboard/elements/ButtonElement';
|
import ButtonElement from '../components/dashboard/elements/ButtonElement';
|
||||||
import SectionTitleContainer from '../dashboard/elements/SectionTitleContainer';
|
import SectionTitleContainer from '../components/dashboard/elements/SectionTitleContainer';
|
||||||
import SectionTabs from '../dashboard/users/SectionTabs';
|
import SectionTabs from '../components/dashboard/users/SectionTabs';
|
||||||
import loading from '../loading/loading';
|
import loading from '../components/loading/loading';
|
||||||
import toast from '../toast/toast';
|
import toast from '../components/toast/toast';
|
||||||
import { getParameterByName } from '../../utils/url';
|
import { getParameterByName } from '../utils/url';
|
||||||
import CheckBoxElement from '../dashboard/elements/CheckBoxElement';
|
import CheckBoxElement from '../components/dashboard/elements/CheckBoxElement';
|
||||||
import escapeHTML from 'escape-html';
|
import escapeHTML from 'escape-html';
|
||||||
import SelectElement from '../dashboard/elements/SelectElement';
|
import SelectElement from '../components/dashboard/elements/SelectElement';
|
||||||
|
import Page from '../components/Page';
|
||||||
|
|
||||||
type RatingsArr = {
|
type RatingsArr = {
|
||||||
Name: string;
|
Name: string;
|
||||||
|
@ -241,7 +242,7 @@ const UserParentalControl: FunctionComponent = () => {
|
||||||
|
|
||||||
const showSchedulePopup = (schedule: AccessSchedule, index: number) => {
|
const showSchedulePopup = (schedule: AccessSchedule, index: number) => {
|
||||||
schedule = schedule || {};
|
schedule = schedule || {};
|
||||||
import('../../components/accessSchedule/accessSchedule').then(({default: accessschedule}) => {
|
import('../components/accessSchedule/accessSchedule').then(({default: accessschedule}) => {
|
||||||
accessschedule.show({
|
accessschedule.show({
|
||||||
schedule: schedule
|
schedule: schedule
|
||||||
}).then(function (updatedSchedule) {
|
}).then(function (updatedSchedule) {
|
||||||
|
@ -274,7 +275,7 @@ const UserParentalControl: FunctionComponent = () => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const showBlockedTagPopup = () => {
|
const showBlockedTagPopup = () => {
|
||||||
import('../../components/prompt/prompt').then(({default: prompt}) => {
|
import('../components/prompt/prompt').then(({default: prompt}) => {
|
||||||
prompt({
|
prompt({
|
||||||
label: globalize.translate('LabelTag')
|
label: globalize.translate('LabelTag')
|
||||||
}).then(function (value) {
|
}).then(function (value) {
|
||||||
|
@ -326,8 +327,11 @@ const UserParentalControl: FunctionComponent = () => {
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div ref={element}>
|
<Page
|
||||||
<div className='content-primary'>
|
id='userParentalControlPage'
|
||||||
|
className='mainAnimatedPage type-interior'
|
||||||
|
>
|
||||||
|
<div ref={element} className='content-primary'>
|
||||||
<div className='verticalSection'>
|
<div className='verticalSection'>
|
||||||
<SectionTitleContainer
|
<SectionTitleContainer
|
||||||
title={userName}
|
title={userName}
|
||||||
|
@ -419,7 +423,8 @@ const UserParentalControl: FunctionComponent = () => {
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</Page>
|
||||||
|
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
|
@ -6,6 +6,7 @@ import NewUserPage from './NewUserPage';
|
||||||
import SearchPage from './search';
|
import SearchPage from './search';
|
||||||
import UserEditPage from './UserEditPage';
|
import UserEditPage from './UserEditPage';
|
||||||
import UserLibraryAccessPage from './UserLibraryAccessPage';
|
import UserLibraryAccessPage from './UserLibraryAccessPage';
|
||||||
|
import UserParentalControl from './UserParentalControl';
|
||||||
import UserProfilesPage from './UserProfilesPage';
|
import UserProfilesPage from './UserProfilesPage';
|
||||||
|
|
||||||
const AppRoutes = () => (
|
const AppRoutes = () => (
|
||||||
|
@ -51,6 +52,14 @@ const AppRoutes = () => (
|
||||||
</ConnectionRequired>
|
</ConnectionRequired>
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
|
<Route
|
||||||
|
path='userparentalcontrol.html'
|
||||||
|
element={
|
||||||
|
<ConnectionRequired>
|
||||||
|
<UserParentalControl />
|
||||||
|
</ConnectionRequired>
|
||||||
|
}
|
||||||
|
/>
|
||||||
{/* Suppress warnings for unhandled routes */}
|
{/* Suppress warnings for unhandled routes */}
|
||||||
<Route path='*' element={null} />
|
<Route path='*' element={null} />
|
||||||
</Route>
|
</Route>
|
||||||
|
|
|
@ -429,14 +429,6 @@ import { appRouter } from '../components/appRouter';
|
||||||
controller: 'shows/tvrecommended'
|
controller: 'shows/tvrecommended'
|
||||||
});
|
});
|
||||||
|
|
||||||
defineRoute({
|
|
||||||
alias: '/userparentalcontrol.html',
|
|
||||||
path: 'dashboard/users/userparentalcontrol.html',
|
|
||||||
autoFocus: false,
|
|
||||||
roles: 'admin',
|
|
||||||
pageComponent: 'UserParentalControl'
|
|
||||||
});
|
|
||||||
|
|
||||||
defineRoute({
|
defineRoute({
|
||||||
alias: '/userpassword.html',
|
alias: '/userpassword.html',
|
||||||
path: 'dashboard/users/userpassword.html',
|
path: 'dashboard/users/userpassword.html',
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue