Initial commit — Server_Monitorizare_v2
This commit is contained in:
70
templates/wmt/devices.html
Normal file
70
templates/wmt/devices.html
Normal file
@@ -0,0 +1,70 @@
|
||||
{% 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 %}
|
||||
Reference in New Issue
Block a user