67 lines
1.7 KiB
Go
67 lines
1.7 KiB
Go
|
|
// waste desktop app — Wails shell wrapping the daemon and React UI.
|
||
|
|
// In dev mode the UI is served from the Vite dev server (http://localhost:5173).
|
||
|
|
// In production the compiled frontend is embedded from frontend/dist/.
|
||
|
|
package main
|
||
|
|
|
||
|
|
import (
|
||
|
|
"embed"
|
||
|
|
"log"
|
||
|
|
"os"
|
||
|
|
|
||
|
|
"github.com/wailsapp/wails/v2"
|
||
|
|
"github.com/wailsapp/wails/v2/pkg/logger"
|
||
|
|
"github.com/wailsapp/wails/v2/pkg/options"
|
||
|
|
"github.com/wailsapp/wails/v2/pkg/options/assetserver"
|
||
|
|
"github.com/wailsapp/wails/v2/pkg/options/linux"
|
||
|
|
"github.com/wailsapp/wails/v2/pkg/options/mac"
|
||
|
|
"github.com/wailsapp/wails/v2/pkg/options/windows"
|
||
|
|
)
|
||
|
|
|
||
|
|
//go:embed all:frontend/dist
|
||
|
|
var assets embed.FS
|
||
|
|
|
||
|
|
func main() {
|
||
|
|
app := newApp()
|
||
|
|
|
||
|
|
logLevel := logger.INFO
|
||
|
|
if os.Getenv("WASTE_DEBUG") != "" {
|
||
|
|
logLevel = logger.DEBUG
|
||
|
|
}
|
||
|
|
|
||
|
|
err := wails.Run(&options.App{
|
||
|
|
Title: "waste",
|
||
|
|
Width: 1200,
|
||
|
|
Height: 800,
|
||
|
|
MinWidth: 800,
|
||
|
|
MinHeight: 600,
|
||
|
|
DisableResize: false,
|
||
|
|
Fullscreen: false,
|
||
|
|
LogLevel: logLevel,
|
||
|
|
LogLevelProduction: logger.ERROR,
|
||
|
|
AssetServer: &assetserver.Options{
|
||
|
|
Assets: assets,
|
||
|
|
},
|
||
|
|
OnStartup: app.startup,
|
||
|
|
OnShutdown: app.shutdown,
|
||
|
|
Bind: []interface{}{app},
|
||
|
|
// Hide the window instead of quitting when the close button is clicked.
|
||
|
|
// The user can quit via the app menu or by stopping the process.
|
||
|
|
HideWindowOnClose: true,
|
||
|
|
Mac: &mac.Options{
|
||
|
|
TitleBar: mac.TitleBarHiddenInset(),
|
||
|
|
About: &mac.AboutInfo{
|
||
|
|
Title: "waste",
|
||
|
|
Message: "Decentralized friend-to-friend encrypted mesh networking.",
|
||
|
|
},
|
||
|
|
},
|
||
|
|
Windows: &windows.Options{
|
||
|
|
WebviewIsTransparent: false,
|
||
|
|
WindowIsTranslucent: false,
|
||
|
|
},
|
||
|
|
Linux: &linux.Options{},
|
||
|
|
})
|
||
|
|
if err != nil {
|
||
|
|
log.Fatal(err)
|
||
|
|
}
|
||
|
|
}
|