33 * @homepage : https://oldj.net
44 */
55
6+ import { httpApiPort } from '@common/constants'
67import { ConfigsType } from '@common/default_configs'
7- import { Checkbox , Stack , Tooltip } from '@mantine/core'
8- import DescriptionText from '@renderer/components/DescriptionText'
9- import { actions } from '@renderer/core/agent'
8+ import { Box , Checkbox , Stack , Tooltip } from '@mantine/core'
9+ import DescriptionText , { checkboxDescriptionStyles } from '@renderer/components/DescriptionText'
10+ import { actions , agent } from '@renderer/core/agent'
1011import useI18n from '@renderer/models/useI18n'
1112import { IconFile , IconFolder } from '@tabler/icons-react'
1213import React , { useEffect , useState } from 'react'
@@ -49,7 +50,8 @@ const PathLink = (props: { link: string; icon?: React.ReactNode }) => {
4950
5051const Advanced = ( props : IProps ) => {
5152 const { data, onChange } = props
52- const { lang } = useI18n ( )
53+ const { i18n, lang } = useI18n ( )
54+ const { platform } = agent
5355 const [ hostsPath , setHostsPath ] = useState ( '' )
5456 const [ dataDir , setDataDir ] = useState ( '' )
5557
@@ -60,6 +62,76 @@ const Advanced = (props: IProps) => {
6062
6163 return (
6264 < Stack gap = "40px" pb = { 60 } >
65+ < Stack gap = "16px" w = "100%" >
66+ { platform === 'darwin' ? (
67+ < Box w = "100%" >
68+ < Checkbox
69+ checked = { data . show_title_on_tray }
70+ onChange = { ( e ) => onChange ( { show_title_on_tray : e . target . checked } ) }
71+ label = { lang . show_title_on_tray }
72+ />
73+ </ Box >
74+ ) : null }
75+
76+ < Box w = "100%" >
77+ < Checkbox
78+ checked = { data . remove_duplicate_records }
79+ onChange = { ( e ) => onChange ( { remove_duplicate_records : e . target . checked } ) }
80+ label = { lang . remove_duplicate_records }
81+ description = { lang . remove_duplicate_records_desc }
82+ styles = { checkboxDescriptionStyles }
83+ />
84+ </ Box >
85+
86+ < Box w = "100%" >
87+ < Checkbox
88+ checked = { data . refresh_remote_hosts_on_startup }
89+ onChange = { ( e ) => onChange ( { refresh_remote_hosts_on_startup : e . target . checked } ) }
90+ label = { lang . refresh_remote_hosts_on_startup }
91+ description = { lang . refresh_remote_hosts_on_startup_desc }
92+ styles = { checkboxDescriptionStyles }
93+ />
94+ </ Box >
95+
96+ < Box w = "100%" >
97+ < Checkbox
98+ checked = { data . multi_chose_folder_switch_all }
99+ onChange = { ( e ) => onChange ( { multi_chose_folder_switch_all : e . target . checked } ) }
100+ label = { lang . multi_chose_folder_switch_all }
101+ description = { lang . multi_chose_folder_switch_all_desc }
102+ styles = { checkboxDescriptionStyles }
103+ />
104+ </ Box >
105+
106+ < Box w = "100%" >
107+ < Checkbox
108+ checked = { data . tray_mini_window }
109+ onChange = { ( e ) => onChange ( { tray_mini_window : e . target . checked } ) }
110+ label = { lang . tray_mini_window }
111+ />
112+ </ Box >
113+
114+ < Box w = "100%" >
115+ < Stack gap = "8px" >
116+ < Checkbox
117+ checked = { data . http_api_on }
118+ onChange = { ( e ) => onChange ( { http_api_on : e . target . checked } ) }
119+ label = { lang . http_api_on }
120+ description = { i18n . trans ( 'http_api_on_desc' , [ httpApiPort . toString ( ) ] ) }
121+ styles = { checkboxDescriptionStyles }
122+ />
123+ < Box pl = "28px" >
124+ < Checkbox
125+ disabled = { ! data . http_api_on }
126+ checked = { data . http_api_only_local }
127+ onChange = { ( e ) => onChange ( { http_api_only_local : e . target . checked } ) }
128+ label = { lang . http_api_only_local }
129+ />
130+ </ Box >
131+ </ Stack >
132+ </ Box >
133+ </ Stack >
134+
63135 < div style = { { width : '100%' } } >
64136 < div > { lang . usage_data_title } </ div >
65137 < DescriptionText mb = "8px" > { lang . usage_data_help } </ DescriptionText >
0 commit comments