@@ -97,9 +97,28 @@ struct AlertRowView: View {
97 VStack(alignment: .leading, spacing: 6) {
97 VStack(alignment: .leading, spacing: 6) {
99 Image(systemName: "bell.fill")
99 Image(systemName: "bell.fill")
100− .foregroundStyle(.orange)
100+ .foregroundStyle(stateColor)
101− Text(alert.name)
101+ Text(alert.displayName)
102 .fontWeight(.medium)
102 .fontWeight(.medium)
104+ if let severity = alert.severity {
107+ .padding(.horizontal, 6)
108+ .padding(.vertical, 2)
109+ .background(severityColor.opacity(0.15))
110+ .foregroundStyle(severityColor)
111+ .clipShape(RoundedRectangle(cornerRadius: 4))
113+ if let state = alert.state {
116+ .padding(.horizontal, 6)
117+ .padding(.vertical, 2)
118+ .background(stateColor.opacity(0.15))
119+ .foregroundStyle(stateColor)
120+ .clipShape(RoundedRectangle(cornerRadius: 4))
105 if let message = alert.message {
124 if let message = alert.message {
@@ -108,14 +127,40 @@ struct AlertRowView: View {
108 .foregroundStyle(.secondary)
127 .foregroundStyle(.secondary)
130+ HStack(spacing: 8) {
131+ if let alertType = alert.alertType {
132+ Label(alertType, systemImage: "gearshape")
134+ .padding(.horizontal, 6)
135+ .padding(.vertical, 2)
136+ .background(Color.blue.opacity(0.1))
137+ .clipShape(RoundedRectangle(cornerRadius: 4))
111− if let rule = alert.rule {
140+ if let rule = alert.rule, let type = rule.type {
141+ Label(type, systemImage: "gearshape")
143+ .padding(.horizontal, 6)
144+ .padding(.vertical, 2)
145+ .background(Color.blue.opacity(0.1))
146+ .clipShape(RoundedRectangle(cornerRadius: 4))
149+ if let datasets = alert.datasets, !datasets.isEmpty {
150+ Label(datasets.joined(separator: ", "), systemImage: "cylinder")
152+ .foregroundStyle(.secondary)
156+ if let tags = alert.tags, !tags.isEmpty {
113− if let type = rule.type {
158+ ForEach(tags, id: \.self) { tag in
114− Label(type, systemImage: "gearshape")
159+ Text(tag)
115 .font(.caption2)
160 .font(.caption2)
116 .padding(.horizontal, 6)
161 .padding(.horizontal, 6)
117 .padding(.vertical, 2)
162 .padding(.vertical, 2)
118− .background(Color.blue.opacity(0.1))
163+ .background(Color.purple.opacity(0.1))
119 .clipShape(RoundedRectangle(cornerRadius: 4))
164 .clipShape(RoundedRectangle(cornerRadius: 4))
@@ -141,4 +186,22 @@ struct AlertRowView: View {
142 .padding(.vertical, 4)
187 .padding(.vertical, 4)
190+ private var stateColor: Color {
191+ switch alert.state?.lowercased() {
192+ case "triggered": return .red
193+ case "disabled": return .gray
194+ default: return .orange
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