@samitouri / QOSami-HFS / commits / 8a73a575

admin/options: better layout

Massimo Melina committed Feb 3, 2025 at 00:31 UTC 8a73a575a53dc45bdb86ceb914091f2c3b127383
1 file changed +10 -10
admin/src/OptionsPage.ts
+10 -10
@@ -78,7 +78,6 @@ export default function OptionsPage() {
78 sm: 4,
79 }
80 const httpsEnabled = values.https_port >= 0
81 - const isWindows = status?.platform === 'win32'
81 return h(Form, {
82 sx: { maxWidth: '60em' },
83 values,
@@ -218,21 +217,21 @@ export default function OptionsPage() {
217 label: "Min. available disk space", helperText: "Reject uploads that don't comply" },
218
219 h(Section, { title: "Others" }),
221 - { k: 'keep_session_alive', comp: BoolField, sm: 4, md: 6, helperText: "Keeps you logged in while the page is left open and the computer is on" },
222 - { k: 'session_duration', comp: NumberField, sm: 4, md: 3, min: 5, unit: "seconds", required: true },
223 - { k: 'zip_calculate_size_for_seconds', comp: NumberField, sm: 4, md: 3, unit: "seconds", required: true,
220 + { k: 'keep_session_alive', comp: BoolField, sm: 6, md: 6, helperText: "Keeps you logged in while the page is left open and the computer is on" },
221 + { k: 'session_duration', comp: NumberField, sm: 6, md: 3, min: 5, unit: "seconds", required: true },
222 + { k: 'zip_calculate_size_for_seconds', comp: NumberField, sm: 6, md: 3, unit: "seconds", required: true,
223 label: "Calculate ZIP size for", helperText: "If time is not enough, the browser will not show download percentage" },
224
226 - { k: 'descript_ion', comp: BoolField, ...isWindows && { sm: 4, md: 3 }, label: "Enable comments", helperText: "In file DESCRIPT.ION" },
227 - { k: 'show_hidden_files', comp: BoolField, sm: 4, md: 3 },
228 - { k: CFG.size_1024, label: "KB size", comp: SelectField, md: 3, options: { 1000: false, 1024: true } },
229 - { k: 'descript_ion_encoding', sm: 4, md: 6, label: "Encoding of file DESCRIPT.ION", comp: SelectField, disabled: !values.descript_ion,
225 + { k: 'show_hidden_files', comp: BoolField, sm: 6, md: 3 },
226 + { k: 'descript_ion', comp: BoolField, sm: 6, md: 3, label: "Enable comments", helperText: "In file DESCRIPT.ION" },
227 + { k: 'descript_ion_encoding', sm: 6, md: 3, label: "Encoding of file DESCRIPT.ION", comp: SelectField, disabled: !values.descript_ion,
228 options: ['utf8',720,775,819,850,852,862,869,874,808, ..._.range(1250,1257),10029,20866,21866] },
229 + { k: CFG.size_1024, label: "KB size", comp: SelectField, sm: 6, md: 3, options: { 1000: false, 1024: true } },
230
232 - { k: 'open_browser_at_start', comp: BoolField, label: "Open Admin-panel at start",
231 + { k: 'open_browser_at_start', comp: BoolField, label: "Open Admin-panel at start", sm: 4, md: 6,
232 helperText: "Browser is automatically launched with HFS"
233 },
235 - { k: 'mime', comp: ArrayField, label: false, reorder: true, prepend: true, md: 6,
234 + { k: 'mime', comp: ArrayField, label: false, reorder: true, prepend: true, sm: 12, md: 6,
235 fields: [
236 { k: 'v', label: "Mime type", placeholder: "auto", $width: 2, helperText: "Leave empty to get automatic value" },
237 { k: 'k', label: "File mask", helperText: h(WildcardsSupported), $width: 1, $column: {
@@ -247,6 +246,7 @@ export default function OptionsPage() {
246 toField: x => Object.entries(x || {}).map(([k,v]) => ({ k, v })),
247 fromField: x => Object.fromEntries(x.map((row: any) => [row.k, row.v || 'auto'])),
248 },
249 +
250 { k: 'server_code', comp: TextEditorField, lang: 'js', sm: 12,
251 helperText: md(`This code works similarly to [a plugin](${REPO_URL}blob/main/dev-plugins.md) (with some limitations)`)
252 },