feat: 添加基于webview实现的包含GUI的版本,添加通过upx进行压缩的版本,优化分享功能。

This commit is contained in:
539943419 committed 2025-03-22 15:47:35 +08:00
1 parent 7f26b46cde
commit f9b93624e4
14 files changed
+512 -45

No files matched your search

+38
View File
@@ -0,0 +1,38 @@
//go:build webview
// +build webview
package main
import (
"fmt"
"github.com/jchv/go-webview2"
)
// 启动WebView窗口
func startWebView(port string) {
// 构建本地服务URL
serverURL := fmt.Sprintf("http://localhost%s", port)
// 创建webview窗口
w := webview2.NewWithOptions(webview2.WebViewOptions{
Debug: false,
AutoFocus: true,
WindowOptions: webview2.WindowOptions{
Title: "MiaoDirectory Server",
Width: 1024,
Height: 768,
Center: true,
},
})
defer w.Destroy()
// 导航到本地服务器
w.Navigate(serverURL)
// 启动webview窗口
w.Run()
}
// 定义是否使用WebView的变量
var useWebView = true