mirror of
https://github.com/thatmattlove/hyperglass.git
synced 2026-01-17 08:48:05 +00:00
Add 504 error options
This commit is contained in:
parent
c6b0e00269
commit
c2b8508eeb
1 changed files with 12 additions and 6 deletions
|
|
@ -106,10 +106,12 @@ def codes():
|
|||
code_dict = {
|
||||
# 200: renders standard display text
|
||||
"success": 200,
|
||||
# 405: Renders Bulma "warning" class notification message with message text
|
||||
# 405: Renders Bulma "warning" class notification with message text
|
||||
"warning": 405,
|
||||
# 415: Renders Bulma "danger" class notification message with message text
|
||||
# 415: Renders Bulma "danger" class notification with message text
|
||||
"danger": 415,
|
||||
# 504: Renders Bulma "danger" class notifiction, used for Ping/Traceroute errors
|
||||
"error": 504,
|
||||
}
|
||||
return code_dict
|
||||
|
||||
|
|
@ -117,16 +119,17 @@ def codes():
|
|||
def codes_reason():
|
||||
"""Reusable status code descriptions"""
|
||||
code_desc_dict = {
|
||||
200: "Valid Query",
|
||||
405: "Query Not Allowed",
|
||||
415: "Query Invalid",
|
||||
"200": "Valid Query",
|
||||
"405": "Query Not Allowed",
|
||||
"415": "Query Invalid",
|
||||
"504": "Unable to reach Ping target",
|
||||
}
|
||||
return code_desc_dict
|
||||
|
||||
|
||||
def rest_list():
|
||||
"""Returns list of supported hyperglass API types"""
|
||||
rest = ["frr"]
|
||||
rest = ["frr", "bird"]
|
||||
return rest
|
||||
|
||||
|
||||
|
|
@ -403,6 +406,9 @@ def params():
|
|||
branding["text"]["500"]["button"] = config["branding"]["text"]["500"].get(
|
||||
"button", "Home"
|
||||
)
|
||||
branding["text"]["504"]["message"] = config["branding"]["text"]["504"].get(
|
||||
"message", "Unable to reach <b>{target}</b>."
|
||||
)
|
||||
branding["logo"] = config["branding"]["logo"]
|
||||
branding["logo"]["path"] = config["branding"]["logo"].get(
|
||||
"path", "static/images/hyperglass-dark.png"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue