<% layout('layout') %>

<h1>MQTT Monitoring Panel (SQLite)</h1>

<script>
    setTimeout(() => {
        window.location.reload();
    }, 5000);
</script>

<table>
    <thead>
        <tr>
            <th>ID</th>
            <th>Topic</th>
            <th>Wert</th>
            <th>Timestamp</th>
        </tr>
    </thead>
    <tbody>
        <% rows.forEach(row => { %>
            <tr>
                <td><%= row.id %></td>
                <td><%= row.topic %></td>
                <td><%= row.value %></td>
                <td><%= row.timestamp %></td>
            </tr>
        <% }) %>
    </tbody>
</table>
