init
This commit is contained in:
36
internal/pages/home.go
Normal file
36
internal/pages/home.go
Normal file
@@ -0,0 +1,36 @@
|
||||
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
|
||||
}
|
||||
Reference in New Issue
Block a user