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) => {
|
({ isSubmitting, setSubmitting, setFormData, ...props }, ref) => {
|
||||||
const config = useConfig();
|
const config = useConfig();
|
||||||
const { handleSubmit, register, setValue, errors } = useForm({
|
const { handleSubmit, register, setValue, errors } = useForm({
|
||||||
validationSchema: formSchema(config)
|
validationSchema: formSchema(config),
|
||||||
|
defaultValues: { query_vrf: "default" }
|
||||||
});
|
});
|
||||||
|
|
||||||
const [queryLocation, setQueryLocation] = useState([]);
|
const [queryLocation, setQueryLocation] = useState([]);
|
||||||
@@ -58,9 +59,6 @@ const HyperglassForm = React.forwardRef(
|
|||||||
const [fqdnTarget, setFqdnTarget] = useState("");
|
const [fqdnTarget, setFqdnTarget] = useState("");
|
||||||
const [displayTarget, setDisplayTarget] = useState("");
|
const [displayTarget, setDisplayTarget] = useState("");
|
||||||
const onSubmit = values => {
|
const onSubmit = values => {
|
||||||
if (values.query_vrf === undefined) {
|
|
||||||
values.query_vrf = "default";
|
|
||||||
}
|
|
||||||
setFormData(values);
|
setFormData(values);
|
||||||
setSubmitting(true);
|
setSubmitting(true);
|
||||||
};
|
};
|
||||||
@@ -77,7 +75,7 @@ const HyperglassForm = React.forwardRef(
|
|||||||
});
|
});
|
||||||
const intersecting = lodash.intersectionWith(...allVrfs, lodash.isEqual);
|
const intersecting = lodash.intersectionWith(...allVrfs, lodash.isEqual);
|
||||||
setAvailVrfs(intersecting);
|
setAvailVrfs(intersecting);
|
||||||
!intersecting.includes(queryVrf) && setQueryVrf("");
|
!intersecting.includes(queryVrf) && queryVrf !== "default" && setQueryVrf("default");
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleChange = e => {
|
const handleChange = e => {
|
||||||
|
@@ -20,12 +20,14 @@ const ResolvedTarget = React.forwardRef(({ fqdnTarget, setTarget, queryTarget },
|
|||||||
url: dnsUrl,
|
url: dnsUrl,
|
||||||
params: { name: fqdnTarget, type: "A" },
|
params: { name: fqdnTarget, type: "A" },
|
||||||
headers: { accept: "application/dns-json" },
|
headers: { accept: "application/dns-json" },
|
||||||
|
crossdomain: true,
|
||||||
timeout: 1000
|
timeout: 1000
|
||||||
};
|
};
|
||||||
const params6 = {
|
const params6 = {
|
||||||
url: dnsUrl,
|
url: dnsUrl,
|
||||||
params: { name: fqdnTarget, type: "AAAA" },
|
params: { name: fqdnTarget, type: "AAAA" },
|
||||||
headers: { accept: "application/dns-json" },
|
headers: { accept: "application/dns-json" },
|
||||||
|
crossdomain: true,
|
||||||
timeout: 1000
|
timeout: 1000
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user