Files
Server_Monitorizare_v2/templates/wmt/devices.html
2026-04-23 15:55:46 +03:00

71 lines
2.5 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{% extends "base.html" %}
{% block title %}WMT Devices {{ app_name }}{% endblock %}
{% block page_title %}WMT Devices{% endblock %}
{% block content %}
<div class="mb-3 d-flex justify-content-between align-items-center">
<p class="text-muted mb-0">{{ devices | length }} device(s) registered.</p>
<a href="{{ url_for('wmt_web.device_new') }}" class="btn btn-success">
<i class="fas fa-plus me-1"></i> New Device
</a>
</div>
<div class="card">
<div class="card-body p-0">
{% if devices %}
<div class="table-responsive">
<table class="table table-hover align-middle mb-0">
<thead class="table-light">
<tr>
<th>Work Place</th>
<th>MAC Address</th>
<th>Hostname</th>
<th>IP Address</th>
<th>Last Seen</th>
<th>Config Updated</th>
<th class="text-end">Actions</th>
</tr>
</thead>
<tbody>
{% for d in devices %}
<tr>
<td><strong>{{ d.device_name or '—' }}</strong></td>
<td><code>{{ d.mac_address }}</code></td>
<td>{{ d.hostname or '—' }}</td>
<td>{{ d.device_ip or '—' }}</td>
<td class="text-muted small">
{{ d.last_seen.strftime('%Y-%m-%d %H:%M') if d.last_seen else 'Never' }}
</td>
<td class="text-muted small">
{{ d.config_updated_at.strftime('%Y-%m-%d %H:%M') if d.config_updated_at else '—' }}
</td>
<td class="text-end">
<a href="{{ url_for('wmt_web.device_edit', device_id=d.id) }}"
class="btn btn-sm btn-outline-primary">
<i class="fas fa-edit"></i> Edit
</a>
<form method="post" action="{{ url_for('wmt_web.device_delete', device_id=d.id) }}"
class="d-inline"
onsubmit="return confirm('Delete device {{ d.mac_address }}?')">
<button type="submit" class="btn btn-sm btn-outline-danger">
<i class="fas fa-trash"></i>
</button>
</form>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% else %}
<div class="text-center text-muted py-5">
<i class="fas fa-desktop fa-3x mb-3 opacity-25"></i>
<p>No devices registered yet. <a href="{{ url_for('wmt_web.device_new') }}">Add the first one</a>.</p>
</div>
{% endif %}
</div>
</div>
{% endblock %}