@@ -97,9 +97,28 @@ struct AlertRowView: View {
9797 VStack(alignment: .leading, spacing: 6) {
9898 HStack {
9999 Image(systemName: "bell.fill")
100− .foregroundStyle(.orange)
101− Text(alert.name)
100+ .foregroundStyle(stateColor)
101+ Text(alert.displayName)
102102 .fontWeight(.medium)
103+ Spacer()
104+ if let severity = alert.severity {
105+ Text(severity)
106+ .font(.caption2)
107+ .padding(.horizontal, 6)
108+ .padding(.vertical, 2)
109+ .background(severityColor.opacity(0.15))
110+ .foregroundStyle(severityColor)
111+ .clipShape(RoundedRectangle(cornerRadius: 4))
112+ }
113+ if let state = alert.state {
114+ Text(state)
115+ .font(.caption2)
116+ .padding(.horizontal, 6)
117+ .padding(.vertical, 2)
118+ .background(stateColor.opacity(0.15))
119+ .foregroundStyle(stateColor)
120+ .clipShape(RoundedRectangle(cornerRadius: 4))
121+ }
103122 }
104123
105124 if let message = alert.message {
@@ -108,14 +127,40 @@ struct AlertRowView: View {
108127 .foregroundStyle(.secondary)
109128 }
110129
111− if let rule = alert.rule {
130+ HStack(spacing: 8) {
131+ if let alertType = alert.alertType {
132+ Label(alertType, systemImage: "gearshape")
133+ .font(.caption2)
134+ .padding(.horizontal, 6)
135+ .padding(.vertical, 2)
136+ .background(Color.blue.opacity(0.1))
137+ .clipShape(RoundedRectangle(cornerRadius: 4))
138+ }
139+
140+ if let rule = alert.rule, let type = rule.type {
141+ Label(type, systemImage: "gearshape")
142+ .font(.caption2)
143+ .padding(.horizontal, 6)
144+ .padding(.vertical, 2)
145+ .background(Color.blue.opacity(0.1))
146+ .clipShape(RoundedRectangle(cornerRadius: 4))
147+ }
148+
149+ if let datasets = alert.datasets, !datasets.isEmpty {
150+ Label(datasets.joined(separator: ", "), systemImage: "cylinder")
151+ .font(.caption2)
152+ .foregroundStyle(.secondary)
153+ }
154+ }
155+
156+ if let tags = alert.tags, !tags.isEmpty {
112157 HStack {
113− if let type = rule.type {
114− Label(type, systemImage: "gearshape")
158+ ForEach(tags, id: \.self) { tag in
159+ Text(tag)
115160 .font(.caption2)
116161 .padding(.horizontal, 6)
117162 .padding(.vertical, 2)
118− .background(Color.blue.opacity(0.1))
163+ .background(Color.purple.opacity(0.1))
119164 .clipShape(RoundedRectangle(cornerRadius: 4))
120165 }
121166 }
@@ -141,4 +186,22 @@ struct AlertRowView: View {
141186 }
142187 .padding(.vertical, 4)
143188 }
189+
190+ private var stateColor: Color {
191+ switch alert.state?.lowercased() {
192+ case "triggered": return .red
193+ case "disabled": return .gray
194+ default: return .orange
195+ }
196+ }
197+
198+ private var severityColor: Color {
199+ switch alert.severity?.lowercased() {
200+ case "critical": return .red
201+ case "high": return .orange
202+ case "medium": return .yellow
203+ case "low": return .blue
204+ default: return .secondary
205+ }
206+ }
144207}