Skip to content
This repository has been archived by the owner on Aug 31, 2023. It is now read-only.

Commit

Permalink
feat(gui): import vue and re-initial
Browse files Browse the repository at this point in the history
  • Loading branch information
yeqown committed Nov 24, 2021
1 parent e92b411 commit 2253fb8
Show file tree
Hide file tree
Showing 20 changed files with 27,702 additions and 227 deletions.
21 changes: 21 additions & 0 deletions gui/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ package main
import (
"context"
"fmt"

"github.com/wailsapp/wails/v2/pkg/menu"
"github.com/wailsapp/wails/v2/pkg/menu/keys"
"github.com/wailsapp/wails/v2/pkg/runtime"
)

// App struct
Expand All @@ -19,6 +23,23 @@ func NewApp() *App {
func (b *App) startup(ctx context.Context) {
// Perform your setup here
b.ctx = ctx

// register a menu item
menu := menu.NewMenuFromItems(
menu.SubMenu("App", menu.NewMenuFromItems(
menu.Text("About", nil, b.about),
menu.Separator(),
menu.Text("Quit", keys.CmdOrCtrl("q"), func(_ *menu.CallbackData) {
runtime.Quit(ctx)
}),
)),
menu.SubMenu("Settings", menu.NewMenuFromItems(
menu.Text("ConfigPath", nil, b.setConfigPath),
menu.Separator(),
menu.Text("Preferences", keys.CmdOrCtrl("p"), b.openPreferences),
)),
)
runtime.MenuSetApplicationMenu(ctx, menu)
}

// domReady is called after the front-end dom has been loaded
Expand Down
19 changes: 19 additions & 0 deletions gui/app_menu.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package main

import (
"fmt"

"github.com/wailsapp/wails/v2/pkg/menu"
)

func (b *App) about(_ *menu.CallbackData) {
fmt.Println("about")
}

func (b *App) openPreferences(_ *menu.CallbackData) {
fmt.Println("openPreferences")
}

func (b *App) setConfigPath(_ *menu.CallbackData) {
fmt.Println("setConfigPath")
}
Binary file added gui/appicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions gui/build/darwin/Info.plist
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0"><dict>
<key>CFBundlePackageType</key><string>APPL</string>
<key>CFBundleName</key><string>gui</string>
<key>CFBundleExecutable</key><string>gui</string>
<key>CFBundleIdentifier</key><string>com.wails.gui</string>
<key>CFBundleName</key><string>ApolloSynchronizer</string>
<key>CFBundleExecutable</key><string>ApolloSynchronizer</string>
<key>CFBundleIdentifier</key><string>com.wails.ApolloSynchronizer</string>
<key>CFBundleVersion</key><string>1.0.0</string>
<key>CFBundleGetInfoString</key><string>Built using Wails (https://wails.app)</string>
<key>CFBundleShortVersionString</key><string>1.0.0</string>
Expand Down
23 changes: 23 additions & 0 deletions gui/frontend/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
.DS_Store
node_modules
/dist


# local env files
.env.local
.env.*.local

# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*

# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
24 changes: 24 additions & 0 deletions gui/frontend/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# frontend

## Project setup
```
npm install
```

### Compiles and hot-reloads for development
```
npm run serve
```

### Compiles and minifies for production
```
npm run build
```

### Lints and fixes files
```
npm run lint
```

### Customize configuration
See [Configuration Reference](https://cli.vuejs.org/config/).
5 changes: 5 additions & 0 deletions gui/frontend/babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = {
presets: [
'@vue/cli-plugin-babel/preset'
]
}
Loading

0 comments on commit 2253fb8

Please sign in to comment.