Gemini, trying to make this "done".

This commit is contained in:
Kalzu Rekku
2025-06-11 22:27:46 +03:00
parent d93b0ee4ee
commit 1cbf9311e5
7 changed files with 300 additions and 135 deletions

View File

@ -4,19 +4,23 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Node Monitor</title>
<link rel="stylesheet" href="/static/style.css">
<link rel="stylesheet" href="{{ url_for('static', path='/style.css') }}">
</head>
<body>
<div class="header-container">
<h1>Node Monitoring System</h1>
<p>Total Nodes: <span id="node-count">0</span></p>
<p id="service-uuid" style="display: none;">Service UUID: <code>{{ service_uuid }}</code></p>
<p>Service UUID: <code>{{ service_uuid }}</code></p> <!-- Always display service UUID -->
</div>
<div id="node-grid-container">
<p class="loading-message">Loading node data...</p>
</div>
<script src="/static/script.js"></script>
<script>
// Pass the base path for API calls if mounted under a subpath
window.API_BASE_PATH = "{{ root_path }}";
</script>
<script src="{{ url_for('static', path='/script.js') }}"></script>
</body>
</html>

View File

@ -1,21 +1,66 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="refresh" content="5"> <!-- Fallback auto-refresh -->
<!-- Removed: <meta http-equiv="refresh" content="5"> -->
<title>Node Monitor Logs - {{ service_uuid }}</title>
<link rel="stylesheet" href="/static/style.css">
<link rel="stylesheet" href="{{ url_for('static', path='/style.css') }}">
</head>
<body>
<div class="header-container">
<h1>Node Monitor Logs</h1>
<p>Service UUID: <code>{{ service_uuid }}</code></p>
<p>Total Logs: <span id="log-count">0</span> (Auto-refreshing every 5 seconds)</p>
<p>Total Logs: <span id="log-count">{{ log_count }}</span> (Auto-refreshing every 5 seconds)</p>
<div class="filter-container">
<fieldset>
<legend>Log Level</legend>
<label><input type="radio" name="log-level" value="" checked> All</label>
<label><input type="radio" name="log-level" value="INFO"> INFO</label>
<label><input type="radio" name="log-level" value="WARNING"> WARNING</label>
<label><input type="radio" name="log-level" value="ERROR"> ERROR</label>
</fieldset>
<label for="since-filter">Since (ISO):</label>
<input type="datetime-local" id="since-filter" placeholder="2025-06-11T13:32:00">
<button id="apply-filters">Apply</button>
</div>
</div>
<div id="log-table-container">
<p class="loading-message">Loading logs...</p>
<div id="log-table-container" data-service-uuid="{{ service_uuid }}">
{% if logs %}
<table class="log-table">
<thead>
<tr>
<th>Timestamp</th>
<th>Level</th>
<th>Message</th>
<th>Extra</th>
</tr>
</thead>
<tbody>
{% for log in logs %}
<tr>
<td>{{ log.timestamp }}</td>
<td class="log-level log-level-{{ (log.level or '').lower() }}">{{ log.level }}</td>
<td>{{ log.message }}</td>
<td>
{% if log.extra %}
<div class="json-toggle">Show JSON</div>
<pre class="json-content" style="display: none;">{{ log.extra | tojson(indent=2) }}</pre>
{% else %}
-
{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
<p class="loading-message">No logs available on server.</p>
{% endif %}
</div>
<script src="/static/logs.js"></script>
<script>
// Pass the base path for API calls if mounted under a subpath
window.API_BASE_PATH = "{{ root_path }}";
</script>
<script src="{{ url_for('static', path='/logs.js') }}"></script>
</body>
</html>