Files
zerorigin-toolbox/cmd/settings/main.go
T
zerorigin2019 0a1c1e82ea chore: 初始化仓库(零源工具箱 0.1.0 基线)
- Go 主进程 cmd/zerorigin(托盘常驻 + 触发器/规则/动作引擎)
- Wails v3 设置进程 cmd/settings(独立 module)
- 监督进程 cmd/watchdog(-supervise 异常重启)
- 构建脚本 build.bat / NSIS 安装包 deploy/、便携版 portable/
- 架构与 MVP 计划文档 docs/、阶段 0-4 验收记录 deploy/acceptance-0-4.md
2026-08-05 00:42:45 +08:00

53 lines
1.4 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters
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 main
import (
"embed"
"log"
"github.com/wailsapp/wails/v3/pkg/application"
)
// Wails 使用 Go 的 embed 将前端构建产物嵌入二进制。
// frontend/dist 下的所有文件会被嵌入并供前端加载。
//
//go:embed all:frontend/dist
var assets embed.FS
// 应用图标(托盘/关于等场景;Windows 窗口图标主要由 exe 资源决定)。
//
//go:embed assets/logo.ico
var appIcon []byte
func main() {
app := application.New(application.Options{
Name: "ZerOriginTool Settings",
Icon: appIcon,
Description: "零源工具箱设置中心(按需启动,关闭即退出)",
Services: []application.Service{
application.NewService(&ConfigService{}),
},
Assets: application.AssetOptions{
Handler: application.AssetFileServerFS(assets),
},
// Windows 上默认"最后一个窗口关闭即退出"(DisableQuitOnLastWindowClosed=false),
// 满足架构文档 §8.1:设置进程按需启动、关闭即退出、不常驻。
Mac: application.MacOptions{
ApplicationShouldTerminateAfterLastWindowClosed: true,
},
})
app.Window.NewWithOptions(application.WebviewWindowOptions{
Title: "零源工具箱设置",
Width: 860,
Height: 640,
MinWidth: 640,
MinHeight: 480,
BackgroundColour: application.NewRGB(246, 247, 249),
URL: "/",
})
if err := app.Run(); err != nil {
log.Fatalf("settings app failed: %v", err)
}
}