fix: alert panel always visible, version display normalization
- Remove x-show condition hiding alert panel when no alerts exist - Add empty state message explaining alerts appear on rule triggers - Normalize appVersion in loadVersion() to strip leading 'v' (prevents vv1.7.0 in footer)
This commit is contained in:
@@ -70,7 +70,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section class="panel" x-show="alertSummary.total_open > 0 || alerts.length > 0">
|
<section class="panel">
|
||||||
<div class="panel-header">
|
<div class="panel-header">
|
||||||
<h3>Alerts</h3>
|
<h3>Alerts</h3>
|
||||||
<span x-text="`${alertSummary.total_open} open`" class="alert-open-count"></span>
|
<span x-text="`${alertSummary.total_open} open`" class="alert-open-count"></span>
|
||||||
@@ -90,7 +90,7 @@
|
|||||||
<option value="low">Low</option>
|
<option value="low">Low</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div class="alerts-list">
|
<div class="alerts-list" x-show="alerts.length > 0">
|
||||||
<template x-for="alert in alerts" :key="alert._id || alert.event_id">
|
<template x-for="alert in alerts" :key="alert._id || alert.event_id">
|
||||||
<div class="alert-card" :class="'alert-card--' + alert.severity">
|
<div class="alert-card" :class="'alert-card--' + alert.severity">
|
||||||
<div class="alert-card__meta">
|
<div class="alert-card__meta">
|
||||||
@@ -109,6 +109,9 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="alerts-empty" x-show="alerts.length === 0">
|
||||||
|
<p>No alerts match the current filters. Alerts appear here when rules trigger during event ingestion.</p>
|
||||||
|
</div>
|
||||||
<div class="pagination" x-show="alertsTotal > 20">
|
<div class="pagination" x-show="alertsTotal > 20">
|
||||||
<button type="button" :disabled="alertsPage === 1" @click="alertsPage--; loadAlerts()">Prev</button>
|
<button type="button" :disabled="alertsPage === 1" @click="alertsPage--; loadAlerts()">Prev</button>
|
||||||
<span x-text="`Page ${alertsPage}`"></span>
|
<span x-text="`Page ${alertsPage}`"></span>
|
||||||
@@ -415,7 +418,7 @@
|
|||||||
const res = await fetch('/api/version');
|
const res = await fetch('/api/version');
|
||||||
if (res.ok) {
|
if (res.ok) {
|
||||||
const body = await res.json();
|
const body = await res.json();
|
||||||
this.appVersion = body.version || '';
|
this.appVersion = (body.version || '').replace(/^v/, '');
|
||||||
}
|
}
|
||||||
} catch {}
|
} catch {}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -809,6 +809,15 @@ input {
|
|||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.alerts-empty {
|
||||||
|
padding: 20px;
|
||||||
|
text-align: center;
|
||||||
|
color: var(--muted);
|
||||||
|
font-size: 14px;
|
||||||
|
border: 1px dashed var(--border);
|
||||||
|
border-radius: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
@media (max-width: 640px) {
|
@media (max-width: 640px) {
|
||||||
.topbar {
|
.topbar {
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
|||||||
Reference in New Issue
Block a user