forked from bots-garden/ori
| ✨ Workspace panel, selectors, previews, desktop app, sandbox template, resizable file tree, light/dark theme | 1 | // Command ori-desktop is a Wails v2 desktop shell around the ori web client. |
| 2 | // | |
| 3 | // It does not reimplement ori: the ori server keeps serving the React SPA and | |
| 4 | // the WebSocket/file/terminal endpoints. The desktop app only remembers the | |
| 5 | // server URL, checks GET /healthz through a Go-bound method, then shows the | |
| 6 | // ori webapp inside the native window (an <iframe> in the embedded frontend — | |
| 7 | // Wails v2 exposes no runtime call to navigate the main webview to an | |
| 8 | // external URL, see README.md). | |
| 9 | package main | |
| 10 | ||
| 11 | import ( | |
| 12 | "embed" | |
| 13 | "log" | |
| 14 | ||
| 15 | "github.com/wailsapp/wails/v2" | |
| 16 | "github.com/wailsapp/wails/v2/pkg/options" | |
| 17 | "github.com/wailsapp/wails/v2/pkg/options/assetserver" | |
| 18 | ) | |
| 19 | ||
| 20 | // assets is the plain HTML/CSS/JS frontend, embedded as-is (no bundler). | |
| 21 | // | |
| 22 | //go:embed all:frontend/src | |
| 23 | var assets embed.FS | |
| 24 | ||
| 25 | func main() { | |
| 26 | app := NewApp() | |
| 27 | ||
| 28 | err := wails.Run(&options.App{ | |
| 29 | Title: "ori", | |
| 30 | Width: 1280, | |
| 31 | Height: 860, | |
| 32 | MinWidth: 640, | |
| 33 | MinHeight: 400, | |
| 34 | AssetServer: &assetserver.Options{ | |
| 35 | Assets: assets, | |
| 36 | }, | |
| 37 | BackgroundColour: &options.RGBA{R: 24, G: 24, B: 27, A: 1}, | |
| 38 | OnStartup: app.startup, | |
| 39 | Bind: []interface{}{ | |
| 40 | app, | |
| 41 | }, | |
| 42 | }) | |
| 43 | if err != nil { | |
| 44 | log.Fatalf("ori-desktop: %v", err) | |
| 45 | } | |
| 46 | } |