1
0
mirror of https://github.com/checktheroads/hyperglass synced 2024-05-11 05:55:08 +00:00

improve cache handling

This commit is contained in:
checktheroads
2020-04-16 23:43:02 -07:00
parent fa38d49a8e
commit 400685304f
15 changed files with 210 additions and 355 deletions

View File

@@ -28,7 +28,7 @@ class Cache(HyperglassModel):
show_text: StrictBool = Field(
True,
title="Show Text",
description="Show the [cache](/fixme) text in the hyperglass UI.",
description="Show the cache text in the hyperglass UI.",
)
class Config:

View File

@@ -138,7 +138,9 @@ class Text(HyperglassModel):
query_target: StrictStr = "Target"
query_vrf: StrictStr = "Routing Table"
fqdn_tooltip: StrictStr = "Use {protocol}" # Formatted by Javascript
cache: StrictStr = "Results will be cached for {timeout} {period}."
cache_prefix: StrictStr = "Results cached for "
cache_icon: StrictStr = "Cached Response"
complete_time: StrictStr = "Completed in {seconds}" # Formatted by Javascript
@validator("title_mode")
def validate_title_mode(cls, value):
@@ -147,6 +149,11 @@ class Text(HyperglassModel):
value = "logo_subtitle"
return value
@validator("cache_prefix")
def validate_cache_prefix(cls, value):
"""Ensure trailing whitespace."""
return " ".join(value.split()) + " "
class ThemeColors(HyperglassModel):
"""Validation model for theme colors."""