nandi/oripublic Fork 0
main
Commits
Clone
git clone https://git.rickub.com/nandi/ori.git
git clone ssh://git@rickub.com/nandi/ori.git

Host key fingerprint (ed25519): SHA256:iycHnxEyq0Q7uyVpB7JlznP0G7JrTPXLYRcAU5CSLhc — verify it before your first connect.

forked from bots-garden/ori

main.go · 46 lines · 1.2 KBGo Blame HistoryRaw
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// Command ori-desktop is a Wails v2 desktop shell around the ori web client.
//
// It does not reimplement ori: the ori server keeps serving the React SPA and
// the WebSocket/file/terminal endpoints. The desktop app only remembers the
// server URL, checks GET /healthz through a Go-bound method, then shows the
// ori webapp inside the native window (an <iframe> in the embedded frontend —
// Wails v2 exposes no runtime call to navigate the main webview to an
// external URL, see README.md).
package main

import (
	"embed"
	"log"

	"github.com/wailsapp/wails/v2"
	"github.com/wailsapp/wails/v2/pkg/options"
	"github.com/wailsapp/wails/v2/pkg/options/assetserver"
)

// assets is the plain HTML/CSS/JS frontend, embedded as-is (no bundler).
//
//go:embed all:frontend/src
var assets embed.FS

func main() {
	app := NewApp()

	err := wails.Run(&options.App{
		Title:     "ori",
		Width:     1280,
		Height:    860,
		MinWidth:  640,
		MinHeight: 400,
		AssetServer: &assetserver.Options{
			Assets: assets,
		},
		BackgroundColour: &options.RGBA{R: 24, G: 24, B: 27, A: 1},
		OnStartup:        app.startup,
		Bind: []interface{}{
			app,
		},
	})
	if err != nil {
		log.Fatalf("ori-desktop: %v", err)
	}
}