mirror of
https://github.com/checktheroads/hyperglass
synced 2024-05-11 05:55:08 +00:00
fix VRF help; add CORS support to DNS over HTTPS
This commit is contained in:
@@ -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
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user