Re-formatted base view template to be more in-line with PEP8 standards.

Working on dashboard clean-up and redesign.

Added custom Jinja date/time formatting function to utils.py.
This commit is contained in:
Matt Scott
2023-02-19 08:52:00 -05:00
parent bad36b5e75
commit 58aabacd91
4 changed files with 790 additions and 768 deletions

View File

@ -225,6 +225,7 @@ class customBoxes:
}
order = ["reverse", "ip6arpa", "inaddrarpa"]
def pretty_domain_name(domain_name):
# Add a debugging statement to print out the domain name
print("Received domain name:", domain_name)
@ -258,9 +259,16 @@ def to_idna(value, action):
elif action == 'decode':
for split in splits:
if not split.startswith('_') and not split.startswith('--'):
result.append(idna.decode(split))
result.append(idna.decode(split))
else:
result.append(split)
else:
raise Exception('No valid action received')
return '.'.join(result)
def format_datetime(value, format_str="%Y-%m-%d %I:%M %p"):
"""Format a date time to (Default): YYYY-MM-DD HH:MM P"""
if value is None:
return ""
return value.strftime(format_str)