Files
Go-VPN-Client/internal/gui/gui.go
arkonsadter e0a5f0f746 feat(gui): add GUI (Test) implementation with documentation and admin support
- Add GUI (Test) module with Fyne-based interface (internal/gui/gui.go, internal/gui/server.go)
- Add CLI monitoring capability (internal/cli/monitor.go)
- Add main_cli.go entry point for CLI-only builds
- Add comprehensive documentation suite covering setup, build, quick start, and changelog
- Add admin manifest (admin.manifest) for Windows UAC elevation support
- Add rsrc.syso.json configuration for resource embedding
- Update .gitignore to exclude build scripts (*.bat, *.sh)
- Update main.go and cli.go to support dual GUI (Test)/CLI modes
- Update README.md with new project information
- Enables users to build and run both GUI (Test)and CLI versions with proper admin privileges on Windows
2026-04-06 18:57:58 +06:00

40 lines
949 B
Go
Raw Permalink Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
package gui
import (
"fmt"
"os/exec"
"runtime"
"time"
)
func Run() error {
url := startServer()
time.Sleep(500 * time.Millisecond)
fmt.Println("🚀 VPN Client GUI запущен!")
fmt.Printf("📱 Откройте в браузере: %s\n", url)
fmt.Println("💡 Браузер откроется автоматически...")
fmt.Println("\n⚠ Не закрывайте это окно!")
fmt.Println(" Для выхода нажмите Ctrl+C\n")
openBrowser(url)
select {}
}
func openBrowser(url string) {
var err error
switch runtime.GOOS {
case "linux":
err = exec.Command("xdg-open", url).Start()
case "windows":
err = exec.Command("rundll32", "url.dll,FileProtocolHandler", url).Start()
case "darwin":
err = exec.Command("open", url).Start()
default:
err = fmt.Errorf("unsupported platform")
}
if err != nil {
fmt.Printf("Не удалось открыть браузер: %v\n", err)
}
}