mirror of
https://github.com/checktheroads/hyperglass
synced 2024-05-11 05:55:08 +00:00
improve cache handling
This commit is contained in:
@@ -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:
|
||||
|
@@ -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."""
|
||||
|
Reference in New Issue
Block a user