feat: dashboard top hosts/types, problems 24h, drill-down (d2-2)
- Extend /dashboards/summary; Events filters from query (hostname, severity) Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
<option>critical</option>
|
||||
</select>
|
||||
<input v-model="typeFilter" placeholder="type" @keyup.enter="load(1)" />
|
||||
<input v-model="hostnameFilter" placeholder="hostname" @keyup.enter="load(1)" />
|
||||
<button type="button" @click="load(1)">Применить</button>
|
||||
</div>
|
||||
<p v-if="error" class="error">{{ error }}</p>
|
||||
@@ -70,6 +71,7 @@ const pageSize = 50;
|
||||
const q = ref("");
|
||||
const severity = ref("");
|
||||
const typeFilter = ref("");
|
||||
const hostnameFilter = ref("");
|
||||
|
||||
function formatDt(iso: string) {
|
||||
return new Date(iso).toLocaleString("ru-RU");
|
||||
@@ -86,6 +88,7 @@ async function load(p: number) {
|
||||
});
|
||||
if (severity.value) params.set("severity", severity.value);
|
||||
if (typeFilter.value) params.set("type", typeFilter.value);
|
||||
if (hostnameFilter.value.trim()) params.set("hostname", hostnameFilter.value.trim());
|
||||
if (q.value.trim()) params.set("q", q.value.trim());
|
||||
data.value = await apiFetch<EventListResponse>(`/api/v1/events?${params}`);
|
||||
} catch (e) {
|
||||
@@ -98,6 +101,10 @@ async function load(p: number) {
|
||||
onMounted(() => {
|
||||
const t = route.query.type;
|
||||
if (typeof t === "string" && t) typeFilter.value = t;
|
||||
const sev = route.query.severity;
|
||||
if (typeof sev === "string" && sev) severity.value = sev;
|
||||
const h = route.query.hostname;
|
||||
if (typeof h === "string" && h) hostnameFilter.value = h;
|
||||
load(1);
|
||||
});
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user