crowdsec_manager icon indicating copy to clipboard operation
crowdsec_manager copied to clipboard

GUI inconsistencies

Open p4xel opened this issue 8 months ago • 5 comments

Hi Team,

Great project, I really missed a good Crowdsec interface for checking alerts and decisions,

I noticed that Alerts counter in the top tile maxes at 200, even though there are way more. Activity History (7d) only really shows 1 day (where is the source of the data? maybe my config is wrong) Alerts Over Time (Alert frequency by date) shows dates backwards (Apr 4 -> Apr 3) with downward slope.

Are those intentional decisions or is it something with my configuration? Can the container keep statistics in it's own DB?

p4xel avatar Apr 03 '26 14:04 p4xel

@p4xel hi there, We are launching a mobile app for this container so we have put a cap on what to display to save resources, you can adjust the limit as you feel comfortable with your system. this container objective is decision making at first.

Same goes for Decision - DECISION_LIST_LIMIT= set what you are comfortable with

Image Image

Alerts Over Time (Alert frequency by date) shows dates backwards (Apr 4 -> Apr 3) with downward slope. this was my foolishness.. will reverse it.

hhftechnology avatar Apr 03 '26 22:04 hhftechnology

Thank you. Looking forward to seeing the app.

p4xel avatar Apr 04 '26 04:04 p4xel

I have changed the limit and it works, but takes few seconds to populate at 2400 alerts. Decisions still show bars only for last few hours. Can I propose a change in the implementation - when i go to Activity -> Alerts or Decisions the stats load instantly, no delay. Are they loaded from /data/history.db? Where does the dashboard activity history and tiles get the metric from? Are they loaded from Crowdsec metrics or history.db?

p4xel avatar Apr 21 '26 10:04 p4xel

Decisions still show bars only for last few hours. this is a ui fix. will solve it in next push. for alert this will be the fix

 // ---- Chart data ----
const buckets = new Map<string, number>()
for (const a of alertsData.alerts as CrowdSecAlert[]) {
const parsed = new Date(a.start_at)
if (Number.isNaN(parsed.getTime())) continue
const bucketKey = parsed.toISOString().slice(0, 10) // YYYY-MM-DD
buckets.set(bucketKey, (buckets.get(bucketKey) ?? 0) + 1)
}
return Array.from(buckets.entries())
.sort(([a], [b]) => a.localeCompare(b))
.map(([bucketKey, count]) => ({
date: new Date(`${bucketKey}T00:00:00Z`).toLocaleDateString('en-US', { month: 'short', day: 'numeric' }),
value: count,
}))

hhftechnology avatar Apr 23 '26 06:04 hhftechnology

solved. in the latest tag

hhftechnology avatar Apr 25 '26 13:04 hhftechnology