home.gohtml 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. {{ define "home" -}}
  2. <!DOCTYPE html>
  3. <html lang="en">
  4. <head>
  5. <meta charset="UTF-8">
  6. <title>SQS Redriver</title>
  7. <link rel="stylesheet" href="/assets/styles.css"/>
  8. <link rel="stylesheet" href="/assets/bootstrap.min.css">
  9. </head>
  10. <body>
  11. <main class="container">
  12. <div class="container mt-5">
  13. <nav aria-label="breadcrumb">
  14. <ol class="breadcrumb">
  15. <li class="breadcrumb-item">Home</li>
  16. </ol>
  17. </nav>
  18. </div>
  19. <h1 class="text-3xl font-bold underline">SQS Queues
  20. {{ if .prefix }}
  21. matching prefix: {{ .prefix }}
  22. {{ end}}
  23. </h1>
  24. <table id="home-table" class="table">
  25. <caption>Having DLQs not allowing any source queue is a configuration anomaly.
  26. So is having a DLQ allowing a source queue and that source using another DLQ instead.
  27. </caption>
  28. <thead>
  29. <th scope="col">Queue name</th>
  30. <th scope="col">DLQ name</th>
  31. </thead>
  32. <tbody>
  33. {{ range .rows }}
  34. {{ template "home-row" . }}
  35. {{ end }}
  36. </tbody>
  37. </table>
  38. </main>
  39. </body>
  40. </html>
  41. {{ end }}
  42. {{ define "home-row" }}
  43. <tr>
  44. <td>{{ template "home-cell" (index . 0) }}</td>
  45. <td>{{ template "home-cell" (index . 1) }}</td>
  46. </tr>
  47. {{ end }}
  48. {{ define "home-cell" }}
  49. {{ if .Message }}
  50. <p class="lead">{{ .Message }}</p>
  51. {{else if .Link }}
  52. <a href="{{ .Link.URL }}">{{ .Link.Text }}</a>
  53. {{ else }}
  54. {{/* Bound queues: 3 named lists */}}
  55. {{ if eq (len .Links) 3 }}
  56. {{ if index .Links 0 }}
  57. <p class="lead">Bound queues</p>
  58. {{end }}
  59. <ul>
  60. {{ range index .Links 0 }}
  61. <li><a href="{{ .URL }}">{{ .Text }}</a></li>
  62. {{ end }}
  63. </ul>
  64. {{ if index .Links 1 }}
  65. <p class="lead">Allowed source queues using another DLQ</p>
  66. {{end }}
  67. <ul>
  68. {{ range index .Links 1 }}
  69. <li><a href="{{ .URL }}">{{ .Text }}</a></li>
  70. {{ end }}
  71. </ul>
  72. {{ if index .Links 2 }}
  73. <p class="lead">Allowed source queues not declaring a DLQ</p>
  74. {{ end}}
  75. <ul>
  76. {{ range index .Links 2 }}
  77. <li><a href="{{ .URL }}">{{ .Text }}</a></li>
  78. {{ end }}
  79. </ul>
  80. {{ else }}
  81. {{ range .Links }}
  82. <ul>
  83. {{ range . }}
  84. <li><a href="{{ .URL }}">{{ .Text }}</a></li>
  85. {{ end }}
  86. </ul>
  87. {{ end }}
  88. {{end}}
  89. {{ end }}
  90. {{ end }}