From 4961d1dd780b9b47909e935c332abdcea6011119 Mon Sep 17 00:00:00 2001 From: checktheroads Date: Tue, 29 Dec 2020 02:06:18 -0700 Subject: [PATCH] add max character length for title & subtitle, update docs [skip ci] --- docs/docs/ui/logo.mdx | 2 +- hyperglass/models/config/web.py | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/docs/docs/ui/logo.mdx b/docs/docs/ui/logo.mdx index 786907e..34dfa46 100644 --- a/docs/docs/ui/logo.mdx +++ b/docs/docs/ui/logo.mdx @@ -13,7 +13,7 @@ description: Customize the Logo & Favicon | `light` | String | hyperglass logo | Path to logo that will be used in light mode | | `dark` | String | hyperglass logo | Path to logo that will be used in dark mode | | `favicon` | String | hyperglass icon | Path to logo that will be used as the favicon | -| `width` | Integer | `75%` | Maximum logo width as a percentage | +| `width` | String | `100%` | Maximum logo width as a percentage | | `height` | Integer | | Maximum logo height as a percentage | ### Favicon diff --git a/hyperglass/models/config/web.py b/hyperglass/models/config/web.py index 1a91a2d..85b432f 100644 --- a/hyperglass/models/config/web.py +++ b/hyperglass/models/config/web.py @@ -30,6 +30,7 @@ Percentage = constr(regex=r"^([1-9][0-9]?|100)\%$") TitleMode = constr(regex=("logo_only|text_only|logo_title|logo_subtitle|all")) ColorMode = constr(regex=r"light|dark") DOHProvider = constr(regex="|".join(DNS_OVER_HTTPS.keys())) +Title = constr(max_length=32) class Analytics(HyperglassModel): @@ -102,7 +103,7 @@ class Logo(HyperglassModel): light: FilePath = DEFAULT_IMAGES / "hyperglass-light.svg" dark: FilePath = DEFAULT_IMAGES / "hyperglass-dark.svg" favicon: FilePath = DEFAULT_IMAGES / "hyperglass-icon.svg" - width: Optional[Union[StrictInt, Percentage]] = "75%" + width: Optional[Union[StrictInt, Percentage]] = "100%" height: Optional[Union[StrictInt, Percentage]] @@ -118,8 +119,8 @@ class Text(HyperglassModel): """Validation model for params.branding.text.""" title_mode: TitleMode = "logo_only" - title: StrictStr = "hyperglass" - subtitle: StrictStr = "Network Looking Glass" + title: Title = "hyperglass" + subtitle: Title = "Network Looking Glass" query_location: StrictStr = "Location" query_type: StrictStr = "Query Type" query_target: StrictStr = "Target"