@@ -53,6 +53,32 @@ const SettableInterfaces: Record<string, string> = {
5353 wasm : 'WebAssembly Runtime'
5454}
5555
56+ const OptionDescriptions : Record < string , React . ReactNode > = {
57+ mdns : 'Advertise Signal K server over mDNS/DNS-SD' ,
58+ wsCompression : 'Use compression on WebSocket connections' ,
59+ wsPingInterval :
60+ 'Use WebSocket ping messages to terminate stale, inactive connections' ,
61+ accessLogging : 'Log HTTP requests' ,
62+ enablePluginLogging : "Global flag for plugin's debug logging" ,
63+ trustProxy : (
64+ < >
65+ Trust proxy headers from a reverse proxy, see{ ' ' }
66+ < a href = "/admin/#/documentation/Security.html#reverse-proxy-configuration-trust-proxy" >
67+ documentation
68+ </ a >
69+ </ >
70+ ) ,
71+ useBLEManager : (
72+ < >
73+ Server's Bluetooth Low Energy connection management, see{ ' ' }
74+ < a href = "/admin/#/documentation/Developing/REST_APIs/BLE_API.html" >
75+ documentation
76+ </ a >
77+ </ >
78+ ) ,
79+ ssl : "Server's built-in SSL (HTTPS) support"
80+ }
81+
5682const ServerSettings : React . FC = ( ) => {
5783 const loginStatus = useLoginStatus ( )
5884 const [ settings , setSettings ] = useState < ServerSettingsData > ( {
@@ -298,31 +324,45 @@ const ServerSettings: React.FC = () => {
298324 < Col xs = "12" md = { fieldColWidthMd } >
299325 { settings . options &&
300326 Object . keys ( settings . options ) . map ( ( name ) => {
327+ const description = OptionDescriptions [ name ]
301328 return (
302- < div
303- key = { name }
304- className = "d-flex align-items-center mb-2"
305- >
306- < Form . Label
307- style = { { marginRight : '15px' , marginBottom : 0 } }
308- className = "switch switch-text switch-primary"
309- >
310- < input
311- type = "checkbox"
312- id = { `option-${ name } ` }
313- name = { name }
314- className = "switch-input"
315- onChange = { handleOptionChange }
316- checked = { settings . options ?. [ name ] || false }
317- />
318- < span
319- className = "switch-label"
320- data-on = "On"
321- data-off = "Off"
322- />
323- < span className = "switch-handle" />
324- </ Form . Label >
325- < span > { name } </ span >
329+ < div key = { name } className = "mb-2" >
330+ < div className = "d-flex align-items-center" >
331+ < Form . Label
332+ style = { { marginRight : '15px' , marginBottom : 0 } }
333+ className = "switch switch-text switch-primary"
334+ >
335+ < input
336+ type = "checkbox"
337+ id = { `option-${ name } ` }
338+ name = { name }
339+ className = "switch-input"
340+ onChange = { handleOptionChange }
341+ checked = { settings . options ?. [ name ] || false }
342+ aria-labelledby = { `option-label-${ name } ` }
343+ aria-describedby = {
344+ description
345+ ? `option-description-${ name } `
346+ : undefined
347+ }
348+ />
349+ < span
350+ className = "switch-label"
351+ data-on = "On"
352+ data-off = "Off"
353+ />
354+ < span className = "switch-handle" />
355+ </ Form . Label >
356+ < span id = { `option-label-${ name } ` } > { name } </ span >
357+ </ div >
358+ { description && (
359+ < Form . Text
360+ id = { `option-description-${ name } ` }
361+ className = "text-muted"
362+ >
363+ { description }
364+ </ Form . Text >
365+ ) }
326366 </ div >
327367 )
328368 } ) }
0 commit comments