nf-disk/main.go
zhaoyupeng 777253063b feat: 完成了 新建桶; 上传文件(基本功能)
todo: 上传 rename, 上传 public 权限选择
bug: 首次加载 conns list; 上传的时候前缀过滤失败
2024-10-12 17:46:20 +08:00

50 lines
1.0 KiB
Go

package main
import (
"context"
"embed"
"flag"
"github.com/loveuer/nf-disk/internal/controller"
"github.com/loveuer/nf-disk/internal/opt"
"os/signal"
"syscall"
"github.com/loveuer/nf/nft/log"
"github.com/wailsapp/wails/v2"
"github.com/wailsapp/wails/v2/pkg/options"
"github.com/wailsapp/wails/v2/pkg/options/assetserver"
)
//go:embed all:frontend/dist
var assets embed.FS
func main() {
ctx, cancel := signal.NotifyContext(context.Background(), syscall.SIGHUP, syscall.SIGINT, syscall.SIGTERM, syscall.SIGQUIT)
defer cancel()
flag.BoolVar(&opt.Debug, "debug", true, "debug mode")
flag.Parse()
if opt.Debug {
log.SetLogLevel(log.LogLevelDebug)
}
app := controller.NewApp(ctx)
if err := wails.Run(&options.App{
Title: "nf-disk",
Width: 1024,
Height: 768,
AssetServer: &assetserver.Options{
Assets: assets,
},
BackgroundColour: &options.RGBA{R: 223, G: 223, B: 223, A: 1},
OnStartup: app.Startup,
Bind: []interface{}{
app,
},
}); err != nil {
log.Fatal("wails run err: %s", err.Error())
}
}