feat: transcoding and player datastores and configuration

This commit is contained in:
Deluan
2020-02-29 20:01:09 -05:00
committed by Deluan Quintão
parent a0e0fbad58
commit 8ec78900c5
32 changed files with 783 additions and 29 deletions
+54
View File
@@ -0,0 +1,54 @@
import React from 'react'
import {
TextInput,
SelectInput,
Create,
required,
SimpleForm
} from 'react-admin'
import { Title } from '../common'
const TranscodingTitle = ({ record }) => {
return <Title subTitle={`Transcoding ${record ? record.name : ''}`} />
}
const TranscodingCreate = (props) => (
<Create title={<TranscodingTitle />} {...props}>
<SimpleForm>
<TextInput source="name" validate={[required()]} />
<TextInput source="targetFormat" validate={[required()]} />
<SelectInput
source="defaultBitRate"
choices={[
{ id: 32, name: '32' },
{ id: 48, name: '48' },
{ id: 64, name: '64' },
{ id: 80, name: '80' },
{ id: 96, name: '96' },
{ id: 112, name: '112' },
{ id: 128, name: '128' },
{ id: 160, name: '160' },
{ id: 192, name: '192' },
{ id: 256, name: '256' },
{ id: 320, name: '320' }
]}
initialValue={192}
/>
<TextInput
source="command"
fullWidth
validate={[required()]}
helperText={
<span>
Substitutions: <br />
%s: File path <br />
%b: BitRate (in kbps)
<br />
</span>
}
/>
</SimpleForm>
</Create>
)
export default TranscodingCreate
+35
View File
@@ -0,0 +1,35 @@
import React from 'react'
import { TextInput, SelectInput, Edit, required, SimpleForm } from 'react-admin'
import { Title } from '../common'
const TranscodingTitle = ({ record }) => {
return <Title subTitle={`Transcoding ${record ? record.name : ''}`} />
}
const TranscodingEdit = (props) => (
<Edit title={<TranscodingTitle />} {...props}>
<SimpleForm>
<TextInput source="name" validate={[required()]} />
<TextInput source="targetFormat" validate={[required()]} />
<SelectInput
source="defaultBitRate"
choices={[
{ id: 32, name: '32' },
{ id: 48, name: '48' },
{ id: 64, name: '64' },
{ id: 80, name: '80' },
{ id: 96, name: '96' },
{ id: 112, name: '112' },
{ id: 128, name: '128' },
{ id: 160, name: '160' },
{ id: 192, name: '192' },
{ id: 256, name: '256' },
{ id: 320, name: '320' }
]}
/>
<TextInput source="command" fullWidth validate={[required()]} />
</SimpleForm>
</Edit>
)
export default TranscodingEdit
+16
View File
@@ -0,0 +1,16 @@
import React from 'react'
import { Datagrid, List, TextField } from 'react-admin'
import { Title } from '../common'
const TranscodingList = (props) => (
<List title={<Title subTitle={'Transcodings'} />} exporter={false} {...props}>
<Datagrid rowClick="edit">
<TextField source="name" />
<TextField source="targetFormat" />
<TextField source="defaultBitRate" />
<TextField source="command" />
</Datagrid>
</List>
)
export default TranscodingList
+11
View File
@@ -0,0 +1,11 @@
import TransformIcon from '@material-ui/icons/Transform'
import TranscodingList from './TranscodingList'
import TranscodingEdit from './TranscodingEdit'
import TranscodingCreate from './TranscodingCreate'
export default {
list: TranscodingList,
edit: TranscodingEdit,
create: TranscodingCreate,
icon: TransformIcon
}