Skip to content

Commit

Permalink
Update docs for #140
Browse files Browse the repository at this point in the history
  • Loading branch information
thatmattlove committed May 30, 2021
1 parent 1aa08cc commit c9febf3
Show file tree
Hide file tree
Showing 2 changed files with 94 additions and 46 deletions.
70 changes: 48 additions & 22 deletions docs/docs/ui/configuration.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,55 @@ If your organization's policy allows, and you don't mind, I request that you kee
| :-------- | :----: | :------------: | :---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `name` | String | `'cloudflare'` | DNS over HTTPS provider for in-browser DNS resolution. Cloudflare & Google supported. <MiniNote>Must be <Code>cloudflare</Code> or <Code>google</Code></MiniNote> |

### `external_link`
### `links`

Specify an array/list of links to show in the footer. By default, a link to your ASN's PeeringDB page is used.

| Parameter | Type | Default | Description |
| :---------- | :-----: | :---------------------------------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------- |
| `title` | String | `'PeeringDB'` | Link title/label |
| `url` | String | `'https://www.peeringdb.com/asn/{primary_asn}'` | Target URL. `{primary_asn}` will be replaced with the `primary_asn` value from <Link to="/docs/configuration#global-settings">Global Settings</Link> |
| `show_icon` | Boolean | `true` | Show an icon on the right side of the link indicating that the link will take the user away from the hyperglass page. |
| `side` | String | `'left'` | Show the link on the `'left'` or `'right'` side of the footer. |
| `order` | Integer | `0` | Specify the order of the links (left to right). During rendering, `links` and [`menus`](#menus) are merged, so the order is used to sort both. |

#### Example

```yaml title="hyperglass.yaml"
web:
links:
- title: Website
url: https://www.example.com
side: right
order: 5
- title: PeeringDB
url: https://www.peeringdb.com/asn/{primary_asn}
side: left
order: 2
```
### `menus`

Specify an array/list of menus to show in the footer. A menu's content can be plain text or markdown. By default, generic help and terms & conditions menus are shown.

| Parameter | Type | Default | Description |
| :-------- | :-----: | :------- | :--------------------------------------------------------------------------------------------------------------------------------------------- |
| `title` | String | | Menu title/label |
| `content` | String | | Menu content. Can be any string content, or a path to a plain text or markdown file. |
| `side` | String | `'left'` | Show the menu on the `'left'` or `'right'` side of the footer. |
| `order` | Integer | `0` | Specify the order of the links (left to right). During rendering, [`links`](#links) and `menus` are merged, so the order is used to sort both. |

#### Example

| Parameter | Type | Default | Description |
| :-------- | :-----: | :---------------------------------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------- |
| `enable` | Boolean | `true` | Enable or disable the display of an external link |
| `title` | String | `'PeeringDB'` | Link title/label |
| `url` | String | `'https://www.peeringdb.com/asn/{primary_asn}'` | Target URL. `{primary_asn}` will be replaced with the `primary_asn` value from <Link to="/docs/configuration#global-settings">Global Settings</Link> |
```yaml title="hyperglass.yaml"
web:
menus:
- title: Help
content: "Please contact [[email protected]](mailto:[email protected]) to get support."
- title: Terms & Conditions
content: /etc/hyperglass/terms-and-conditions.md
side: right
```

### `greeting`

Expand All @@ -96,19 +138,3 @@ By default, [this Opengraph image](/opengraph.jpg) is set. If you define one wit
| Parameter | Type | Description |
| :-------- | :----: | :---------------------- |
| `image` | String | Path to opengraph image |

### `help_menu`

| Parameter | Type | Default | Description |
| :-------- | :-----: | :------- | :------------------------------------------------------------------------------------------- |
| `enable` | Boolean | `true` | Enable or display the display of the help menu |
| `file` | String | | Path to a plain text or markdown file with content to override the default help menu content |
| `title` | String | `'Help'` | Help menu title |

### `terms`

| Parameter | Type | Default | Description |
| :-------- | :-----: | :-------- | :-------------------------------------------------------------------------------------------- |
| `enable` | Boolean | `true` | Enable or display the display of terms & conditions |
| `file` | String | | Path to a plain text or markdown file with content to override the default terms & conditions |
| `title` | String | `'Terms'` | Terms & conditions title |
70 changes: 46 additions & 24 deletions docs/docs/ui/example.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,54 +7,75 @@ keywords:
description: See how to the hyperglass UI should be configured.
---

## Example
This is an example of every UI configuration option. You don't need to specify any of these for hyperglass to work; all parameters are optional.

```yaml title="hyperglass.yaml"
web:
credit:
enable: true
dns_provider:
name: cloudflare
external_link:
url: https://cloudflare-dns.com/dns-query
greeting:
button: Continue
enable: true
title: PeeringDB
url: https://www.peeringdb.com/asn/{primary_asn}
help_menu:
enable: true
file: null
title: Help
file: /etc/hyperglass/greeting.md
required: true
title: Welcome
links:
- order: 0
show_icon: true
side: left
title: PeeringDB
url: https://www.peeringdb.com/asn/{primary_asn}
logo:
dark: /home/ubuntu/hyperglass/hyperglass-light.svg
light: /home/ubuntu/hyperglass/hyperglass-dark.svg
favicon: /home/ubuntu/hyperglass/hyperglass-icon.svg
dark: /Users/ml/dev/hyperglass/hyperglass/images/hyperglass-dark.svg
favicon: /Users/ml/dev/hyperglass/hyperglass/images/hyperglass-icon.svg
height: null
width: "75%"
light: /Users/ml/dev/hyperglass/hyperglass/images/hyperglass-light.svg
width: 100%
menus:
- content: /etc/hyperglass/terms.md
order: 0
side: left
title: Terms
- content: /etc/hyperglass/help.md
order: 0
side: left
title: Help
opengraph:
image: /home/ubuntu/hyperglass/hyperglass-opengraph.png
terms:
enable: true
file: null
title: Terms
image: /etc/hyperglass/opengraph.png
text:
cache: Results will be cached for 2 minutes.
fqdn_tooltip: "Use {protocol}"
cache_icon: Cached from {time} UTC
cache_prefix: "Results cached for "
complete_time: Completed in {seconds}
fqdn_error: Unable to resolve {fqdn}
fqdn_error_button: Try Again
fqdn_message: Your browser has resolved {fqdn} to
fqdn_tooltip: Use {protocol}
no_communities: No Communities
query_location: Location
query_target: Target
query_type: Query Type
query_vrf: Routing Table
subtitle: AS65001
rpki_invalid: Invalid
rpki_unknown: No ROAs Exist
rpki_unverified: Not Verified
rpki_valid: Valid
subtitle: Network Looking Glass
title: hyperglass
title_mode: text_only
title_mode: logo_subtitle
theme:
default_color_mode: light
colors:
black: "#121212"
black: "#000"
blue: "#314cb6"
cyan: "#118ab2"
danger: "#d84b4b"
dark: "#010101"
error: "#ff6b35"
gray: "#c1c7cc"
green: "#35b246"
light: "#f5f6f7"
orange: "#ff6b35"
pink: "#f2607d"
primary: "#118ab2"
Expand All @@ -64,8 +85,9 @@ web:
success: "#35b246"
teal: "#35b299"
warning: "#edae49"
white: "#f7f7f7"
white: "#fff"
yellow: "#edae49"
default_color_mode: null
fonts:
body: Nunito
mono: Fira Code
Expand Down

0 comments on commit c9febf3

Please sign in to comment.