Add logbook entries, data export page, and JSON import
This commit is contained in:
@@ -221,6 +221,37 @@ function addInstallRow() {
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<h2>Logbook</h2>
|
||||
{% if logbook_entries %}
|
||||
<div style="display:flex;flex-direction:column;gap:0.6rem;margin-bottom:1rem;">
|
||||
{% for entry in logbook_entries %}
|
||||
<div style="border-left:3px solid var(--border);padding:0.35rem 0.75rem;
|
||||
display:flex;justify-content:space-between;align-items:flex-start;gap:0.5rem;">
|
||||
<div>
|
||||
<div class="text-muted" style="font-size:0.78rem;margin-bottom:0.15rem;">{{ entry.recorded_at }}</div>
|
||||
<div style="white-space:pre-wrap;">{{ entry.body }}</div>
|
||||
</div>
|
||||
<form method="post"
|
||||
action="{{ url_for('device_logbook_delete', device_id=device.id, entry_id=entry.id) }}"
|
||||
data-confirm="Delete this logbook entry?" data-confirm-ok="Delete">
|
||||
<button class="btn btn-sm btn-danger" type="submit">Delete</button>
|
||||
</form>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% else %}
|
||||
<p class="text-muted" style="margin-bottom:0.75rem;">No logbook entries yet.</p>
|
||||
{% endif %}
|
||||
<h3 style="font-size:1rem;margin:0.75rem 0 0.5rem;color:var(--text-h2);">Add Entry</h3>
|
||||
<form method="post" action="{{ url_for('device_logbook_add', device_id=device.id) }}">
|
||||
<div class="form-group" style="margin-bottom:0.5rem;">
|
||||
<textarea name="body" placeholder="Write a note…" rows="2" required style="min-height:60px;"></textarea>
|
||||
</div>
|
||||
<button class="btn btn-primary" type="submit">Add Entry</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<h2>Edit Device</h2>
|
||||
<form method="post" action="{{ url_for('device_edit', device_id=device.id) }}">
|
||||
|
||||
Reference in New Issue
Block a user