forked from mirrors/thatmattlove-hyperglass
fix VRF help; add CORS support to DNS over HTTPS
This commit is contained in:
parent
77d6165f11
commit
6b1c6bcc32
2 changed files with 5 additions and 5 deletions
|
|
@ -47,7 +47,8 @@ const HyperglassForm = React.forwardRef(
|
|||
({ isSubmitting, setSubmitting, setFormData, ...props }, ref) => {
|
||||
const config = useConfig();
|
||||
const { handleSubmit, register, setValue, errors } = useForm({
|
||||
validationSchema: formSchema(config)
|
||||
validationSchema: formSchema(config),
|
||||
defaultValues: { query_vrf: "default" }
|
||||
});
|
||||
|
||||
const [queryLocation, setQueryLocation] = useState([]);
|
||||
|
|
@ -58,9 +59,6 @@ const HyperglassForm = React.forwardRef(
|
|||
const [fqdnTarget, setFqdnTarget] = useState("");
|
||||
const [displayTarget, setDisplayTarget] = useState("");
|
||||
const onSubmit = values => {
|
||||
if (values.query_vrf === undefined) {
|
||||
values.query_vrf = "default";
|
||||
}
|
||||
setFormData(values);
|
||||
setSubmitting(true);
|
||||
};
|
||||
|
|
@ -77,7 +75,7 @@ const HyperglassForm = React.forwardRef(
|
|||
});
|
||||
const intersecting = lodash.intersectionWith(...allVrfs, lodash.isEqual);
|
||||
setAvailVrfs(intersecting);
|
||||
!intersecting.includes(queryVrf) && setQueryVrf("");
|
||||
!intersecting.includes(queryVrf) && queryVrf !== "default" && setQueryVrf("default");
|
||||
};
|
||||
|
||||
const handleChange = e => {
|
||||
|
|
|
|||
|
|
@ -20,12 +20,14 @@ const ResolvedTarget = React.forwardRef(({ fqdnTarget, setTarget, queryTarget },
|
|||
url: dnsUrl,
|
||||
params: { name: fqdnTarget, type: "A" },
|
||||
headers: { accept: "application/dns-json" },
|
||||
crossdomain: true,
|
||||
timeout: 1000
|
||||
};
|
||||
const params6 = {
|
||||
url: dnsUrl,
|
||||
params: { name: fqdnTarget, type: "AAAA" },
|
||||
headers: { accept: "application/dns-json" },
|
||||
crossdomain: true,
|
||||
timeout: 1000
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue