mirror of
https://github.com/gravitl/netmaker.git
synced 2025-10-17 22:31:23 +08:00
added build tag for gui
This commit is contained in:
@@ -1,7 +1,11 @@
|
||||
//go:build gui
|
||||
// +build gui
|
||||
|
||||
package gui
|
||||
|
||||
import (
|
||||
"embed"
|
||||
"fmt"
|
||||
"image/color"
|
||||
|
||||
"fyne.io/fyne/v2"
|
||||
@@ -10,6 +14,7 @@ import (
|
||||
"fyne.io/fyne/v2/theme"
|
||||
"fyne.io/fyne/v2/widget"
|
||||
"github.com/gravitl/netmaker/logger"
|
||||
"github.com/gravitl/netmaker/netclient/config"
|
||||
"github.com/gravitl/netmaker/netclient/functions"
|
||||
"github.com/gravitl/netmaker/netclient/gui/components"
|
||||
"github.com/gravitl/netmaker/netclient/gui/components/views"
|
||||
@@ -19,6 +24,20 @@ import (
|
||||
//go:embed nm-logo-sm.png
|
||||
var logoContent embed.FS
|
||||
|
||||
func init() {
|
||||
fmt.Println("got in here")
|
||||
config.GuiActive = true
|
||||
|
||||
config.GuiRun = func() {
|
||||
networks, err := ncutils.GetSystemNetworks()
|
||||
if err != nil {
|
||||
networks = []string{}
|
||||
}
|
||||
Run(networks)
|
||||
}
|
||||
}
|
||||
|
||||
// Run - run's the netclient GUI
|
||||
func Run(networks []string) error {
|
||||
a := app.New()
|
||||
window := a.NewWindow("Netclient")
|
||||
@@ -69,9 +88,6 @@ func Run(networks []string) error {
|
||||
})
|
||||
views.RefreshComponent(views.Confirm, confirmView)
|
||||
views.ShowView(views.Confirm)
|
||||
// TODO:
|
||||
// - call uninstall
|
||||
// - Refresh networks view when finished
|
||||
}, components.Red_color),
|
||||
))
|
||||
|
||||
|
Reference in New Issue
Block a user