From a4664e9f3f22b300d8a3ba822cb845320706a3e2 Mon Sep 17 00:00:00 2001 From: checktheroads Date: Mon, 28 Sep 2020 08:26:44 -0700 Subject: [PATCH] add UI build to setup flow & clarify docs per #79 --- docs/docs/setup.mdx | 13 ------------- docs/docs/ui/configuration.mdx | 33 +++++++++++++++++++++++++++------ hyperglass/cli/commands.py | 2 ++ 3 files changed, 29 insertions(+), 19 deletions(-) diff --git a/docs/docs/setup.mdx b/docs/docs/setup.mdx index c619a20..c49abb4 100644 --- a/docs/docs/setup.mdx +++ b/docs/docs/setup.mdx @@ -60,16 +60,3 @@ hyperglass also includes a [systemd](https://systemd.io/) service file, which ca ```shell-session $ sudo systemctl enable hyperglass ``` - -## UI 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). - -It is recommended to run an initial UI build after running the setup wizard, so that you can verify that the installation is working prior to diving into configuration. - -```shell-session -$ hyperglass build-ui -✅ Completed UI build in production mode -``` - -The UI build will run automatically any time the hyperglass configuration or version changes. diff --git a/docs/docs/ui/configuration.mdx b/docs/docs/ui/configuration.mdx index bfa6047..875df9e 100644 --- a/docs/docs/ui/configuration.mdx +++ b/docs/docs/ui/configuration.mdx @@ -12,6 +12,27 @@ 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). + +This UI build process can be run manually via the hyperglass CLI: + +```shell-session +$ hyperglass build-ui +✅ Completed UI build in production mode +``` + +Or with the `--build-ui` CLI flag on startup: + +```shell-session +$ hyperglass start --build-ui +``` + +The UI build will run automatically any time the hyperglass configuration or version changes. + +## Sections +
The `web` subsection contains multiple subsections of its own, should you wish to customize various aspects of the UI: @@ -28,7 +49,7 @@ The `web` subsection contains multiple subsections of its own, should you wish t | `text` | Text, title, & names | ➡️ | | `theme` | Colors & Fonts | ➡️ | -## `credit` +### `credit` | Parameter | Type | Default | Description | | :-------- | :-----: | :-----: | :--------------------------------------------------------------------------------------- | @@ -38,13 +59,13 @@ The `web` subsection contains multiple subsections of its own, should you wish t If your organization's policy allows, and you don't mind, I request that you keep `credit` enabled. Remember: my goal for this project is get more networks to use looking glasses to make all of our lives easier. Because it's primarily other network operators who will use this tool to begin with, I'd love for any operators that use your looking glass to know where they can get their own. ::: -## `dns_provider` +### `dns_provider` | Parameter | Type | Default | Description | | :-------- | :----: | :------------: | :---------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `name` | String | `'cloudflare'` | DNS over HTTPS provider for in-browser DNS resolution. Cloudflare & Google supported. Must be cloudflare or google | -## `external_link` +### `external_link` | Parameter | Type | Default | Description | | :-------- | :-----: | :---------------------------------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------- | @@ -52,7 +73,7 @@ If your organization's policy allows, and you don't mind, I request that you kee | `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 | -## `greeting` +### `greeting` | Parameter | Type | Default | Description | | :--------- | :-----: | :----------- | :------------------------------------------------------------------------------------------- | @@ -62,7 +83,7 @@ If your organization's policy allows, and you don't mind, I request that you kee | `button` | String | `'Continue'` | Button text. | | `required` | Boolean | `false` | If `true` the user must click the button in order to submit a query. | -## `opengraph` +### `opengraph` If you're not familiar with [OpenGraph](https://ogp.me/), it's the thing that generates the pretty pictures, titles, and descriptions for links when you post them to sites/tools such as Facebook, Twitter, Slack, etc. @@ -75,7 +96,7 @@ By default, [this Opengraph image](/opengraph.jpg) is set. If you define one wit | :-------- | :----: | :---------------------- | | `image` | String | Path to opengraph image | -## `terms` +### `terms` | Parameter | Type | Default | Description | | :-------- | :-----: | :-------- | :-------------------------------------------------------------------------------------------- | diff --git a/hyperglass/cli/commands.py b/hyperglass/cli/commands.py index 94811b4..383cce0 100644 --- a/hyperglass/cli/commands.py +++ b/hyperglass/cli/commands.py @@ -230,6 +230,8 @@ def setup(unattended): write_to_file(systemd_file, systemd) install_systemd(install_path) + build_ui() + @hg.command( "system-info",