diff options
Diffstat (limited to 'octosentry/SecurityEventSeverity.swift')
| -rw-r--r-- | octosentry/SecurityEventSeverity.swift | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/octosentry/SecurityEventSeverity.swift b/octosentry/SecurityEventSeverity.swift new file mode 100644 index 0000000..f975639 --- /dev/null +++ b/octosentry/SecurityEventSeverity.swift @@ -0,0 +1,35 @@ +// +// SecurityEventSeverity.swift +// octosentry +// + +import SwiftUI + +enum SecurityEventSeverity: Int, Codable, Comparable, CaseIterable { + case low + case medium + case high + case critical + + static func < (lhs: SecurityEventSeverity, rhs: SecurityEventSeverity) -> Bool { + lhs.rawValue < rhs.rawValue + } + + var displayName: String { + switch self { + case .low: "Low" + case .medium: "Medium" + case .high: "High" + case .critical: "Critical" + } + } + + var color: Color { + switch self { + case .low: .blue + case .medium: .yellow + case .high: .orange + case .critical: .red + } + } +} |
