admin: better dom
Massimo Melina committed
Jan 10, 2024 at 21:25 UTC
0781ead31029999037bb4201da0bc08860a2246a
2 files changed
+7
-3
admin/src/App.ts
+1
-1
@@ -99,7 +99,7 @@ function StickyBar({ title, openMenu }: { title?: string, openMenu: ()=>void })
99
'aria-label': "menu",
100
onClick: openMenu
101
}, h(Menu)),
102
- title,
102
+ h(Box, { component: 'h2', m: 0 }, title),
103
)
104
)
105
}
admin/src/OptionsPage.ts
+6
-2
@@ -188,7 +188,7 @@ export default function OptionsPage() {
188
helperText: md(`This code works similarly to [a plugin](${REPO_URL}blob/main/dev-plugins.md) (with some limitations)`)
189
},
190
191
- h(Divider, {}, "Log", h(Box, { fontSize: 'small' })),
191
+ h(Section, { title: "Log" }),
192
{ k: 'log', label: logLabels.log, md: 3, helperText: "Requests are logged here" },
193
{ k: 'error_log', label: logLabels.error_log, md: 3, placeholder: "errors go to main log",
194
helperText: "If you want errors in a different log"
@@ -203,7 +203,7 @@ export default function OptionsPage() {
203
{ k: 'log_api', sm: 4, comp: BoolField, label: "Log API requests", helperText: "Requests for commands" },
204
{ k: 'log_ua', sm: 4, comp: BoolField, label: "Log User-Agent", helperText: "Contains browser and possibly OS information" },
205
206
- h(Divider, {}, "Front-end", h(Box, { fontSize: 'small' }, "Following options affect only the front-end")),
206
+ h(Section, { title: "Front-end", subtitle: "Following options affect only the front-end" }),
207
{ k: 'file_menu_on_link', comp: SelectField, label: "Access file menu", md: 4,
208
options: { "by clicking on file name": true, "by dedicated button": false }
209
},
@@ -259,6 +259,10 @@ export default function OptionsPage() {
259
}
260
}
261
262
+function Section({ title, subtitle }: { title: string, subtitle?: string }) {
263
+ return h(Divider, {}, h('h3', { style: { margin: 0 } }, title), h(Box, { fontSize: 'small' }, subtitle))
264
+}
265
+
266
function recalculateChanges() {
267
const o: Dict = {}
268
if (state.config)