diff --git a/ui/src/i18n/en.js b/ui/src/i18n/en.js
index 88873e038..62b092494 100644
--- a/ui/src/i18n/en.js
+++ b/ui/src/i18n/en.js
@@ -60,6 +60,17 @@ export default deepmerge(englishMessages, {
passwordDoesNotMatch: 'Password does not match',
},
},
+ message: {
+ note: 'NOTE',
+ transcodingDisabled:
+ 'Changing the transcoding configuration through the web interface is disabled for security ' +
+ 'reasons. If you would like to change (edit or add) transcoding options, restart the server with ' +
+ 'the %{config} configuration option.',
+ transcodingEnabled:
+ 'Navidrome is currently running with %{config}, making it possible to run system ' +
+ 'commands from the transcoding settings using the web interface. We recommend to disable it for security reasons ' +
+ 'and only enable it when configuring Transcoding options.',
+ },
menu: {
library: 'Library',
settings: 'Settings',
diff --git a/ui/src/transcoding/TranscodingEdit.js b/ui/src/transcoding/TranscodingEdit.js
index f17e5c315..1a6debbac 100644
--- a/ui/src/transcoding/TranscodingEdit.js
+++ b/ui/src/transcoding/TranscodingEdit.js
@@ -1,14 +1,14 @@
import React from 'react'
import {
- TextInput,
- SelectInput,
Edit,
required,
+ SelectInput,
SimpleForm,
+ TextInput,
useTranslate,
} from 'react-admin'
-import { Card, CardContent, Typography, Box } from '@material-ui/core'
import { Title } from '../common'
+import { TranscodingNote } from './TranscodingNote'
const TranscodingTitle = ({ record }) => {
const translate = useTranslate()
@@ -18,49 +18,36 @@ const TranscodingTitle = ({ record }) => {
return
}
-const TranscodingEdit = (props) => (
- <>
-
-
-
-
- NOTE:
- {' '}
- Navidrome is currently running with the{' '}
-
- ND_ENABLETRANSCODINGCONFIG=true
-
- , making it possible to run system commands from the transcoding
- settings using the web interface. We recommend to disable it for
- security reasons and only enable it when configuring Transcoding
- options.
-
-
-
- } {...props}>
-
-
-
-
-
-
-
- >
-)
+const TranscodingEdit = (props) => {
+ return (
+ <>
+
+
+ } {...props}>
+
+
+
+
+
+
+
+ >
+ )
+}
export default TranscodingEdit
diff --git a/ui/src/transcoding/TranscodingNote.js b/ui/src/transcoding/TranscodingNote.js
new file mode 100644
index 000000000..a70776e02
--- /dev/null
+++ b/ui/src/transcoding/TranscodingNote.js
@@ -0,0 +1,33 @@
+import React from 'react'
+import { Card, CardContent, Typography, Box } from '@material-ui/core'
+import { useTranslate } from 'react-admin'
+
+export const Interpolate = ({ message, field, children }) => {
+ const split = message.split(`%{${field}}`)
+ return (
+
+ {split[0]}
+ {children}
+ {split[1]}
+
+ )
+}
+export const TranscodingNote = ({ message }) => {
+ const translate = useTranslate()
+ return (
+
+
+
+
+ {translate('message.note')}:
+ {' '}
+
+
+ ND_ENABLETRANSCODINGCONFIG=true
+
+
+
+
+
+ )
+}
diff --git a/ui/src/transcoding/TranscodingShow.js b/ui/src/transcoding/TranscodingShow.js
index 932aec42b..e132afee5 100644
--- a/ui/src/transcoding/TranscodingShow.js
+++ b/ui/src/transcoding/TranscodingShow.js
@@ -1,40 +1,27 @@
import React from 'react'
-import { TextField, Show, SimpleShowLayout } from 'react-admin'
-import { Card, CardContent, Typography, Box } from '@material-ui/core'
+import { Show, SimpleShowLayout, TextField } from 'react-admin'
import { Title } from '../common'
+import { TranscodingNote } from './TranscodingNote'
const TranscodingTitle = ({ record }) => {
return
}
-const TranscodingShow = (props) => (
- <>
-
-
-
-
- NOTE:
- {' '}
- Changing the transcoding configuration through the web interface is
- disabled for security reasons. If you would like to change (edit or
- add) transcoding options, restart the server with the{' '}
-
- ND_ENABLETRANSCODINGCONFIG=true
- {' '}
- configuration option.
-
-
-
+const TranscodingShow = (props) => {
+ return (
+ <>
+
- } {...props}>
-
-
-
-
-
-
-
- >
-)
+ } {...props}>
+
+
+
+
+
+
+
+ >
+ )
+}
export default TranscodingShow