From 3886925501a9e78b28a1668c151a2d300413f635 Mon Sep 17 00:00:00 2001 From: checktheroads Date: Fri, 12 Feb 2021 23:08:23 -0700 Subject: [PATCH] add no_communities text field --- docs/docs/ui/text.mdx | 3 ++- hyperglass/models/config/web.py | 1 + hyperglass/ui/components/output/fields.tsx | 11 +++++++---- hyperglass/ui/types/config.ts | 1 + 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/docs/docs/ui/text.mdx b/docs/docs/ui/text.mdx index fc41528..97c59b6 100644 --- a/docs/docs/ui/text.mdx +++ b/docs/docs/ui/text.mdx @@ -16,11 +16,12 @@ description: Customize the text used in the web UI | `fqdn_message` | String | `'Your browser has resolved {fqdn} to'` | Text displayed when prompting a user to select a resolve IPv4 or IPv6 address for an FQDN query. | | `fqdn_error` | String | `'Unable to resolve {fqdn}'` | Text displayed when an FQDN is not resolvable. | | `fqdn_button` | String | `'Try Again'` | Button text used when an FQDN is not resolvable. | +| `no_communities` | String | `'No Communities'` | Shown in table output when a route has no communities. | | `query_location` | String | `'Location'` | Query Location (router) form label. | | `query_target` | String | `'Target'` | Query Target (IP/hostname/community/AS Path) form label. | | `query_type` | String | `'Query Type'` | Query Type (BGP Route, Ping, Traceroute, etc.) form label. | | `query_vrf` | String | `'Routing Table'` | Query VRF form label. | -| `subtitle` | String | `'Network Looking Glass'` | Subtitle text. value. | +| `subtitle` | String | `'Network Looking Glass'` | Subtitle text. | | `title` | String | `'hyperglass'` | Title text. | | `title_mode` | String | `'text_only'` | Set the title mode. Must be text_only, logo_only, logo_subtitle, or all | diff --git a/hyperglass/models/config/web.py b/hyperglass/models/config/web.py index a86b733..dd0ea4a 100644 --- a/hyperglass/models/config/web.py +++ b/hyperglass/models/config/web.py @@ -136,6 +136,7 @@ class Text(HyperglassModel): rpki_valid: StrictStr = "Valid" rpki_unknown: StrictStr = "No ROAs Exist" rpki_unverified: StrictStr = "Not Verified" + no_communities: StrictStr = "No Communities" @validator("title_mode") def validate_title_mode(cls, value): diff --git a/hyperglass/ui/components/output/fields.tsx b/hyperglass/ui/components/output/fields.tsx index a78908e..4ad8a0b 100644 --- a/hyperglass/ui/components/output/fields.tsx +++ b/hyperglass/ui/components/output/fields.tsx @@ -1,8 +1,8 @@ import { forwardRef } from 'react'; -import { Icon, Text, Box, Tooltip, Menu, MenuButton, MenuList } from '@chakra-ui/react'; +import { Icon, Text, Box, Tooltip, Menu, MenuButton, MenuList, Link } from '@chakra-ui/react'; import { CgMoreO as More } from '@meronex/icons/cg'; import { BisError as Warning } from '@meronex/icons/bi'; -import { MdNotInterested as NotAllowed } from '@meronex/icons/md'; +import { MdCancel as NotAllowed } from '@meronex/icons/md'; import { RiHome2Fill as End } from '@meronex/icons/ri'; import { BsQuestionCircleFill as Question } from '@meronex/icons/bs'; import { FaCheckCircle as Check, FaChevronRight as ChevronRight } from '@meronex/icons/fa'; @@ -109,13 +109,16 @@ export const ASPath: React.FC = (props: TASPath) => { export const Communities: React.FC = (props: TCommunities) => { const { communities } = props; + const { web } = useConfig(); const bg = useColorValue('white', 'gray.900'); const color = useOpposingColor(bg); return ( <> - - + + + + diff --git a/hyperglass/ui/types/config.ts b/hyperglass/ui/types/config.ts index 3e2df27..b7695d9 100644 --- a/hyperglass/ui/types/config.ts +++ b/hyperglass/ui/types/config.ts @@ -45,6 +45,7 @@ export interface IConfigWebText { rpki_valid: string; rpki_unknown: string; rpki_unverified: string; + no_communities: string; } export interface TConfigGreeting {