1
0
mirror of https://github.com/checktheroads/hyperglass synced 2024-05-11 05:55:08 +00:00

allow static bgp community definitions

This commit is contained in:
checktheroads
2020-04-18 07:57:55 -07:00
parent 400685304f
commit 2895d3ae46
7 changed files with 268 additions and 201 deletions

View File

@@ -1,15 +1,15 @@
import React from "react";
import ChakraSelect from "~/components/ChakraSelect";
const buildLocations = networks => {
const buildLocations = (networks) => {
const locations = [];
networks.map(net => {
networks.map((net) => {
const netLocations = [];
net.locations.map(loc => {
net.locations.map((loc) => {
netLocations.push({
label: loc.display_name,
value: loc.name,
group: net.display_name
group: net.display_name,
});
});
locations.push({ label: net.display_name, options: netLocations });
@@ -19,10 +19,10 @@ const buildLocations = networks => {
export default ({ locations, onChange }) => {
const options = buildLocations(locations);
const handleChange = e => {
const handleChange = (e) => {
const selected = [];
e &&
e.map(sel => {
e.map((sel) => {
selected.push(sel.value);
});
onChange({ field: "query_location", value: selected });
@@ -34,6 +34,7 @@ export default ({ locations, onChange }) => {
onChange={handleChange}
options={options}
isMulti
closeMenuOnSelect={false}
/>
);
};