Display message when feed/logs are empty

Adjust the html templates for web feed and log viewers to check if there's any data to display. If no data, a message is shown informing the user that there's no data.
This commit is contained in:
Ryan Smith
2025-03-18 07:36:01 -07:00
parent 97cddb8cfe
commit 00b747341b
4 changed files with 41 additions and 6 deletions

View File

@@ -140,23 +140,17 @@
/* Content */
/* ======= */
h1 {
/* color: #f34; */
color: #d34;
font-size: 1.95rem;
margin: 0 0 1.5rem 0;
}
p {
/* color: #7de; */
color: #dde;
font-family: 'Consolas', 'Menlo', 'Noto Sans Mono', 'Roboto Mono', 'Moncaco', 'DejaVu Sans Mono', 'Liberation Mono', 'Lucida Console', monospace;
font-size: 1.2rem;
}
.white {
color: #f0a;
}
/* ============= */
/* Media Queries */
/* ============= */

View File

@@ -231,6 +231,16 @@
text-decoration: none;
}
/* ======= */
/* Content */
/* ======= */
p.no-results {
color: #fb0;
font-size: 1.2rem;
padding-top: 1rem;
text-align: center;
}
/* ============= */
/* Media Queries */
/* ============= */
@@ -321,6 +331,7 @@
</nav>
</header>
<main>
{{if .}}
<table>
<thead>
<tr><th>Time<th>Source IP<th>Method<th>Path</tr>
@@ -330,6 +341,9 @@
{{end}}
</tbody>
</table>
{{else}}
<p class="no-results">No log data found</p>
{{end}}
</main>
</body>
</html>

View File

@@ -229,6 +229,16 @@
text-decoration: none;
}
/* ======= */
/* Content */
/* ======= */
p.no-results {
color: #fb0;
font-size: 1.2rem;
padding-top: 1rem;
text-align: center;
}
/* ============= */
/* Media Queries */
/* ============= */
@@ -314,6 +324,7 @@
</nav>
</header>
<main>
{{if .}}
<table>
<thead>
<tr><th>Time<th>Source IP<th>Username<th>Password</tr>
@@ -323,6 +334,9 @@
{{end}}
</tbody>
</table>
{{else}}
<p class="no-results">No log data found</p>
{{end}}
</main>
</body>
</html>

View File

@@ -228,6 +228,15 @@
text-decoration: none;
}
/* ======= */
/* Content */
/* ======= */
p.no-results {
color: #fb0;
font-size: 1.2rem;
text-align: center;
}
/* ============= */
/* Media Queries */
/* ============= */
@@ -350,6 +359,7 @@
</nav>
</header>
<main>
{{if .Data}}
<table>
<thead>
<tr>
@@ -376,6 +386,9 @@
{{end}}
</tbody>
</table>
{{else}}
<p class="no-results">The threat feed is currently empty</p>
{{end}}
</main>
</body>
</html>