37 lines
717 B
Go
37 lines
717 B
Go
package pages
|
|
|
|
type HomePageMsg struct{}
|
|
|
|
type SettingsPageMsg struct{}
|
|
|
|
type SelectServerPageMsg struct{}
|
|
|
|
type VPNStatusMsg struct {
|
|
Connected bool
|
|
Err error
|
|
}
|
|
|
|
type VPNToggleMsg struct {
|
|
Connected bool
|
|
Err error
|
|
}
|
|
|
|
type MenuItem struct {
|
|
Label string
|
|
Key string
|
|
}
|
|
|
|
func HomeMenuItems(connected, hasServers bool) []MenuItem {
|
|
var items []MenuItem
|
|
if hasServers {
|
|
if connected {
|
|
items = append(items, MenuItem{Label: "Turn Off", Key: "off"})
|
|
} else {
|
|
items = append(items, MenuItem{Label: "Turn On", Key: "on"})
|
|
}
|
|
items = append(items, MenuItem{Label: "Select Server", Key: "select-server"})
|
|
}
|
|
items = append(items, MenuItem{Label: "Settings", Key: "settings"})
|
|
return items
|
|
}
|