fix(ui): Dynamically generate path to config in warning message (#851)

This commit is contained in:
TheCatLady
2021-02-05 04:15:48 -05:00
committed by GitHub
parent e4f9b8a984
commit b531a642f6
6 changed files with 24 additions and 9 deletions

View File

@@ -6,12 +6,12 @@ import Alert from '../Common/Alert';
const messages = defineMessages({
dockerVolumeMissing: 'Docker Volume Mount Missing',
dockerVolumeMissingDescription:
'The <code>/app/config</code> volume mount was not configured properly. All data will be cleared when the container is stopped or restarted.',
'The <code>{appDataPath}</code> volume mount was not configured properly. All data will be cleared when the container is stopped or restarted.',
});
const AppDataWarning: React.FC = () => {
const intl = useIntl();
const { data, error } = useSWR<{ appData: boolean }>(
const { data, error } = useSWR<{ appData: boolean; appDataPath: string }>(
'/api/v1/status/appdata'
);
@@ -31,6 +31,7 @@ const AppDataWarning: React.FC = () => {
code: function code(msg) {
return <code className="bg-opacity-50">{msg}</code>;
},
appDataPath: data.appDataPath,
})}
</Alert>
)}