feat: Stage 3 — alert detail, acknowledge, comments, stats charts
Press enter on any alert to open a full-screen detail pane (viewport). Keybindings in detail mode: a/A acknowledge / unacknowledge (updates immediately) c compose a comment (text input at bottom) [/] cycle comment cursor up/down d delete selected comment (y/N confirmation) s assign placeholder — shows "not yet supported by server" S open stats view: top alerts + by-hour/by-day ASCII bar charts esc back to dashboard API additions: GetAlert, AcknowledgeAlert, UnacknowledgeAlert, GetComments, AddComment, DeleteComment, GetTopAlerts, GetStatsByHour, GetStatsByDay.
This commit is contained in:
@@ -23,3 +23,28 @@ type AlertStats struct {
|
||||
Firing int `json:"firing"`
|
||||
Resolved int `json:"resolved"`
|
||||
}
|
||||
|
||||
type Comment struct {
|
||||
ID int64 `json:"id"`
|
||||
AlertID int64 `json:"alert_id"`
|
||||
UserID int64 `json:"user_id"`
|
||||
Username string `json:"username"`
|
||||
Content string `json:"content"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
}
|
||||
|
||||
type TopAlert struct {
|
||||
Name string `json:"name"`
|
||||
Count int `json:"count"`
|
||||
}
|
||||
|
||||
type HourStat struct {
|
||||
Hour int `json:"hour"`
|
||||
Count int `json:"count"`
|
||||
}
|
||||
|
||||
type DayStat struct {
|
||||
Day int `json:"day"`
|
||||
DayName string `json:"day_name"`
|
||||
Count int `json:"count"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user