admin/options: link to wildcards help
Massimo Melina committed
Apr 10, 2023 at 16:00 UTC
d84490c7bddbd4f794c1d1e62eb75baaf502641b
1 file changed
+8
-4
admin/src/OptionsPage.ts
+8
-4
@@ -1,7 +1,7 @@
1
// This file is part of HFS - Copyright 2021-2023, Massimo Melina <a@rejetto.com> - License https://www.gnu.org/licenses/gpl-3.0.txt
2
3
import { Box, Button, FormHelperText, Link } from '@mui/material';
4
-import { createElement as h, useEffect, useRef } from 'react';
4
+import { createElement as h, Fragment, useEffect, useRef } from 'react';
5
import { apiCall, useApi, useApiEx } from './api'
6
import { state, useSnapState } from './state'
7
import { Info, Refresh, Warning } from '@mui/icons-material'
@@ -18,7 +18,7 @@ import {
18
} from '@hfs/mui-grid-form';
19
import FileField from './FileField'
20
import { alertDialog, closeDialog, confirmDialog, formDialog, newDialog, toast, waitDialog } from './dialog'
21
-import { proxyWarning } from './HomePage'
21
+import { proxyWarning, REPO_URL } from './HomePage'
22
import _ from 'lodash';
23
import { proxy, subscribe, useSnapshot } from 'valtio'
24
@@ -141,7 +141,7 @@ export default function OptionsPage() {
141
{ k: 'min_available_mb', comp: NumberField, md: 3, min : 0, unit: "MBytes", placeholder: "None",
142
label: "Min. available disk space", helperText: "Reject uploads that don't comply" },
143
{ k: 'admin_net', comp: NetmaskField, label: "Admin-panel accessible from", placeholder: "any address",
144
- helperText: "IP address of browser machine. Wildcards supported."
144
+ helperText: h(Fragment, {}, "IP address of browser machine. ", h(WildcardsSupported))
145
},
146
{ k: 'zip_calculate_size_for_seconds', comp: NumberField, label: "Calculate ZIP size for", unit: "seconds",
147
helperText: "If time is not enough, the browser will not show download percentage" },
@@ -274,11 +274,15 @@ function AllowedReferer({ label, value, onChange, error }: FieldProps<string>) {
274
placeholder: 'example.com',
275
onChange,
276
error,
277
- helperText: "Wildcards supported"
277
+ helperText: h(WildcardsSupported)
278
})
279
)
280
}
281
282
+function WildcardsSupported() {
283
+ return h(Link, { target: 'help', href: REPO_URL + 'wiki/Wildcards' }, "Wildcards supported")
284
+}
285
+
286
function suggestMakingCert() {
287
newDialog({
288
Content: () => h(Box, {},