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
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.
66 lines
2.1 KiB
Swift
66 lines
2.1 KiB
Swift
import SwiftUI
|
|
|
|
struct OnboardingView: View {
|
|
@EnvironmentObject var authVM: AuthViewModel
|
|
@State private var name = ""
|
|
@State private var pin = ""
|
|
@State private var confirmPin = ""
|
|
@State private var step = 0
|
|
|
|
var body: some View {
|
|
VStack(spacing: 24) {
|
|
Spacer()
|
|
|
|
Image(systemName: "battery.100.bolt")
|
|
.font(.system(size: 60))
|
|
.foregroundColor(.green)
|
|
|
|
Text("Configuration initiale")
|
|
.font(.title2.bold())
|
|
|
|
if step == 0 {
|
|
TextField("Votre nom", text: $name)
|
|
.textFieldStyle(.roundedBorder)
|
|
.padding(.horizontal, 40)
|
|
|
|
Button("Suivant") { step = 1 }
|
|
.disabled(name.isEmpty)
|
|
.buttonStyle(.borderedProminent)
|
|
} else if step == 1 {
|
|
Text("Choisissez un PIN (6 chiffres)")
|
|
.foregroundColor(.secondary)
|
|
SecureField("PIN", text: $pin)
|
|
.textFieldStyle(.roundedBorder)
|
|
.keyboardType(.numberPad)
|
|
.padding(.horizontal, 40)
|
|
|
|
Button("Suivant") { step = 2 }
|
|
.disabled(pin.count != 6)
|
|
.buttonStyle(.borderedProminent)
|
|
} else {
|
|
Text("Confirmez le PIN")
|
|
.foregroundColor(.secondary)
|
|
SecureField("PIN", text: $confirmPin)
|
|
.textFieldStyle(.roundedBorder)
|
|
.keyboardType(.numberPad)
|
|
.padding(.horizontal, 40)
|
|
|
|
if confirmPin.count == 6 && confirmPin != pin {
|
|
Text("Les PINs ne correspondent pas")
|
|
.foregroundColor(.red)
|
|
.font(.caption)
|
|
}
|
|
|
|
Button("Créer le compte Admin") {
|
|
authVM.createAdmin(name: name, pin: pin)
|
|
authVM.login(pin: pin)
|
|
}
|
|
.disabled(confirmPin != pin || pin.count != 6)
|
|
.buttonStyle(.borderedProminent)
|
|
}
|
|
|
|
Spacer()
|
|
}
|
|
}
|
|
}
|