Skip to content

Commit

Permalink
Fix docs build errors
Browse files Browse the repository at this point in the history
  • Loading branch information
thatmattlove committed May 30, 2021
1 parent c98e244 commit 622f48c
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 36 deletions.
9 changes: 3 additions & 6 deletions docs/docs/messages.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ keywords: [configuration, messages, text, ui, customization]
description: hyperglass messages configuration
---

import Link from "@docusaurus/Link";
import Code from "../src/components/JSXCode";

All user-facing status messages can be customized if needed.

<div class="table--full-width" />
Expand All @@ -20,14 +17,14 @@ All user-facing status messages can be customized if needed.
| `authentication_error` | String | `'Authentication error occurred.'` | Displayed when hyperglass is unable to authenticate to a configured device. Usually, this indicates a configuration error. `{device_name}` and `{error}` will be replaced with the device in question and the specific connection error. |
| `connection_error` | String | `'Error connecting to {device_name}: {error}'` | Displayed when hyperglass is unable to connect to a configured device. Usually, this indicates a configuration error. `{device_name}` and `{error}` will be replaced with the device in question and the specific connection error. |
| `feature_not_enabled` | String | `'{feature} is not enabled for {device_name}.'` | Displayed when a query type is submitted that is not supported or disabled. The UI performs validation of supported query types prior to submitting any requests, so this is primarily relevant to the hyperglass API. `{feature}` and `{device_name}` will be replaced with the disabled feature and the selected device/location. |
| `general` | String | `'Something went wrong.'` | Displayed when generalized errors occur. Seeing this error message may indicate a bug in hyperglass, as most other errors produced are highly contextual. If you see this in the wild, try enabling <Link to="/docs/configuration#global-settings"><Code>debug</Code></Link> mode and review the logs to pinpoint the source of the error. |
| `general` | String | `'Something went wrong.'` | Displayed when generalized errors occur. Seeing this error message may indicate a bug in hyperglass, as most other errors produced are highly contextual. If you see this in the wild, try enabling [`debug`](parameters.mdx#global-settings) mode and review the logs to pinpoint the source of the error. |
| `invalid_field` | String | `'{input} is an invalid {field}.'` | Displayed when a query field contains an invalid or unsupported value. `{input}` and `{field}` will be replaced with the invalid input value and corresponding field name. |
| `invalid_input` | String | `'{target} is not a valid {query_type} target.'` | Displayed when a query target's value is invalid in relation to the corresponding query type. `{target}` and `{query_type}` will be replaced with the invalid target and corresponding query type. |
| `no_input` | String | `'{field} must be specified.'` | Displayed when no a required field is not specified. `{field}` will be replaced with the `display_name` of the field that was omitted. |
| `no_output` | String | `'The query completed, but no matching results were found.'` | Displayed when hyperglass can connect to a device and execute a query, but the response is empty. |
| `no_response` | String | `'No response.'` | Displayed when hyperglass can connect to a device, but no output is able to be read. Seeing this error may indicate a bug in hyperglass or one of its dependencies. If you see this in the wild, try enabling <Link to="/docs/configuration#global-settings"><Code>debug</Code></Link> mode and review the logs to pinpoint the source of the error. |
| `no_response` | String | `'No response.'` | Displayed when hyperglass can connect to a device, but no output is able to be read. Seeing this error may indicate a bug in hyperglass or one of its dependencies. If you see this in the wild, try enabling [`debug`](parameters.mdx#global-settings) mode and review the logs to pinpoint the source of the error. |
| `parsing_error` | String | `'An error occurred while parsing the query output.'` | Displayed when hyperglass can connect to a device and execute a query, but the response cannot be parsed. |
| `request_timeout` | String | `'Request timed out.'` | Displayed when the <Link to="/docs/configuration#global-settings"><Code>request_timeout</Code></Link> time expires. |
| `request_timeout` | String | `'Request timed out.'` | Displayed when the [`request_timeout`](parameters.mdx#global-settings) time expires. |
| `vrf_not_associated` | String | `'VRF {vrf_name} is not associated with {device_name}.'` | Displayed when a query request's VRF field value contains a VRF that is not configured or associated with the corresponding location/device. The UI automatically filters out VRFs that are not configured on a selected device, so this error is most likely to appear when using the hyperglass API. `{vrf_name}` and `{device_name}` will be replaced with the VRF in question and corresponding device. |
| `vrf_not_found` | String | `'VRF {vrf_name} is not defined.'` | Displayed when a query VRF is not configured on any devices. The UI only shows configured VRFs, so this error is most likely to appear when using the hyperglass API. `{vrf_name}` will be replaced with the VRF in question. |

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/production.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ While hyperglass is, to the extent possible, fully [asynchronous](https://docs.p
To combat this, hyperglass uses the above worker strategy. **Ultimately, it's important to provision the appropriate number of CPU cores, corresponding to the number of concurrent sessions you might expect to have in your environment** (keeping in mind that if your system supports hyperthreading, each core equates to two workers).

:::note
When [debug](configuration.mdx#global-settings) is set to `true`, the number of workers is set to 1.
When [debug](parameters.mdx#global-settings) is set to `true`, the number of workers is set to 1.
:::

### Memory
Expand Down
25 changes: 12 additions & 13 deletions docs/docs/rest-api.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ keywords: [configuration, api, rest]
description: Configure the REST API
---

import Link from "@docusaurus/Link";
import MiniNote from "../src/components/MiniNote";
import Code from "../src/components/JSXCode";
import PageLink from "../src/components/PageLink";
Expand All @@ -17,18 +16,18 @@ FastAPI provides built in support for both [Swagger UI](https://swagger.io/tools

## Settings

| Parameter | Type | Default | Description |
| :------------ | :-----: | :--------------------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `enable` | Boolean | `true` | Enable or disable the API documentation. |
| `title` | String | `'{site_title} API Documentation'` | API documentation title. `{site_title}` will be replaced with the <Link to="/docs/configuration#global-settings"><Code>site_title</Code></Link> parameter. |
| `description` | String | | API documentation description appearing below the title. |
| `base_url` | String | `'https://lg.example.net'` | The base URL for your hyperglass site. Used by OpenAPI for dynamically creating hyperlinks. |
| `mode` | String | `'redoc'` | OpenAPI UI library to use for the hyperglass API docs. <MiniNote>Must be <Code>redoc</Code> or <Code>swagger</Code></MiniNote> |
| `uri` | String | `'/api/docs'` | HTTP URI/path where API documentation can be accessed. |
| `openapi_uri` | String | `'/openapi.json'` | Path to the automatically generated `openapi.json` file. |
| `queries` | | | `/queries` endpoint settings <PageLink to="#queries">➡️</PageLink> |
| `query` | | | `/query` endpoint settings <PageLink to="#query">➡️</PageLink> |
| `devices` | | | `/devices` endpoint settings <PageLink to="#devices">➡️</PageLink> |
| Parameter | Type | Default | Description |
| :------------ | :-----: | :--------------------------------- | :----------------------------------------------------------------------------------------------------------------------------- |
| `enable` | Boolean | `true` | Enable or disable the API documentation. |
| `title` | String | `'{site_title} API Documentation'` | API documentation title. `{site_title}` will be replaced with the [`site_title`](parameters.mdx#global-settings) parameter. |
| `description` | String | | API documentation description appearing below the title. |
| `base_url` | String | `'https://lg.example.net'` | The base URL for your hyperglass site. Used by OpenAPI for dynamically creating hyperlinks. |
| `mode` | String | `'redoc'` | OpenAPI UI library to use for the hyperglass API docs. <MiniNote>Must be <Code>redoc</Code> or <Code>swagger</Code></MiniNote> |
| `uri` | String | `'/api/docs'` | HTTP URI/path where API documentation can be accessed. |
| `openapi_uri` | String | `'/openapi.json'` | Path to the automatically generated `openapi.json` file. |
| `queries` | | | `/queries` endpoint settings <PageLink to="#queries">➡️</PageLink> |
| `query` | | | `/query` endpoint settings <PageLink to="#query">➡️</PageLink> |
| `devices` | | | `/devices` endpoint settings <PageLink to="#devices">➡️</PageLink> |

### `queries`

Expand Down
17 changes: 8 additions & 9 deletions docs/docs/ui/configuration.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,14 @@ keywords: [hyperglass, looking glass, web ui, gui, theme, colors, branding]
description: Customize the Web UI
---

import Link from "@docusaurus/Link";
import R from "../../src/components/Required";
import MiniNote from "../../src/components/MiniNote";
import Code from "../../src/components/JSXCode";
import PageLink from "../../src/components/PageLink";

## Build

hyperglass is build with [NextJS](https://nextjs.org/), a [React](https://reactjs.org/)-based UI framework that supports server-side rendering and static exporting, which contribute to hyperglass's speed and SEO-friendliness. At startup, hyperglass creates a new "UI build", which is a static export of the site and includes some elements of the [configuration](parameters).
hyperglass is build with [NextJS](https://nextjs.org/), a [React](https://reactjs.org/)-based UI framework that supports server-side rendering and static exporting, which contribute to hyperglass's speed and SEO-friendliness. At startup, hyperglass creates a new "UI build", which is a static export of the site and includes some elements of the [configuration](parameters.mdx).

This UI build process can be run manually via the hyperglass CLI:

Expand Down Expand Up @@ -70,13 +69,13 @@ If your organization's policy allows, and you don't mind, I request that you kee

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. |
| 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](parameters.mdx#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

Expand Down
Loading

0 comments on commit 622f48c

Please sign in to comment.