add no_communities text field

This commit is contained in:
checktheroads 2021-02-12 23:08:23 -07:00
parent 9f50f41f7d
commit 3886925501
4 changed files with 11 additions and 5 deletions

View file

@ -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. <MiniNote>Must be <Code>text_only</Code>, <Code>logo_only</Code>, <Code>logo_subtitle</Code>, or <Code>all</Code></MiniNote> |

View file

@ -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):

View file

@ -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<TASPath> = (props: TASPath) => {
export const Communities: React.FC<TCommunities> = (props: TCommunities) => {
const { communities } = props;
const { web } = useConfig();
const bg = useColorValue('white', 'gray.900');
const color = useOpposingColor(bg);
return (
<>
<If c={communities.length === 0}>
<Tooltip placement="right" hasArrow label="No Communities">
<Icon as={Question} />
<Tooltip placement="right" hasArrow label={web.text.no_communities}>
<Link>
<Icon as={Question} />
</Link>
</Tooltip>
</If>
<If c={communities.length !== 0}>

View file

@ -45,6 +45,7 @@ export interface IConfigWebText {
rpki_valid: string;
rpki_unknown: string;
rpki_unverified: string;
no_communities: string;
}
export interface TConfigGreeting {