docs updates [skip ci]

This commit is contained in:
checktheroads 2020-02-29 08:59:29 -07:00
parent 9ffba1372c
commit 15e35fcbeb
10 changed files with 166 additions and 47 deletions

11
docs/docs/agent.mdx Normal file
View file

@ -0,0 +1,11 @@
---
id: agent
title: Linux Agent
sidebar_label: Linux Agent
keywords: [configuration, linux, frr, frrouting, bird, agent]
description: hyperglass agent configuration
---
:::important Coming Soon
Documentation for [hyperglass-agent](https://github.com/checktheroads/hyperglass-agent) coming soon!
:::

30
docs/docs/license.mdx Normal file
View file

@ -0,0 +1,30 @@
---
id: license
title: License
sidebar_label: License
keywords: [hyperglass, license, open source]
description: hyperglass License
---
import Datetime from "../src/components/Datetime";
import styles from "./styles.module.css";
### The Clear BSD License
Copyright © <Datetime className={styles.year} year/> Matthew Love
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted (subject to the limitations in the disclaimer below) provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
- Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED BY THIS LICENSE.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

View file

@ -1,3 +1,7 @@
.getStarted[class][class]:not(.button--active):not(:hover) {
color: var(--ifm-color-secondary);
}
.year {
color: var(--ifm-color-primary);
}

View file

@ -15,7 +15,9 @@
"prismjs": "^1.19.0",
"prop-types": "^15.7.2",
"react": "^16.8.4",
"react-dom": "^16.8.4"
"react-dark-mode-toggle": "^0.0.3",
"react-dom": "^16.8.4",
"use-media": "^1.4.0"
},
"browserslist": {
"production": [

View file

@ -3,19 +3,15 @@ module.exports = {
{
type: "category",
label: "Installation",
items: [
"introduction",
"getting-started",
"setup",
"configuration",
"devices",
"ui",
"cache",
"api",
"messages",
"queries"
]
items: ["introduction", "getting-started", "setup"]
},
{ type: "doc", id: "platforms" }
{
type: "category",
label: "Configuration",
items: ["configuration", "devices", "ui", "cache", "api", "messages", "queries"]
},
{ type: "doc", id: "platforms" },
{ type: "doc", id: "agent" },
{ type: "doc", id: "license" }
]
};

View file

@ -0,0 +1,7 @@
import React from "react";
export default ({ year = false, ...props }) => {
const date = new Date();
const granularity = year ? date.getFullYear() : date.toString();
return <span {...props}>{granularity}</span>;
};

View file

@ -32,7 +32,6 @@
--ifm-color-primary-lighter: #ff918f;
--ifm-color-primary-lightest: #ffc4c3;
--ifm-code-font-size: 95%;
--ifm-navbar-background-color: var(--ifm-background-color);
--ifm-font-family-base: "Nunito", system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell,
Noto Sans, sans-serif, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif,
"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
@ -68,6 +67,7 @@ html[data-theme="dark"]:root {
html[data-theme="dark"] .footer.footer--dark {
--ifm-footer-color: var(--ifm-color-emphasis-300);
--ifm-navbar-background-color: var(--ifm-background-color);
}
.footer.footer--dark {

View file

@ -20,6 +20,9 @@ import useThemeContext from "@theme/hooks/useThemeContext";
import useHideableNavbar from "@theme/hooks/useHideableNavbar";
import useLockBodyScroll from "@theme/hooks/useLockBodyScroll";
import DarkModeToggle from "react-dark-mode-toggle";
import useMedia from "use-media";
import Logo from "../../components/Logo";
import styles from "./styles.module.css";
@ -59,6 +62,8 @@ function Navbar() {
const { isDarkTheme, setLightTheme, setDarkTheme } = useThemeContext();
const { navbarRef, isNavbarVisible } = useHideableNavbar(hideOnScroll);
const isMobile = useMedia({ maxWidth: 997 });
useLockBodyScroll(sidebarShown);
const showSidebar = useCallback(() => {
@ -68,10 +73,23 @@ function Navbar() {
setSidebarShown(false);
}, [setSidebarShown]);
const onToggleChange = useCallback(e => (e.target.checked ? setDarkTheme() : setLightTheme()), [
setLightTheme,
setDarkTheme
]);
// const onToggleChange = useCallback(e => (e.target.checked ? setDarkTheme() : setLightTheme()), [
// setLightTheme,
// setDarkTheme
// ]);
// const onToggleChange = e => {
// console.log(e);
// };
// const onToggleChange = useCallback(e => (e ? setDarkTheme() : setLightTheme()), [
// setLightTheme,
// setDarkTheme
// ]);
const onToggleChange = checked => {
checked ? setDarkTheme() : setLightTheme();
};
const logoLink = logo.href || baseUrl;
const isExternalLogoLink = /http/.test(logoLink);
@ -82,7 +100,8 @@ function Navbar() {
}
: null;
const logoSrc = logo.srcDark && isDarkTheme ? logo.srcDark : logo.src;
const logoImageUrl = useBaseUrl(logoSrc);
const logoColor = isDarkTheme ? "#ff5e5b" : "inherit";
return (
<nav
@ -97,14 +116,16 @@ function Navbar() {
>
<div className="navbar__inner">
<div className={classnames("navbar__items", styles.navbarItems)}>
<Link className="navbar__brand" to={baseUrl}>
<Logo color="#fff" size={32} className={styles.logo} />
{title != null && (
<strong className={isSearchBarExpanded ? styles.hideLogoText : ""}>
{title}
</strong>
)}
</Link>
{!isMobile && (
<Link className="navbar__brand" to={baseUrl}>
<Logo color={logoColor} size={32} className={styles.logo} />
{title != null && (
<strong className={isSearchBarExpanded ? styles.hideLogoText : ""}>
{title}
</strong>
)}
</Link>
)}
<div
aria-label="Navigation bar toggle"
className="navbar__toggle"
@ -144,12 +165,21 @@ function Navbar() {
styles.navbarItemsRight
)}
>
{!disableDarkMode && (
<Toggle
className={classnames(styles.displayOnlyInLargeViewport, styles.toggle)}
aria-label="Dark mode toggle"
checked={isDarkTheme}
{isMobile && (
<Link className="navbar__brand" to={baseUrl}>
<Logo color={logoColor} size={32} className={styles.logo} />
{title != null && (
<strong className={isSearchBarExpanded ? styles.hideLogoText : ""}>
{title}
</strong>
)}
</Link>
)}
{!disableDarkMode && !isMobile && (
<DarkModeToggle
speed={2.5}
onChange={onToggleChange}
checked={isDarkTheme}
/>
)}
{links
@ -178,22 +208,19 @@ function Navbar() {
<div role="presentation" className="navbar-sidebar__backdrop" onClick={hideSidebar} />
<div className="navbar-sidebar">
<div className="navbar-sidebar__brand">
<Link className="navbar__brand" onClick={hideSidebar} to={baseUrl}>
{logo != null && (
<img
className="navbar__logo logo--light"
src={logoSrc}
alt={logo.alt}
/>
<Link className="navbar__brand" to={baseUrl}>
<Logo color={logoColor} size={32} className={styles.logo} />
{title != null && (
<strong className={isSearchBarExpanded ? styles.hideLogoText : ""}>
{title}
</strong>
)}
<Logo color="#fff" size={32} className={styles.logo} />
{title != null && <strong>{title}</strong>}
</Link>
{!disableDarkMode && sidebarShown && (
<Toggle
aria-label="Dark mode toggle in sidebar"
checked={isDarkTheme}
<DarkModeToggle
speed={2.5}
onChange={onToggleChange}
checked={isDarkTheme}
/>
)}
</div>

View file

@ -65,7 +65,6 @@ html[data-theme="dark"] .navLink[class]:hover {
.logo {
margin: 4px;
fill: var(--ifm-color-content);
}
html[data-theme="dark"] .navbarOther {

View file

@ -1719,6 +1719,14 @@ babel-plugin-extract-import-names@^1.5.7:
dependencies:
"@babel/helper-plugin-utils" "7.8.3"
babel-runtime@^6.26.0:
version "6.26.0"
resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.26.0.tgz#965c7058668e82b55d7bfe04ff2337bc8b5647fe"
integrity sha1-llxwWGaOgrVde/4E/yM3vItWR/4=
dependencies:
core-js "^2.4.0"
regenerator-runtime "^0.11.0"
bail@^1.0.0:
version "1.0.5"
resolved "https://registry.yarnpkg.com/bail/-/bail-1.0.5.tgz#b6fa133404a392cbc1f8c4bf63f5953351e7a776"
@ -2552,7 +2560,7 @@ core-js-compat@^3.6.2:
browserslist "^4.8.3"
semver "7.0.0"
core-js@^2.6.5:
core-js@^2.4.0, core-js@^2.6.5:
version "2.6.11"
resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.6.11.tgz#38831469f9922bded8ee21c9dc46985e0399308c"
integrity sha512-5wjnpaT/3dV+XB4borEsnAYQchn00XSgTAWKDkEqv+K8KevjbzmofK6hfJ9TZIlpj2N0xQpazy7PiRQiWHqzWg==
@ -5267,6 +5275,24 @@ loose-envify@^1.0.0, loose-envify@^1.1.0, loose-envify@^1.2.0, loose-envify@^1.3
dependencies:
js-tokens "^3.0.0 || ^4.0.0"
"lottie-api@github:bodymovin/lottie-api#master":
version "1.0.2"
resolved "https://codeload.github.com/bodymovin/lottie-api/tar.gz/2015b503589c5f78265942d212e64abd1d756fcf"
lottie-react-web@^2.1.4:
version "2.1.4"
resolved "https://registry.yarnpkg.com/lottie-react-web/-/lottie-react-web-2.1.4.tgz#3159b4600b6baa858175a1c97daa595f85903d6e"
integrity sha512-/wcAxckdTo1uKUgv3hvUktDeeTQByNdRda+1iBQcteV3PyaIikCV0LleSOkBJccYA+v0mM/OZvoSbmQdWxt4+w==
dependencies:
babel-runtime "^6.26.0"
lottie-api bodymovin/lottie-api#master
lottie-web "^5.2.1"
lottie-web@^5.2.1:
version "5.6.5"
resolved "https://registry.yarnpkg.com/lottie-web/-/lottie-web-5.6.5.tgz#3a2f5f6ba64fb492cf8557dae504d06ead132525"
integrity sha512-rpBnawJxb+4QhZz8PyZl6k5y4NpzFrpuV/+c/36w4pryKv6EWb9aEwsqCXl+zK1dYddyFyN1zdvsonJyk7aNTg==
lower-case@^2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/lower-case/-/lower-case-2.0.1.tgz#39eeb36e396115cc05e29422eaea9e692c9408c7"
@ -7154,6 +7180,13 @@ raw-body@2.4.0:
iconv-lite "0.4.24"
unpipe "1.0.0"
react-dark-mode-toggle@^0.0.3:
version "0.0.3"
resolved "https://registry.yarnpkg.com/react-dark-mode-toggle/-/react-dark-mode-toggle-0.0.3.tgz#9725357c19674fca93a7e00b9126d474b50d8126"
integrity sha512-DMdd/ClnVs+i0iV5u0UdLwUHHbUzg2TQCqQB9HFypftfo+S5MU6jtFzqo6gDGl8kIISYqMDAkdmw6nszAUQs7w==
dependencies:
lottie-react-web "^2.1.4"
react-dev-utils@^9.1.0:
version "9.1.0"
resolved "https://registry.yarnpkg.com/react-dev-utils/-/react-dev-utils-9.1.0.tgz#3ad2bb8848a32319d760d0a84c56c14bdaae5e81"
@ -7360,6 +7393,11 @@ regenerate@^1.4.0:
resolved "https://registry.yarnpkg.com/regenerate/-/regenerate-1.4.0.tgz#4a856ec4b56e4077c557589cae85e7a4c8869a11"
integrity sha512-1G6jJVDWrt0rK99kBjvEtziZNCICAuvIPkSiUFIQxVP06RCVpq3dmDo2oi6ABpYaDYaTRr67BEhL8r1wgEZZKg==
regenerator-runtime@^0.11.0:
version "0.11.1"
resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz#be05ad7f9bf7d22e056f9726cee5017fbf19e2e9"
integrity sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==
regenerator-runtime@^0.13.2:
version "0.13.3"
resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.3.tgz#7cf6a77d8f5c6f60eb73c5fc1955b2ceb01e6bf5"
@ -8794,6 +8832,11 @@ url@^0.11.0:
punycode "1.3.2"
querystring "0.2.0"
use-media@^1.4.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/use-media/-/use-media-1.4.0.tgz#e777bf1f382a7aacabbd1f9ce3da2b62e58b2a98"
integrity sha512-XsgyUAf3nhzZmEfhc5MqLHwyaPjs78bgytpVJ/xDl0TF4Bptf3vEpBNBBT/EIKOmsOc8UbuECq3mrP3mt1QANA==
use@^3.1.0:
version "3.1.1"
resolved "https://registry.yarnpkg.com/use/-/use-3.1.1.tgz#d50c8cac79a19fbc20f2911f56eb973f4e10070f"