This commit is contained in:
@@ -157,13 +157,27 @@ func (m DiskSelModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
|
||||
}
|
||||
|
||||
func (m DiskSelModel) View() string {
|
||||
var content strings.Builder
|
||||
|
||||
if m.loading {
|
||||
return styles.MainStyle.Render(styles.TitleStyle.Render("Scanning disks..."))
|
||||
content.WriteString(styles.TitleStyle.Render("💿 Scanning Disks..."))
|
||||
content.WriteString("\n\n")
|
||||
content.WriteString(styles.SpinnerStyle.Render("● Detecting available storage devices..."))
|
||||
return styles.AppStyle.Render(content.String())
|
||||
}
|
||||
|
||||
s := m.list.View()
|
||||
s += "\n" + styles.HelpStyle.Render("Use ↑/↓ to navigate, [Enter] to select disk.")
|
||||
return s
|
||||
content.WriteString(styles.TitleStyle.Render("💿 Select Installation Disk"))
|
||||
content.WriteString("\n\n")
|
||||
|
||||
warning := "⚠️ All data on the selected disk will be erased!"
|
||||
content.WriteString(styles.WarningBoxStyle.Render(warning))
|
||||
content.WriteString("\n\n")
|
||||
|
||||
content.WriteString(m.list.View())
|
||||
content.WriteString("\n\n")
|
||||
content.WriteString(styles.RenderHelp("↑/↓", "Navigate", "Enter", "Select"))
|
||||
|
||||
return styles.AppStyle.Render(content.String())
|
||||
}
|
||||
|
||||
func formatBytes(bytes uint64) string {
|
||||
|
||||
Reference in New Issue
Block a user