ux: admin/options: clearer mime-type editor
Massimo Melina committed
Jan 30, 2025 at 11:18 UTC
a8203dae138632c952805c6b4688b98f941d8d05
1 file changed
+5
-5
admin/src/OptionsPage.ts
+5
-5
@@ -235,15 +235,15 @@ export default function OptionsPage() {
235
},
236
{ k: 'mime', comp: ArrayField, label: false, reorder: true, prepend: true, md: 6,
237
fields: [
238
+ { k: 'v', label: "Mime type", placeholder: "auto", $width: 2, helperText: "Leave empty to get automatic value" },
239
{ k: 'k', label: "File mask", helperText: h(WildcardsSupported), $width: 1, $column: {
239
- renderCell: ({ value, id }: any) => h('code', {},
240
- value,
241
- value === '*' && id < _.size(values.mime) - 1
240
+ renderCell: ({ value, id }: any) => h('code', {},
241
+ value,
242
+ value === '*' && id < _.size(values.mime) - 1
243
&& iconTooltip(Warning, md("Mime with `*` should be the last, because first matching row applies"), {
244
color: 'warning.main', ml: 1
245
}))
245
- } },
246
- { k: 'v', label: "Mime type", placeholder: "auto", $width: 2, helperText: "Leave empty to get automatic value" },
246
+ } },
247
],
248
toField: x => Object.entries(x || {}).map(([k,v]) => ({ k, v })),
249
fromField: x => Object.fromEntries(x.map((row: any) => [row.k, row.v || 'auto'])),