diff --git a/ui/src/dialogs/AboutDialog.jsx b/ui/src/dialogs/AboutDialog.jsx index 661462b9b..486cc0492 100644 --- a/ui/src/dialogs/AboutDialog.jsx +++ b/ui/src/dialogs/AboutDialog.jsx @@ -9,6 +9,7 @@ import TableBody from '@material-ui/core/TableBody' import TableRow from '@material-ui/core/TableRow' import TableCell from '@material-ui/core/TableCell' import Paper from '@material-ui/core/Paper' +import CloudDownloadIcon from '@material-ui/icons/CloudDownload' import FavoriteBorderIcon from '@material-ui/icons/FavoriteBorder' import FileCopyIcon from '@material-ui/icons/FileCopy' import Button from '@material-ui/core/Button' @@ -245,6 +246,21 @@ const ConfigTabContent = ({ configData }) => { } } + const handleDownloadToml = () => { + const tomlContent = configToToml(configData, translate) + const tomlFile = new File([tomlContent], 'navidrome.toml', { + type: 'text/plain', + }) + + const tomlFileLink = document.createElement('a') + const tomlFileUrl = URL.createObjectURL(tomlFile) + tomlFileLink.href = tomlFileUrl + tomlFileLink.download = tomlFile.name + tomlFileLink.click() + + URL.revokeObjectURL(tomlFileUrl) + } + return (
+ diff --git a/ui/src/i18n/en.json b/ui/src/i18n/en.json index a18c79974..678abaabd 100644 --- a/ui/src/i18n/en.json +++ b/ui/src/i18n/en.json @@ -673,6 +673,7 @@ "currentValue": "Current Value", "configurationFile": "Configuration File", "exportToml": "Export Configuration (TOML)", + "downloadToml": "Download Configuration (TOML)", "exportSuccess": "Configuration exported to clipboard in TOML format", "exportFailed": "Failed to copy configuration", "devFlagsHeader": "Development Flags (subject to change/removal)",