From 07da911b05775988c9f80bcda3ed53c143f1c995 Mon Sep 17 00:00:00 2001 From: Chandler Swift Date: Mon, 18 Oct 2021 23:01:29 -0500 Subject: [PATCH] Add error display --- template.html | 31 +++++++++++++++++++++++++++---- 1 file changed, 27 insertions(+), 4 deletions(-) diff --git a/template.html b/template.html index 6790977..a6fec00 100644 --- a/template.html +++ b/template.html @@ -11,22 +11,44 @@ img { max-width: 100%; box-shadow: 0 0 10px 10px lightgray; } img:hover { box-shadow: 0 0 10px 10px darkgray} h3 { margin-top: 100px; } + .errors { padding: 0.5rem; border: 1px solid #f5c6cb; color: #721c24; background: #f8d7da; } * { line-height: 1.5em; }

{n}hats.com domains

+ {{ $errors := false -}} + {{- range . -}} + {{- with .Error -}} + {{- $errors = true -}} + {{- end -}} + {{- end -}} + {{- if $errors -}} +
+

Errors occurred during processing

+
    + {{- range . -}} + {{- if .Error }} +
  1. {{.DomainName}}: {{.Error}}
  2. + {{ end -}} + {{- end -}} +
+
+ {{end}}

Summary

{{range .}} + {{if not .Error}}

{{.DomainName}}

Fetched
@@ -52,5 +74,6 @@ {{end}} {{end}} + {{end}}