From c9febf39b7517a04129928e53766714392d61f98 Mon Sep 17 00:00:00 2001 From: checktheroads Date: Sun, 30 May 2021 14:36:12 -0700 Subject: [PATCH] Update docs for #140 --- docs/docs/ui/configuration.mdx | 70 +++++++++++++++++++++++----------- docs/docs/ui/example.mdx | 70 ++++++++++++++++++++++------------ 2 files changed, 94 insertions(+), 46 deletions(-) diff --git a/docs/docs/ui/configuration.mdx b/docs/docs/ui/configuration.mdx index bd90e40..efef189 100644 --- a/docs/docs/ui/configuration.mdx +++ b/docs/docs/ui/configuration.mdx @@ -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. Must be cloudflare or google | -### `external_link` +### `links` -| 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 Global Settings | +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 Global Settings | +| `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 + +```yaml title="hyperglass.yaml" +web: + menus: + - title: Help + content: "Please contact [support@example.com](mailto:support@example.com) to get support." + - title: Terms & Conditions + content: /etc/hyperglass/terms-and-conditions.md + side: right +``` ### `greeting` @@ -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 | diff --git a/docs/docs/ui/example.mdx b/docs/docs/ui/example.mdx index 89ee7f5..25c1c6c 100644 --- a/docs/docs/ui/example.mdx +++ b/docs/docs/ui/example.mdx @@ -7,7 +7,7 @@ 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: @@ -15,46 +15,67 @@ web: 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" @@ -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