funkcje
This commit is contained in:
@ -2,18 +2,36 @@
|
||||
{% block title %}Szczegóły urządzenia - RouterOS Update{% endblock %}
|
||||
{% block content %}
|
||||
<div class="container">
|
||||
<h2 class="mb-4">Szczegóły urządzenia</h2>
|
||||
<div class="row">
|
||||
<div class="my-4">
|
||||
<h2 class="mb-3">Szczegóły urządzenia</h2>
|
||||
<nav aria-label="breadcrumb">
|
||||
<ol class="breadcrumb">
|
||||
<li class="breadcrumb-item"><a href="{{ url_for('devices') }}">Urządzenia</a></li>
|
||||
<li class="breadcrumb-item active" aria-current="page">{{ device.ip }}</li>
|
||||
</ol>
|
||||
</nav>
|
||||
</div>
|
||||
|
||||
<!-- Zakładki dla danych urządzenia i informacji o systemie -->
|
||||
<ul class="nav nav-tabs mb-3" id="deviceTab" role="tablist">
|
||||
<li class="nav-item" role="presentation">
|
||||
<button class="nav-link active" id="device-data-tab" data-bs-toggle="tab" data-bs-target="#device-data" type="button" role="tab" aria-controls="device-data" aria-selected="true">Dane urządzenia</button>
|
||||
</li>
|
||||
<li class="nav-item" role="presentation">
|
||||
<button class="nav-link" id="system-info-tab" data-bs-toggle="tab" data-bs-target="#system-info" type="button" role="tab" aria-controls="system-info" aria-selected="false">Informacje o systemie</button>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="tab-content" id="deviceTabContent">
|
||||
<!-- Dane urządzenia -->
|
||||
<div class="col-md-6 mb-3">
|
||||
<div class="card h-100">
|
||||
<div class="tab-pane fade show active" id="device-data" role="tabpanel" aria-labelledby="device-data-tab">
|
||||
<div class="card mb-3">
|
||||
<div class="card-header bg-primary text-white">
|
||||
Dane urządzenia
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<p><strong>Adres IP:</strong> {{ device.ip }}</p>
|
||||
<p><strong>Port:</strong> {{ device.port }}</p>
|
||||
<p><strong>Ostatnie sprawdzenie:</strong>
|
||||
<p><strong>Ostatnie sprawdzenie:</strong>
|
||||
{% if device.last_check %}{{ device.last_check.strftime('%Y-%m-%d %H:%M:%S') }}{% else %}Brak{% endif %}
|
||||
</p>
|
||||
<p>
|
||||
@ -24,22 +42,22 @@
|
||||
<strong>Branch aktualizacji:</strong> {{ device.branch|capitalize }}
|
||||
</p>
|
||||
<!-- Formularz zmiany branch -->
|
||||
<form method="POST" action="{{ url_for('edit_device', device_id=device.id) }}">
|
||||
<form method="POST" action="{{ url_for('edit_device', device_id=device.id) }}" class="mt-3">
|
||||
<div class="input-group">
|
||||
<select class="form-select" name="branch">
|
||||
<option value="stable" {% if device.branch == 'stable' %}selected{% endif %}>Stable</option>
|
||||
<option value="dev" {% if device.branch == 'dev' %}selected{% endif %}>Dev</option>
|
||||
<option value="beta" {% if device.branch == 'beta' %}selected{% endif %}>Beta</option>
|
||||
</select>
|
||||
<button type="submit" class="btn btn-primary ms-2">Zmień</button>
|
||||
<button type="submit" class="btn btn-primary ms-2">Zmień branch</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Informacje o systemie -->
|
||||
<div class="col-md-6 mb-3">
|
||||
<div class="card h-100">
|
||||
<div class="tab-pane fade" id="system-info" role="tabpanel" aria-labelledby="system-info-tab">
|
||||
<div class="card mb-3">
|
||||
<div class="card-header bg-info text-white">
|
||||
Informacje o systemie
|
||||
</div>
|
||||
@ -53,7 +71,7 @@
|
||||
<p><strong>Czas pracy:</strong> {{ resource.uptime or 'Brak danych' }}</p>
|
||||
<p><strong>Obciążenie CPU:</strong> {{ resource['cpu-load'] or 'Brak' }}%</p>
|
||||
<p>
|
||||
<strong>Pamięć:</strong>
|
||||
<strong>Pamięć:</strong>
|
||||
{% if resource['free-memory'] and resource['total-memory'] %}
|
||||
{{ resource['free-memory'] }} wolnej / {{ resource['total-memory'] }} całkowita
|
||||
{% else %}
|
||||
@ -67,28 +85,36 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Logi urządzenia -->
|
||||
<div class="card mb-3">
|
||||
<div class="card-header bg-secondary text-white">
|
||||
Logi urządzenia
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<pre class="bg-light p-3" style="white-space: pre-wrap;">{{ device.last_log or 'Brak logów' }}</pre>
|
||||
<!-- Logi urządzenia w formie accordion -->
|
||||
<div class="accordion mb-3" id="logsAccordion">
|
||||
<div class="accordion-item">
|
||||
<h2 class="accordion-header" id="headingLogs">
|
||||
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#collapseLogs" aria-expanded="false" aria-controls="collapseLogs">
|
||||
Logi urządzenia
|
||||
</button>
|
||||
</h2>
|
||||
<div id="collapseLogs" class="accordion-collapse collapse" aria-labelledby="headingLogs" data-bs-parent="#logsAccordion">
|
||||
<div class="accordion-body">
|
||||
<pre class="bg-light p-3" style="white-space: pre-wrap;">{{ device.last_log or 'Brak logów' }}</pre>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Akcje -->
|
||||
<!-- Akcje urządzenia -->
|
||||
<div class="mb-4">
|
||||
<div class="btn-group" role="group">
|
||||
<form method="POST" action="{{ url_for('update_device', device_id=device.id) }}" style="display: inline-block;">
|
||||
<button type="submit" class="btn btn-warning me-2">Aktualizuj system</button>
|
||||
<div class="d-flex flex-wrap gap-2">
|
||||
<form method="POST" action="{{ url_for('update_device', device_id=device.id) }}">
|
||||
<button type="submit" class="btn btn-warning">Aktualizuj system</button>
|
||||
</form>
|
||||
<form method="POST" action="{{ url_for('update_firmware', device_id=device.id) }}" style="display: inline-block;">
|
||||
<button type="submit" class="btn btn-danger me-2">Aktualizuj firmware</button>
|
||||
<form method="POST" action="{{ url_for('update_firmware', device_id=device.id) }}">
|
||||
<button type="submit" class="btn btn-danger">Aktualizuj firmware</button>
|
||||
</form>
|
||||
<a href="{{ url_for('force_check', device_id=device.id) }}" class="btn btn-secondary me-2">Wymuś sprawdzenie</a>
|
||||
<a href="{{ url_for('force_check', device_id=device.id) }}" class="btn btn-secondary">Wymuś sprawdzenie</a>
|
||||
</div>
|
||||
<div class="mt-3">
|
||||
<a href="{{ url_for('devices') }}" class="btn btn-outline-secondary">Powrót do listy urządzeń</a>
|
||||
</div>
|
||||
<a href="{{ url_for('devices') }}" class="btn btn-outline-secondary ms-3">Powrót do listy urządzeń</a>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
Reference in New Issue
Block a user