fix: исправлена HTML структура вкладок (metrics/services/thresholds)

- Перемещены закрывающие </div> tab-pane metrics в правильное место
- Сетевые графики и doughnut диски теперь внутри вкладки Метрики
- Вкладки Сервисы и Пороги работают корректно

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
This commit is contained in:
mirivlad 2026-04-13 16:25:14 +08:00
parent 03c84177c3
commit fc7a98663f
5 changed files with 9 additions and 6 deletions

0
.gitignore vendored Normal file → Executable file
View File

0
public/chartjs-plugin-crosshair.min.js vendored Normal file → Executable file
View File

0
public/chartjs-plugin-zoom.min.js vendored Normal file → Executable file
View File

View File

@ -201,7 +201,7 @@ class ServerDetailController extends Model
} }
// Типы метрик // Типы метрик
$stmt = $this->pdo->query("SELECT id, name, unit FROM metric_names WHERE name NOT LIKE '%\_proc' ORDER BY name"); $stmt = $this->pdo->query("SELECT id, name, unit FROM metric_names WHERE name NOT LIKE '%\_proc' AND name NOT LIKE 'disk_total_gb_%' AND name != 'disk_used' AND name != 'ram_total_gb' AND name NOT IN ('net_in', 'net_out') AND name NOT LIKE 'network_%' ORDER BY name");
$allMetricTypes = $stmt->fetchAll(); $allMetricTypes = $stmt->fetchAll();
// Сервисы // Сервисы
@ -286,7 +286,7 @@ class ServerDetailController extends Model
$id = $args['id']; $id = $args['id'];
$params = $request->getParsedBody(); $params = $request->getParsedBody();
$stmt = $this->pdo->query("SELECT id, name FROM metric_names WHERE name NOT LIKE '%\_proc' ORDER BY name"); $stmt = $this->pdo->query("SELECT id, name FROM metric_names WHERE name NOT LIKE '%\_proc' AND name NOT LIKE 'disk_total_gb_%' AND name != 'disk_used' AND name != 'ram_total_gb' AND name NOT IN ('net_in', 'net_out') AND name NOT LIKE 'network_%' ORDER BY name");
$metricTypes = $stmt->fetchAll(); $metricTypes = $stmt->fetchAll();
$stmt = $this->pdo->prepare("DELETE FROM metric_thresholds WHERE server_id = :server_id"); $stmt = $this->pdo->prepare("DELETE FROM metric_thresholds WHERE server_id = :server_id");

View File

@ -160,8 +160,6 @@
</div> </div>
{% endif %} {% endif %}
</div> </div>
</div>
<!-- Графики сетевых интерфейсов --> <!-- Графики сетевых интерфейсов -->
{% set net_interfaces = [] %} {% set net_interfaces = [] %}
{% for metricName in metrics|keys %} {% for metricName in metrics|keys %}
@ -173,8 +171,8 @@
{% for iface in net_interfaces %} {% for iface in net_interfaces %}
{% if metrics['net_in_' ~ iface] is defined and metrics['net_out_' ~ iface] is defined %} {% if metrics['net_in_' ~ iface] is defined and metrics['net_out_' ~ iface] is defined %}
<div class="row mb-4"> <div class="row">
<div class="col-12"> <div class="col-12 mb-4">
<div class="card"> <div class="card">
<div class="card-header"> <div class="card-header">
<h6 class="mb-0"><i class="fas fa-network-wired"></i> Сеть: {{ iface }}</h6> <h6 class="mb-0"><i class="fas fa-network-wired"></i> Сеть: {{ iface }}</h6>
@ -188,6 +186,8 @@
{% endif %} {% endif %}
{% endfor %} {% endfor %}
<!-- Диски: Doughnut графики --> <!-- Диски: Doughnut графики -->
<div class="row mb-3"> <div class="row mb-3">
{% for metricName, metricData in metrics %} {% for metricName, metricData in metrics %}
@ -221,6 +221,9 @@
{% endif %} {% endif %}
{% endfor %} {% endfor %}
</div> </div>
</div>
<!-- Вкладка "Сервисы" --> <!-- Вкладка "Сервисы" -->
<div class="tab-pane fade" id="services" role="tabpanel"> <div class="tab-pane fade" id="services" role="tabpanel">