From b5b76008808e95d9fa0e941f31d54c5cff7b2d60 Mon Sep 17 00:00:00 2001 From: checktheroads Date: Tue, 28 Jan 2020 09:51:58 -0700 Subject: [PATCH] =?UTF-8?q?refactor=20params.opengraph=20=E2=86=92=20param?= =?UTF-8?q?s.web.opengraph?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hyperglass/configuration/models/web.py | 5 ++++- ui/components/Meta.js | 6 +++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/hyperglass/configuration/models/web.py b/hyperglass/configuration/models/web.py index 21b744b..a21eb3e 100644 --- a/hyperglass/configuration/models/web.py +++ b/hyperglass/configuration/models/web.py @@ -17,6 +17,7 @@ from pydantic.color import Color # Project Imports from hyperglass.configuration.models._utils import HyperglassModel +from hyperglass.configuration.models.opengraph import OpenGraph class Web(HyperglassModel): @@ -168,6 +169,7 @@ class Web(HyperglassModel): info: StrictStr = "Help" peeringdb = "PeeringDB" fqdn_tooltip: StrictStr = "Use {protocol}" + cache: StrictStr = "Results will be cached for {timeout} {period}." class Error404(HyperglassModel): """Validation model for 404 Error Page.""" @@ -188,9 +190,10 @@ class Web(HyperglassModel): colors: Colors = Colors() credit: Credit = Credit() + external_link: ExternalLink = ExternalLink() font: Font = Font() help_menu: HelpMenu = HelpMenu() logo: Logo = Logo() - external_link: ExternalLink = ExternalLink() + opengraph: OpenGraph = OpenGraph() terms: Terms = Terms() text: Text = Text() diff --git a/ui/components/Meta.js b/ui/components/Meta.js index 2ab9ed7..32e7396 100644 --- a/ui/components/Meta.js +++ b/ui/components/Meta.js @@ -31,9 +31,9 @@ export default () => { const language = config?.language || "en"; const currentYear = new Date().getFullYear(); const copyright = config ? `${currentYear} ${config.org_name}` : `${currentYear} hyperglass`; - const ogImage = config?.opengraph.image || null; - const ogImageHeight = config?.opengraph.height || null; - const ogImageWidth = config?.opengraph.width || null; + const ogImage = config?.web.opengraph.image || null; + const ogImageHeight = config?.web.opengraph.height || null; + const ogImageWidth = config?.web.opengraph.width || null; const primaryFont = googleFontUrl(theme.fonts.body); const monoFont = googleFontUrl(theme.fonts.mono); useEffect(() => {