This commit is contained in:
@@ -421,19 +421,37 @@ func (m InstallModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
|
||||
}
|
||||
|
||||
func (m InstallModel) View() string {
|
||||
s := styles.TitleStyle.Render("Installing Miasma OS")
|
||||
s += "\n\n"
|
||||
s += fmt.Sprintf("Step %d/%d: %s\n\n", m.currentStep, m.totalSteps, m.status)
|
||||
var content strings.Builder
|
||||
|
||||
content.WriteString(styles.TitleStyle.Render("⚙️ Installing Miasma OS"))
|
||||
content.WriteString("\n\n")
|
||||
|
||||
progress := fmt.Sprintf("Step %d/%d", m.currentStep, m.totalSteps)
|
||||
content.WriteString(styles.ProgressTextStyle.Render(progress))
|
||||
content.WriteString("\n")
|
||||
|
||||
bar := strings.Repeat("█", m.currentStep) + strings.Repeat("░", m.totalSteps-m.currentStep)
|
||||
content.WriteString(styles.ProgressBarStyle.Render(bar))
|
||||
content.WriteString("\n\n")
|
||||
|
||||
content.WriteString(styles.SpinnerStyle.Render("● ") + m.status)
|
||||
content.WriteString("\n\n")
|
||||
|
||||
if m.err != nil {
|
||||
s += styles.HelpStyle.Render(fmt.Sprintf("Error: %v\n", m.err))
|
||||
errMsg := fmt.Sprintf("✗ Error: %v", m.err)
|
||||
content.WriteString(styles.ErrorBoxStyle.Render(errMsg))
|
||||
content.WriteString("\n\n")
|
||||
content.WriteString(styles.HelpStyle.Render("Press Ctrl+C to exit"))
|
||||
}
|
||||
|
||||
if m.Finished && m.err == nil {
|
||||
s += "\n" + styles.HelpStyle.Render("Installation successful! You can now reboot.\nPress Ctrl+C to exit")
|
||||
success := "✓ Installation successful!\n\nYou can now reboot your system."
|
||||
content.WriteString(styles.BoxStyle.Render(success))
|
||||
content.WriteString("\n\n")
|
||||
content.WriteString(styles.RenderHelp("Ctrl+C", "Exit"))
|
||||
}
|
||||
|
||||
return styles.MainStyle.Render(s)
|
||||
return styles.AppStyle.Render(content.String())
|
||||
}
|
||||
|
||||
func readLines(path string) ([]string, error) {
|
||||
|
||||
Reference in New Issue
Block a user