Files
L'électron rare f55093d6fe
ESP-IDF CI / Host Tests (Unity) (push) Successful in 1m8s
CI / firmware-native (push) Successful in 2m57s
Rust Protection Tests / Cargo test (host) (push) Failing after 3m21s
ESP-IDF CI / ESP-IDF Build (v5.4) (push) Failing after 6m55s
ESP-IDF CI / Memory Budget Gate (push) Has been skipped
qa-cicd-environments / qa-kxkm-s3-build (push) Successful in 8m53s
qa-cicd-environments / qa-sim-host (push) Successful in 2m2s
qa-cicd-environments / qa-kxkm-s3-memory-budget (push) Successful in 11m17s
chore: import KXKM Batterie Parallelator
Context: the project archive (KXKM_Batterie_Parallelator-main) had
no git history locally; a fresh repository is needed to host it on
git.saillant.cc (electron/KXKM_Batterie_Parallelator).

Approach: initialize a new repo on branch main, stage the archive
content, and harden .gitignore before the first commit.

Changes:
- Import the full project tree: firmware/, firmware-idf/,
  firmware-rs/, iosApp/, kxkm-bmu-app/, kxkm-api/, hardware/,
  docs/, specs/, scripts/, models/, tests/
- Keep project dotfiles tracked despite the trailing '.*' ignore
  rule: .github/, .claude/, .superpowers/, .gitattributes,
  .markdownlint.json
- Extend .gitignore: firmware/src/credentials.h (local secrets,
  template kept), kxkm-bmu-app/**/build/ (66 MB compiled iOS
  framework), .remember/ (session data)

Impact: the project can now be maintained on the self-hosted Gitea
forge with a clean, secret-free initial history.
2026-07-04 12:32:28 +02:00

73 lines
2.2 KiB
Swift

import SwiftUI
struct AuditRowView: View {
let event: AuditEvent
var body: some View {
HStack(alignment: .top, spacing: 10) {
Image(systemName: actionIcon)
.foregroundColor(actionColor)
.frame(width: 24)
VStack(alignment: .leading, spacing: 2) {
Text(event.action.replacingOccurrences(of: "_", with: " ").capitalized)
.font(.subheadline.bold())
if let target = event.target?.intValue {
Text("Batterie \(target + 1)")
.font(.caption)
.foregroundColor(.secondary)
}
if let detail = event.detail {
Text(detail)
.font(.caption)
.foregroundColor(.secondary)
}
}
Spacer()
VStack(alignment: .trailing, spacing: 2) {
Text(event.userId)
.font(.caption2)
.foregroundColor(.secondary)
Text(formatTimestamp(event.timestamp))
.font(.caption2)
.foregroundColor(.secondary)
}
}
}
private var actionIcon: String {
switch event.action {
case "switch_on": return "bolt.fill"
case "switch_off": return "bolt.slash"
case "reset": return "arrow.counterclockwise"
case "config_change": return "wrench"
case "wifi_config": return "wifi"
default: return "doc"
}
}
private var actionColor: Color {
switch event.action {
case "switch_on": return .green
case "switch_off": return .red
case "config_change", "wifi_config": return .blue
default: return .secondary
}
}
private static let timestampFormatter: DateFormatter = {
let fmt = DateFormatter()
fmt.dateFormat = "dd/MM HH:mm:ss"
return fmt
}()
private func formatTimestamp(_ ms: Int64) -> String {
let date = Date(timeIntervalSince1970: Double(ms) / 1000.0)
return Self.timestampFormatter.string(from: date)
}
}