This commit is contained in:
@@ -3,6 +3,7 @@ package steps
|
||||
import (
|
||||
"fmt"
|
||||
"miasma-installer/tui/styles"
|
||||
"strings"
|
||||
|
||||
tea "github.com/charmbracelet/bubbletea"
|
||||
)
|
||||
@@ -52,20 +53,32 @@ func (m ConfirmModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
|
||||
}
|
||||
|
||||
func (m ConfirmModel) View() string {
|
||||
s := styles.TitleStyle.Render("Confirm Installation")
|
||||
s += "\n\n"
|
||||
s += "Please review your installation settings:\n\n"
|
||||
s += fmt.Sprintf(" Disk: %s\n", m.Disk)
|
||||
s += fmt.Sprintf(" Encryption: %s\n", map[bool]string{true: "Enabled (LUKS2)", false: "Disabled"}[m.EnableLUKS])
|
||||
s += fmt.Sprintf(" Hostname: %s\n", m.Hostname)
|
||||
s += fmt.Sprintf(" Username: %s\n", m.Username)
|
||||
s += fmt.Sprintf(" Filesystem: btrfs\n")
|
||||
s += fmt.Sprintf(" Desktop: Cosmic Desktop\n")
|
||||
s += fmt.Sprintf(" Kernel: linux-hardened\n")
|
||||
s += fmt.Sprintf(" Bootloader: systemd-boot (UEFI)\n")
|
||||
s += "\n"
|
||||
s += styles.HelpStyle.Render("WARNING: This will ERASE ALL DATA on ") + m.Disk + "\n\n"
|
||||
s += styles.HelpStyle.Render("[y] Proceed with installation [n] Cancel")
|
||||
var content strings.Builder
|
||||
|
||||
return styles.MainStyle.Render(s)
|
||||
content.WriteString(styles.TitleStyle.Render("✓ Confirm Installation"))
|
||||
content.WriteString("\n\n")
|
||||
|
||||
content.WriteString("Review your installation settings:\n\n")
|
||||
|
||||
settings := []string{
|
||||
styles.RenderKeyValue("Disk", m.Disk),
|
||||
styles.RenderKeyValue("Encryption", map[bool]string{true: "Enabled (LUKS2)", false: "Disabled"}[m.EnableLUKS]),
|
||||
styles.RenderKeyValue("Hostname", m.Hostname),
|
||||
styles.RenderKeyValue("Username", m.Username),
|
||||
styles.RenderKeyValue("Filesystem", "btrfs"),
|
||||
styles.RenderKeyValue("Desktop", "Cosmic Desktop"),
|
||||
styles.RenderKeyValue("Kernel", "linux-hardened"),
|
||||
styles.RenderKeyValue("Bootloader", "systemd-boot (UEFI)"),
|
||||
}
|
||||
|
||||
content.WriteString(styles.BoxStyle.Render(strings.Join(settings, "\n")))
|
||||
content.WriteString("\n\n")
|
||||
|
||||
warning := fmt.Sprintf("⚠️ WARNING: This will ERASE ALL DATA on %s", m.Disk)
|
||||
content.WriteString(styles.WarningBoxStyle.Render(warning))
|
||||
content.WriteString("\n\n")
|
||||
|
||||
content.WriteString(styles.RenderHelp("y", "Proceed with installation", "n", "Cancel"))
|
||||
|
||||
return styles.AppStyle.Render(content.String())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user