From 26f3dcec8d01402010505998701afc342af8336f Mon Sep 17 00:00:00 2001 From: Daan Selen Date: Thu, 8 Jan 2026 22:03:44 +0100 Subject: [PATCH] chore: qol update --- src/action.go | 1 + src/draw.go | 10 ++++++---- src/main.go | 4 ++-- src/rpi-list.go | 3 ++- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/action.go b/src/action.go index b4e0073..02117ac 100644 --- a/src/action.go +++ b/src/action.go @@ -41,5 +41,6 @@ func verifyCred(username, password, targetName string) bool { } defer client.Close() + log.Println("Success!") return true } diff --git a/src/draw.go b/src/draw.go index d63c135..885e7ee 100644 --- a/src/draw.go +++ b/src/draw.go @@ -100,6 +100,7 @@ func drawButtonRow(targetMode *int) *fyne.Container { func drawTargetSection(raspiNames []string, raspiTarget *string) *fyne.Container { actionText := widget.NewLabel("Select Target") + var verifyBtn *widget.Button // Left side for selection of target piSelection := widget.NewRadioGroup(raspiNames, func(selected string) { if len(selected) != 0 { @@ -108,6 +109,8 @@ func drawTargetSection(raspiNames []string, raspiTarget *string) *fyne.Container } else { log.Println("Deselected Target") } + verifyBtn.Importance = widget.LowImportance + refreshButtons(verifyBtn) }) // Right side authentication @@ -117,7 +120,7 @@ func drawTargetSection(raspiNames []string, raspiTarget *string) *fyne.Container userEntry := widget.NewEntry() userEntry.SetPlaceHolder("") - passEntry := widget.NewEntry() + passEntry := widget.NewPasswordEntry() passEntry.SetPlaceHolder("") expander := canvas.NewRectangle(color.Transparent) @@ -130,7 +133,7 @@ func drawTargetSection(raspiNames []string, raspiTarget *string) *fyne.Container ) divider := canvas.NewRectangle(color.Transparent) - divider.SetMinSize(fyne.NewSize(300, 0)) + divider.SetMinSize(fyne.NewSize(250, 0)) selecCol := container.NewVBox( actionText, @@ -143,11 +146,10 @@ func drawTargetSection(raspiNames []string, raspiTarget *string) *fyne.Container targetAuth, ) - var verifyBtn *widget.Button var credOK bool verifyBtn = widget.NewButton("Verify Credentials", func() { verifyBtn.Importance = widget.HighImportance - refreshButtons(verifyBtn) + refreshButtons(verifyBtn) log.Println("Verifying credentials...") go func() { diff --git a/src/main.go b/src/main.go index 876eda8..597888b 100644 --- a/src/main.go +++ b/src/main.go @@ -22,9 +22,9 @@ const ( ) var ( - windowSize fyne.Size = fyne.NewSize(750, 700) // Default Window size + windowSize fyne.Size = fyne.NewSize(750, 800) // Default Window size //dialogSize fyne.Size = fyne.NewSize(750, 700) // For some reason when we use windowSize for that, its still smaller, this is also smaller. But a better fit - buttonSize fyne.Size = fyne.NewSize(200, 50) // Default button size + buttonSize fyne.Size = fyne.NewSize(200, 50) // Default button size entrySize fyne.Size = fyne.NewSize(200, 40) ) diff --git a/src/rpi-list.go b/src/rpi-list.go index 263d392..bc760ce 100644 --- a/src/rpi-list.go +++ b/src/rpi-list.go @@ -5,9 +5,10 @@ var ( // 0 Raspberry Pi Name // 1 Raspberry Pi IP-Adress // 2 Raspberry Pi SSH-port - raspiList [3][3]string = [3][3]string{ + raspiList [][]string = [][]string{ {"Kantine Pi", "172.16.64.228", "22"}, {"Productie Pi", "172.16.64.229", "22"}, {"Sales Pi", "", ""}, + {"MyTempHost", "192.168.178.20", "22"}, } )