Show "Default" for unchanged server file paths
This commit is contained in:
@@ -14,19 +14,20 @@ import { TextSettingDialog, TextSettingDialogProps } from '@/components/settings
|
||||
export type TextSettingProps = Omit<TextSettingDialogProps, 'isDialogOpen' | 'setIsDialogOpen' | 'value'> &
|
||||
Required<Pick<TextSettingDialogProps, 'value'>> & {
|
||||
disabled?: boolean;
|
||||
settingDescription?: string;
|
||||
};
|
||||
|
||||
export const TextSetting = (props: TextSettingProps) => {
|
||||
const [isDialogOpen, setIsDialogOpen] = useState(false);
|
||||
|
||||
const { settingName, value, isPassword = false, disabled = false } = props;
|
||||
const { settingName, settingDescription, value, isPassword = false, disabled = false } = props;
|
||||
|
||||
return (
|
||||
<>
|
||||
<ListItemButton disabled={disabled} onClick={() => setIsDialogOpen(true)}>
|
||||
<ListItemText
|
||||
primary={settingName}
|
||||
secondary={isPassword ? value.replace(/./g, '*') : value}
|
||||
secondary={settingDescription ?? (isPassword ? value.replace(/./g, '*') : value)}
|
||||
secondaryTypographyProps={{
|
||||
sx: { display: 'flex', flexDirection: 'column', wordWrap: 'break-word' },
|
||||
}}
|
||||
|
||||
@@ -274,6 +274,9 @@ export function Backup() {
|
||||
settingName={t('settings.backup.automated.location.label.title')}
|
||||
dialogDescription={t('settings.backup.automated.location.label.description')}
|
||||
value={backupSettings.backupPath}
|
||||
settingDescription={
|
||||
backupSettings.backupPath.length ? backupSettings.backupPath : t('global.label.default')
|
||||
}
|
||||
handleChange={(path) => updateSetting('backupPath', path)}
|
||||
/>
|
||||
<TimeSetting
|
||||
|
||||
@@ -141,6 +141,9 @@ export const BrowseSettings = () => {
|
||||
settingName={t('settings.server.local_source.path.label.title')}
|
||||
dialogDescription={t('settings.server.local_source.path.label.description')}
|
||||
value={serverSettings.localSourcePath}
|
||||
settingDescription={
|
||||
serverSettings.localSourcePath.length ? serverSettings.localSourcePath : t('global.label.default')
|
||||
}
|
||||
handleChange={(path) => updateSetting('localSourcePath', path)}
|
||||
/>
|
||||
</List>
|
||||
|
||||
@@ -129,6 +129,9 @@ export const DownloadSettings = () => {
|
||||
settingName={t('download.settings.download_path.label.title')}
|
||||
dialogDescription={t('download.settings.download_path.label.description')}
|
||||
value={downloadSettings?.downloadsPath}
|
||||
settingDescription={
|
||||
downloadSettings?.downloadsPath.length ? downloadSettings.downloadsPath : t('global.label.default')
|
||||
}
|
||||
handleChange={(path) => updateSetting('downloadsPath', path)}
|
||||
/>
|
||||
<ListItem>
|
||||
|
||||
@@ -219,6 +219,9 @@ export const WebUISettings = () => {
|
||||
settingName={t('settings.webui.electron_path.label.title')}
|
||||
dialogDescription={t('settings.webui.electron_path.label.description')}
|
||||
value={webUISettings.electronPath}
|
||||
settingDescription={
|
||||
webUISettings.electronPath.length ? webUISettings.electronPath : t('global.label.default')
|
||||
}
|
||||
handleChange={(path) => updateSetting('electronPath', path)}
|
||||
/>
|
||||
<SelectSetting<WebUiChannel>
|
||||
|
||||
Reference in New Issue
Block a user