diff --git a/db/migration/20200310181627_add_transcoding_and_player_tables.go b/db/migration/20200310181627_add_transcoding_and_player_tables.go
index 5de1422c..744eec3b 100644
--- a/db/migration/20200310181627_add_transcoding_and_player_tables.go
+++ b/db/migration/20200310181627_add_transcoding_and_player_tables.go
@@ -32,9 +32,13 @@ create table player
client varchar not null,
ip_address varchar,
last_seen timestamp,
- transcoding_id varchar, -- todo foreign key
max_bit_rate int default 0,
- unique (name)
+ transcoding_id varchar,
+ unique (name),
+ foreign key (transcoding_id)
+ references transcoding(id)
+ on update restrict
+ on delete restrict
);
`)
return err
diff --git a/ui/src/App.js b/ui/src/App.js
index 871a7ce7..7a79e477 100644
--- a/ui/src/App.js
+++ b/ui/src/App.js
@@ -6,6 +6,7 @@ import polyglotI18nProvider from 'ra-i18n-polyglot'
import messages from './i18n'
import { DarkTheme, Layout, Login } from './layout'
import transcoding from './transcoding'
+import player from './player'
import user from './user'
import song from './song'
import album from './album'
@@ -48,6 +49,13 @@ const App = () => {
permissions === 'admin' ? (
) : null,
+ permissions === 'admin' ? (
+
+ ) : null,
permissions === 'admin' ? (
{
+ return
+}
+
+const PlayerEdit = (props) => (
+ } {...props}>
+
+
+
+
+
+
+
+
+
+
+)
+
+export default PlayerEdit
diff --git a/ui/src/player/PlayerList.js b/ui/src/player/PlayerList.js
new file mode 100644
index 00000000..3213e5a3
--- /dev/null
+++ b/ui/src/player/PlayerList.js
@@ -0,0 +1,33 @@
+import React from 'react'
+import {
+ Datagrid,
+ List,
+ TextField,
+ DateField,
+ FunctionField,
+ ReferenceField
+} from 'react-admin'
+import { Title } from '../common'
+
+const PlayerList = (props) => (
+
} exporter={false} {...props}>
+
+
+
+
+
+ (r.maxBitRate ? r.maxBitRate : 'Unlimited')}
+ />
+
+
+
+)
+
+export default PlayerList
diff --git a/ui/src/player/index.js b/ui/src/player/index.js
new file mode 100644
index 00000000..8bd817a0
--- /dev/null
+++ b/ui/src/player/index.js
@@ -0,0 +1,9 @@
+import RadioIcon from '@material-ui/icons/Radio'
+import PlayerList from './PlayerList'
+import PlayerEdit from './PlayerEdit'
+
+export default {
+ list: PlayerList,
+ edit: PlayerEdit,
+ icon: RadioIcon
+}