mirror of
https://github.com/wavetermdev/wails.git
synced 2026-04-22 15:26:15 -07:00
Compare commits
77 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 2d2ee95c8a | |||
| 47bf92850c | |||
| f98571fae5 | |||
| e314c41337 | |||
| 2c65415268 | |||
| b002830897 | |||
| fcf52abec8 | |||
| 8e3cb27bfe | |||
| 78212603bc | |||
| 1996e8b2ba | |||
| d7395fc56a | |||
| a278c9e164 | |||
| 60c6dce07d | |||
| 3972093ede | |||
| e78557ec24 | |||
| ea4d479be3 | |||
| 15e5eb67f9 | |||
| 8aea6a3bfc | |||
| 9c5600d8f3 | |||
| 97b24a51a1 | |||
| 106ff03f2e | |||
| d9e5cce2b2 | |||
| daad8437c2 | |||
| 8037eab895 | |||
| 09756b5150 | |||
| a52d68438b | |||
| f4d1d02ded | |||
| 3d12935e2e | |||
| 64480ff1ab | |||
| abe8ba9266 | |||
| 1048782eb4 | |||
| 622c4adad6 | |||
| ae6da05e9d | |||
| ba0b173e02 | |||
| 9097c9086b | |||
| c5c0617c89 | |||
| d29e01d552 | |||
| 122806161b | |||
| 3a23662a34 | |||
| 659cc3ed61 | |||
| 2a096a6ff9 | |||
| 0c09fe4560 | |||
| 51dd1361e3 | |||
| a48ea8768f | |||
| 95d34c510e | |||
| d36e130315 | |||
| 7d8f2243ae | |||
| 27ab3cf4e7 | |||
| 31b609dff0 | |||
| fbf75b1d14 | |||
| e9aa0d5c5a | |||
| cdfd70d3f7 | |||
| 7287fcc170 | |||
| c378d935f3 | |||
| 8eae31d865 | |||
| c7c068ade0 | |||
| b02dbfaddf | |||
| c63b1f1981 | |||
| 944494c4ef | |||
| a971751dab | |||
| 6ec670129b | |||
| 4506da041a | |||
| e9962198d0 | |||
| 82cb3b99e5 | |||
| dfb3ab0681 | |||
| 5b60fcc8f6 | |||
| 9e08fd668c | |||
| 513c1fd981 | |||
| 3866da944c | |||
| 613a9e3143 | |||
| ff8e701793 | |||
| 451b0c1e15 | |||
| 8ce9ee8e41 | |||
| 9593ea95f7 | |||
| c872802ced | |||
| a445db1b7b | |||
| fff838d7c6 |
@@ -6,21 +6,27 @@ labels: bug
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
<!---
|
||||
*** Please note: No new bug reports are being accepted for Wails v1 ***
|
||||
|
||||
#####################################################
|
||||
**V1 users: If you have a technical issue, please do not open a bug this way!**
|
||||
Please use the `wails issue` command!
|
||||
If you do not do this then the issue may be closed automatically.
|
||||
Before submitting this issue, please do the following:
|
||||
- Do a web search for your error. This usually leads to a much better understanding of the issue.
|
||||
- Prove that the error is indeed a Wails bug and not an application bug, with a specific set of steps to reproduce.
|
||||
- Search both the issue tracker (even closed issues) and discussion forums.
|
||||
- Try to fix it yourself. Keep a list of things you have done to fix the problem.
|
||||
|
||||
NOTE: If your bug is related to Windows, make sure you read
|
||||
the [Windows Developer Guide](https://wails.app/guides/windows/)
|
||||
#####################################################
|
||||
If after doing all the above, the problem remains, please continue with this ticket providing *all* the information requested.
|
||||
|
||||
Bug reports that do not follow these steps will likely be closed, so please help us to help you.
|
||||
|
||||
--->
|
||||
|
||||
**Description**
|
||||
A clear and concise description of what the bug is.
|
||||
|
||||
**To Reproduce**
|
||||
Steps to reproduce the behaviour:
|
||||
|
||||
1. Go to '...'
|
||||
2. Click on '....'
|
||||
3. Scroll down to '....'
|
||||
@@ -32,10 +38,11 @@ A clear and concise description of what you expected to happen.
|
||||
**Screenshots**
|
||||
If applicable, add screenshots to help explain your problem.
|
||||
|
||||
**Attempted Fixes**
|
||||
A list of things you have tried to fix the problem, including search engine links.
|
||||
|
||||
**System Details**
|
||||
V2 users: Please add the output of `wails doctor`.
|
||||
Please add the output of `wails doctor`.
|
||||
|
||||
**Additional context**
|
||||
Add any other context about the problem here.
|
||||
|
||||
- [ ] This issue is for Windows and I have read the [Windows Developer Guide](https://wails.app/guides/windows/)
|
||||
|
||||
@@ -6,6 +6,9 @@ labels: enhancement
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
<!---
|
||||
*** Please note: No new feature requests are being accepted for Wails v1 ***
|
||||
--->
|
||||
|
||||
**Is your feature request related to a problem? Please describe.**
|
||||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<p align="center" style="text-align: center">
|
||||
<img src="logo.png" width="55%"><br/>
|
||||
<img src="logo-universal.png" width="55%"><br/>
|
||||
</p>
|
||||
<p align="center">
|
||||
Build desktop applications using Go & Web Technologies.<br/><br/>
|
||||
@@ -79,12 +79,18 @@ approach: it provides the ability to wrap both Go code and a web frontend into a
|
||||
make this easy for you by handling project creation, compilation and bundling. All you have to do is get creative!
|
||||
|
||||
<span id="nav-3-1"></span>
|
||||
<hr/>
|
||||
<h3><strong>PLEASE NOTE: As we are approaching the v2 release, we are not accepting any new feature requests or bug reports for v1. If you have a critical issue, please open a ticket and state why it is critical.</strong></h3>
|
||||
<hr/>
|
||||
|
||||
### Official Website
|
||||
### Version 2
|
||||
|
||||
The official docs can be found at [https://wails.app](https://wails.app).
|
||||
Wails v2 has been released in Beta for all 3 platforms. Check out the [new website](https://wails.io) if you are
|
||||
interested in trying it out.
|
||||
|
||||
Click [here](https://wails.io) if you are interested in trying out v2 Beta for Windows.
|
||||
### Legacy v1 Website
|
||||
|
||||
The legacy v1 docs can be found at [https://wails.app](https://wails.app).
|
||||
|
||||
<span id="nav-4"></span>
|
||||
|
||||
|
||||
+6
-2
@@ -1,5 +1,5 @@
|
||||
<p align="center" style="text-align: center">
|
||||
<img src="logo.png" width="55%"><br/>
|
||||
<img src="logo-universal.png" width="55%"><br/>
|
||||
</p>
|
||||
<p align="center">
|
||||
使用 Go 和 Web 技术构建桌面应用程序。<br/><br/>
|
||||
@@ -81,9 +81,13 @@
|
||||
|
||||
### 官方网站
|
||||
|
||||
#### v1
|
||||
|
||||
官方文档可以在 [https://wails.app](https://wails.app) 中找到。
|
||||
|
||||
如果您对适用于 Windows 的 v2 测试版感兴趣,可以点击[此处](https://wails.io)查看。
|
||||
#### v2
|
||||
|
||||
Wails v2 已针对所有 3 个平台发布了 Beta 版。如果您有兴趣尝试一下,请查看[新网站](https://wails.io)。
|
||||
|
||||
镜像网站:
|
||||
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 147 KiB |
@@ -93,6 +93,9 @@ func AddBuildSubcommand(app *clir.Cli, w io.Writer) {
|
||||
debug := false
|
||||
command.BoolFlag("debug", "Retains debug data in the compiled application", &debug)
|
||||
|
||||
nsis := false
|
||||
command.BoolFlag("nsis", "Generate NSIS installer for Windows", &nsis)
|
||||
|
||||
command.Action(func() error {
|
||||
|
||||
quiet := verbosity == 0
|
||||
@@ -117,20 +120,12 @@ func AddBuildSubcommand(app *clir.Cli, w io.Writer) {
|
||||
}
|
||||
|
||||
// Tags
|
||||
experimental := false
|
||||
userTags := []string{}
|
||||
for _, tag := range strings.Split(tags, " ") {
|
||||
thisTag := strings.TrimSpace(tag)
|
||||
if thisTag != "" {
|
||||
userTags = append(userTags, thisTag)
|
||||
}
|
||||
if thisTag == "exp" {
|
||||
experimental = true
|
||||
}
|
||||
}
|
||||
|
||||
if runtime.GOOS == "linux" && !experimental {
|
||||
return fmt.Errorf("Linux version coming soon!")
|
||||
}
|
||||
|
||||
// Webview2 installer strategy (download by default)
|
||||
@@ -214,6 +209,9 @@ func AddBuildSubcommand(app *clir.Cli, w io.Writer) {
|
||||
return err
|
||||
}
|
||||
projectOptions, err := project.Load(cwd)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// Check platform
|
||||
validPlatformArch := slicer.String([]string{
|
||||
@@ -227,9 +225,18 @@ func AddBuildSubcommand(app *clir.Cli, w io.Writer) {
|
||||
"windows",
|
||||
"windows/amd64",
|
||||
"windows/arm64",
|
||||
"windows/386",
|
||||
})
|
||||
|
||||
outputBinaries := map[string]string{}
|
||||
|
||||
// Allows cancelling the build after the first error. It would be nice if targets.Each would support funcs
|
||||
// returning an error.
|
||||
var targetErr error
|
||||
targets.Each(func(platform string) {
|
||||
if targetErr != nil {
|
||||
return
|
||||
}
|
||||
|
||||
if !validPlatformArch.Contains(platform) {
|
||||
buildOptions.Logger.Println("platform '%s' is not supported - skipping. Supported platforms: %s", platform, validPlatformArch.Join(","))
|
||||
@@ -301,18 +308,35 @@ func AddBuildSubcommand(app *clir.Cli, w io.Writer) {
|
||||
|
||||
outputFilename, err := build.Build(buildOptions)
|
||||
if err != nil {
|
||||
logger.Println("Error: ", err.Error())
|
||||
logger.Println("Error: %s", err.Error())
|
||||
targetErr = err
|
||||
return
|
||||
}
|
||||
|
||||
// Subsequent iterations
|
||||
buildOptions.IgnoreFrontend = true
|
||||
buildOptions.CleanBuildDirectory = false
|
||||
|
||||
// Output stats
|
||||
buildOptions.Logger.Println(fmt.Sprintf("Built '%s' in %s.\n", outputFilename, time.Since(start).Round(time.Millisecond).String()))
|
||||
|
||||
outputBinaries[platform] = outputFilename
|
||||
})
|
||||
|
||||
if targetErr != nil {
|
||||
return targetErr
|
||||
}
|
||||
|
||||
if nsis {
|
||||
amd64Binary := outputBinaries["windows/amd64"]
|
||||
arm64Binary := outputBinaries["windows/arm64"]
|
||||
if amd64Binary == "" && arm64Binary == "" {
|
||||
return fmt.Errorf("cannot build nsis installer - no windows targets")
|
||||
}
|
||||
|
||||
if err := build.GenerateNSISInstaller(buildOptions, amd64Binary, arm64Binary); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return nil
|
||||
})
|
||||
}
|
||||
|
||||
@@ -10,7 +10,6 @@ import (
|
||||
"os/signal"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
"strconv"
|
||||
"strings"
|
||||
"sync"
|
||||
"syscall"
|
||||
@@ -103,20 +102,12 @@ func AddSubcommand(app *clir.Cli, w io.Writer) error {
|
||||
logger := clilogger.New(w)
|
||||
app.PrintBanner()
|
||||
|
||||
experimental := false
|
||||
userTags := []string{}
|
||||
for _, tag := range strings.Split(flags.tags, " ") {
|
||||
thisTag := strings.TrimSpace(tag)
|
||||
if thisTag != "" {
|
||||
userTags = append(userTags, thisTag)
|
||||
}
|
||||
if thisTag == "exp" {
|
||||
experimental = true
|
||||
}
|
||||
}
|
||||
|
||||
if runtime.GOOS == "linux" && !experimental {
|
||||
return fmt.Errorf("Linux version coming soon!")
|
||||
}
|
||||
|
||||
cwd, err := os.Getwd()
|
||||
@@ -141,22 +132,16 @@ func AddSubcommand(app *clir.Cli, w io.Writer) error {
|
||||
return err
|
||||
}
|
||||
|
||||
self := os.Args[0]
|
||||
if flags.tags != "" {
|
||||
err = runCommand(cwd, true, "wails", "generate", "module", "-tags", flags.tags)
|
||||
err = runCommand(cwd, true, self, "generate", "module", "-tags", flags.tags)
|
||||
} else {
|
||||
err = runCommand(cwd, true, "wails", "generate", "module")
|
||||
err = runCommand(cwd, true, self, "generate", "module")
|
||||
}
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// frontend:dev server command
|
||||
if projectConfig.DevCommand != "" {
|
||||
var devCommandWaitGroup sync.WaitGroup
|
||||
closer := runFrontendDevCommand(cwd, projectConfig.DevCommand, &devCommandWaitGroup)
|
||||
defer closer(&devCommandWaitGroup)
|
||||
}
|
||||
|
||||
buildOptions := generateBuildOptions(flags)
|
||||
buildOptions.Logger = logger
|
||||
buildOptions.UserTags = internal.ParseUserTags(flags.tags)
|
||||
@@ -178,6 +163,13 @@ func AddSubcommand(app *clir.Cli, w io.Writer) error {
|
||||
debugBinaryProcess = newProcess
|
||||
}
|
||||
|
||||
// frontend:dev:watcher command.
|
||||
if command := projectConfig.DevWatcherCommand; command != "" {
|
||||
var devCommandWaitGroup sync.WaitGroup
|
||||
closer := runFrontendDevWatcherCommand(cwd, command, &devCommandWaitGroup)
|
||||
defer closer(&devCommandWaitGroup)
|
||||
}
|
||||
|
||||
// open browser
|
||||
if flags.openBrowser {
|
||||
url := defaultDevServerURL
|
||||
@@ -255,6 +247,7 @@ func runCommand(dir string, exitOnError bool, command string, args ...string) er
|
||||
output, err := cmd.CombinedOutput()
|
||||
if err != nil {
|
||||
println(string(output))
|
||||
println(err.Error())
|
||||
if exitOnError {
|
||||
os.Exit(1)
|
||||
}
|
||||
@@ -376,9 +369,9 @@ func loadAndMergeProjectConfig(cwd string, flags *devFlags) (*project.Project, e
|
||||
return projectConfig, nil
|
||||
}
|
||||
|
||||
// runFrontendDevCommand will run the `frontend:dev` command if it was given, ex- `npm run dev`
|
||||
func runFrontendDevCommand(cwd string, devCommand string, wg *sync.WaitGroup) func(group *sync.WaitGroup) {
|
||||
LogGreen("Running frontend dev command: '%s'", devCommand)
|
||||
// runFrontendDevWatcherCommand will run the `frontend:dev:watcher` command if it was given, ex- `npm run dev`
|
||||
func runFrontendDevWatcherCommand(cwd string, devCommand string, wg *sync.WaitGroup) func(group *sync.WaitGroup) {
|
||||
LogGreen("Running frontend dev watcher command: '%s'", devCommand)
|
||||
ctx, cancel := context.WithCancel(context.Background())
|
||||
dir := filepath.Join(cwd, "frontend")
|
||||
cmdSlice := strings.Split(devCommand, " ")
|
||||
@@ -387,6 +380,8 @@ func runFrontendDevCommand(cwd string, devCommand string, wg *sync.WaitGroup) fu
|
||||
cmd.Stderr = os.Stderr
|
||||
cmd.Stdout = os.Stdout
|
||||
cmd.Dir = dir
|
||||
|
||||
setParentGID(cmd)
|
||||
go func(ctx context.Context, devCommand string, cwd string, wg *sync.WaitGroup) {
|
||||
err := cmd.Run()
|
||||
if err != nil {
|
||||
@@ -399,23 +394,9 @@ func runFrontendDevCommand(cwd string, devCommand string, wg *sync.WaitGroup) fu
|
||||
}(ctx, devCommand, cwd, wg)
|
||||
|
||||
return func(wg *sync.WaitGroup) {
|
||||
if runtime.GOOS == "windows" {
|
||||
// Credit: https://stackoverflow.com/a/44551450
|
||||
// For whatever reason, killing an npm script on windows just doesn't exit properly with cancel
|
||||
if cmd != nil && cmd.Process != nil {
|
||||
kill := exec.Command("TASKKILL", "/T", "/F", "/PID", strconv.Itoa(cmd.Process.Pid))
|
||||
kill.Stderr = os.Stderr
|
||||
kill.Stdout = os.Stdout
|
||||
err := kill.Run()
|
||||
if err != nil {
|
||||
if err.Error() != "exit status 1" {
|
||||
LogRed("Error from '%s': %s", devCommand, err.Error())
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
cancel()
|
||||
}
|
||||
killProc(cmd, devCommand)
|
||||
LogGreen("Dev command killed!")
|
||||
cancel()
|
||||
wg.Wait()
|
||||
}
|
||||
}
|
||||
@@ -439,6 +420,10 @@ func initialiseWatcher(cwd string, logFatal func(string, ...interface{})) (*fsno
|
||||
return
|
||||
}
|
||||
// Ignore build directory
|
||||
if strings.Contains(dir, ".git") {
|
||||
return
|
||||
}
|
||||
// Ignore build directory
|
||||
if strings.HasPrefix(dir, filepath.Join(cwd, "build")) {
|
||||
return
|
||||
}
|
||||
@@ -540,6 +525,8 @@ func doWatcherLoop(buildOptions *build.Options, debugBinaryProcess *process.Proc
|
||||
if exitCode == 0 {
|
||||
quit = true
|
||||
}
|
||||
case err := <-watcher.Errors:
|
||||
LogDarkYellow(err.Error())
|
||||
case item := <-watcher.Events:
|
||||
// Check for file writes
|
||||
if item.Op&fsnotify.Write == fsnotify.Write {
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
//go:build darwin || linux
|
||||
// +build darwin linux
|
||||
|
||||
package dev
|
||||
|
||||
import (
|
||||
"os/exec"
|
||||
"syscall"
|
||||
)
|
||||
|
||||
func setParentGID(cmd *exec.Cmd) {
|
||||
cmd.SysProcAttr = &syscall.SysProcAttr{
|
||||
Setpgid: true,
|
||||
}
|
||||
}
|
||||
|
||||
func killProc(cmd *exec.Cmd, devCommand string) {
|
||||
// Experiencing the same issue on macOS BigSur
|
||||
// I'm using Vite, but I would imagine this could be an issue with Node (npm) in general
|
||||
// Also, after several edit/rebuild cycles any abnormal shutdown (crash or CTRL-C) may still leave Node running
|
||||
// Credit: https://stackoverflow.com/a/29552044/14764450 (same page as the Windows solution above)
|
||||
// Not tested on *nix
|
||||
pgid, err := syscall.Getpgid(cmd.Process.Pid)
|
||||
if err == nil {
|
||||
err := syscall.Kill(-pgid, 15) // note the minus sign
|
||||
if err != nil {
|
||||
LogRed("Error from '%s' when attempting to kill the process: %s", devCommand, err.Error())
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
//go:build windows
|
||||
// +build windows
|
||||
|
||||
package dev
|
||||
|
||||
import (
|
||||
"os"
|
||||
"os/exec"
|
||||
"strconv"
|
||||
)
|
||||
|
||||
func setParentGID(_ *exec.Cmd) {}
|
||||
|
||||
func killProc(cmd *exec.Cmd, devCommand string) {
|
||||
// Credit: https://stackoverflow.com/a/44551450
|
||||
// For whatever reason, killing an npm script on windows just doesn't exit properly with cancel
|
||||
if cmd != nil && cmd.Process != nil {
|
||||
kill := exec.Command("TASKKILL", "/T", "/F", "/PID", strconv.Itoa(cmd.Process.Pid))
|
||||
kill.Stderr = os.Stderr
|
||||
kill.Stdout = os.Stdout
|
||||
err := kill.Run()
|
||||
if err != nil {
|
||||
if err.Error() != "exit status 1" {
|
||||
LogRed("Error from '%s': %s", devCommand, err.Error())
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -21,11 +21,18 @@ func (a *App) startup(ctx context.Context) {
|
||||
a.ctx = ctx
|
||||
}
|
||||
|
||||
// domReady is called after the front-end dom has been loaded
|
||||
// domReady is called after front-end resources have been loaded
|
||||
func (a App) domReady(ctx context.Context) {
|
||||
// Add your action here
|
||||
}
|
||||
|
||||
// beforeClose is called when the application is about to quit,
|
||||
// either by clicking the window close button or calling runtime.Quit.
|
||||
// Returning true will cause the application to continue, false will continue shutdown as normal.
|
||||
func (a *App) beforeClose(ctx context.Context) (prevent bool) {
|
||||
return false
|
||||
}
|
||||
|
||||
// shutdown is called at application termination
|
||||
func (a *App) shutdown(ctx context.Context) {
|
||||
// Perform your teardown here
|
||||
@@ -33,5 +40,5 @@ func (a *App) shutdown(ctx context.Context) {
|
||||
|
||||
// Greet returns a greeting for the given name
|
||||
func (a *App) Greet(name string) string {
|
||||
return fmt.Sprintf("Hello %s!", name)
|
||||
return fmt.Sprintf("Hello %s, It's show time!", name)
|
||||
}
|
||||
|
||||
Vendored
-80
@@ -1,80 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg width="100%" height="100%" viewBox="0 0 551 436" version="1.1" xmlns="http://www.w3.org/2000/svg"
|
||||
xml:space="preserve"
|
||||
style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
|
||||
<g transform="matrix(1.27527,0,0,1.27527,104.01,410.563)">
|
||||
<path d="M0,-51.891L14.429,-51.891L13.043,-21.183L22.568,-51.891L34.226,-51.891L34.084,-21.183L42.365,-51.891L56.794,-51.891L38.526,0L25.198,0L25.34,-32.45L15.211,0L1.919,0L0,-51.891Z"
|
||||
style="fill:white;fill-rule:nonzero;"/>
|
||||
</g>
|
||||
<g transform="matrix(1.27527,0,0,1.27527,224.985,367.503)">
|
||||
<path d="M0,15.639L5.793,15.639L5.971,-3.589L0,15.639ZM-20.187,33.765L-0.675,-18.126L16.42,-18.126L20.08,33.765L5.437,33.765L5.509,26.123L-3.057,26.123L-5.332,33.765L-20.187,33.765Z"
|
||||
style="fill:white;fill-rule:nonzero;"/>
|
||||
</g>
|
||||
<g transform="matrix(0.19929,-1.2596,-1.2596,-0.19929,332.323,396.949)">
|
||||
<path d="M-16.046,33.107L36.491,33.107L38.757,18.784L-13.785,18.82L-16.046,33.107Z"
|
||||
style="fill:white;fill-rule:nonzero;"/>
|
||||
</g>
|
||||
<g transform="matrix(1.27527,0,0,1.27527,353.217,344.388)">
|
||||
<path d="M0,51.891L8.246,0L22.781,0L16.597,39.024L27.224,39.024L25.199,51.891L0,51.891Z"
|
||||
style="fill:white;fill-rule:nonzero;"/>
|
||||
</g>
|
||||
<g transform="matrix(1.27527,0,0,1.27527,427.939,364.922)">
|
||||
<path d="M0,19.83C1.611,21.181 3.305,22.224 5.083,22.959C6.859,23.693 8.565,24.06 10.2,24.06C11.645,24.06 12.794,23.663 13.647,22.87C14.5,22.076 14.927,20.992 14.927,19.617C14.927,18.434 14.571,17.254 13.861,16.081C13.15,14.908 11.775,13.351 9.738,11.408C7.273,9.015 5.58,6.906 4.655,5.081C3.731,3.257 3.27,1.243 3.27,-0.96C3.27,-5.912 4.839,-9.846 7.979,-12.76C11.118,-15.674 15.377,-17.132 20.756,-17.132C22.936,-17.132 25.008,-16.889 26.975,-16.403C28.941,-15.917 30.943,-15.165 32.982,-14.146L30.92,-1.493C29.356,-2.583 27.834,-3.412 26.354,-3.981C24.872,-4.551 23.457,-4.835 22.106,-4.835C20.898,-4.835 19.943,-4.521 19.245,-3.894C18.546,-3.265 18.196,-2.406 18.196,-1.316C18.196,0.154 19.535,2.215 22.213,4.868C22.544,5.2 22.805,5.46 22.995,5.649C25.696,8.304 27.473,10.578 28.326,12.475C29.179,14.37 29.605,16.56 29.605,19.049C29.605,24.594 27.893,28.965 24.469,32.163C21.046,35.361 16.36,36.962 10.413,36.962C7.877,36.962 5.479,36.66 3.216,36.056C0.953,35.45 -0.948,34.615 -2.488,33.549L0,19.83Z"
|
||||
style="fill:white;fill-rule:nonzero;"/>
|
||||
</g>
|
||||
<g transform="matrix(-166.599,4.57132,4.57132,166.599,147.403,167.648)">
|
||||
<path d="M0.883,-0.081L0.121,0.081L0.256,-0.063L0.883,-0.081Z" style="fill:url(#_Linear1);fill-rule:nonzero;"/>
|
||||
</g>
|
||||
<g transform="matrix(-106.443,-16.0669,-16.0669,106.443,428.19,188.033)">
|
||||
<path d="M0.878,-0.285L-0.073,0.71L-1.186,0.542L0.015,0.207L-0.846,0.077L0.355,-0.258L-0.505,-0.388L0.649,-0.71L0.878,-0.285Z"
|
||||
style="fill:url(#_Linear2);fill-rule:nonzero;"/>
|
||||
</g>
|
||||
<g transform="matrix(-114.484,-162.408,-162.408,114.484,333.291,285.804)">
|
||||
<path d="M0.44,-0.04L0.44,-0.04L0.44,-0.04L0.265,-0.056L0.177,0.437L-0.311,-0.255L0.262,-0.437L0.568,-0.437L0.44,-0.04Z"
|
||||
style="fill:url(#_Linear3);fill-rule:nonzero;"/>
|
||||
</g>
|
||||
<g transform="matrix(61.6919,58.8091,58.8091,-61.6919,258.631,180.413)">
|
||||
<path d="M0.5,0L0.5,-0L0.5,0L0.5,0Z" style="fill:url(#_Linear4);fill-rule:nonzero;"/>
|
||||
</g>
|
||||
<g transform="matrix(238.126,298.893,298.893,-238.126,113.516,-150.536)">
|
||||
<path d="M0.622,-0.115L0.761,-0.115L0.806,-0.013L0.826,0.182L0.622,-0.115Z"
|
||||
style="fill:url(#_Linear5);fill-rule:nonzero;"/>
|
||||
</g>
|
||||
<g transform="matrix(-369.529,-97.4118,-97.4118,369.529,582.38,94.027)">
|
||||
<path d="M0.467,0.005L0.49,0.062L0.271,-0.062L0.467,0.005Z" style="fill:url(#_Linear6);fill-rule:nonzero;"/>
|
||||
</g>
|
||||
<g transform="matrix(-496.156,-53.9751,-53.9751,496.156,367.888,125.085)">
|
||||
<path d="M0.2,0.001L0.219,-0.018L0.614,0.012L0.519,0.089L0.282,0.068L0.2,0.135L0.463,0.194L0.374,0.266L0.138,0.186L0.138,0.186L0.138,0.186L0.047,0.033L-0.131,-0.266L0.2,0.001Z"
|
||||
style="fill:url(#_Linear7);fill-rule:nonzero;"/>
|
||||
</g>
|
||||
<g transform="matrix(185.076,176.427,176.427,-185.076,153.446,80.1488)">
|
||||
<path d="M0.735,-0L0.735,-0L0.735,0L0.735,-0Z" style="fill:url(#_Linear8);fill-rule:nonzero;"/>
|
||||
</g>
|
||||
<defs>
|
||||
<linearGradient id="_Linear1" x1="0" y1="0" x2="1" y2="0" gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(1,-3.46945e-18,-3.46945e-18,-1,0,-3.05761e-06)"><stop offset="0" style="stop-color:rgb(227,50,50);stop-opacity:1"/>
|
||||
<stop offset="1" style="stop-color:rgb(107,0,13);stop-opacity:1"/></linearGradient>
|
||||
<linearGradient id="_Linear2" x1="0" y1="0" x2="1" y2="0" gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(1,0,0,-1,0,-2.75467e-06)"><stop offset="0" style="stop-color:rgb(227,50,50);stop-opacity:1"/>
|
||||
<stop offset="1" style="stop-color:rgb(107,0,13);stop-opacity:1"/></linearGradient>
|
||||
<linearGradient id="_Linear3" x1="0" y1="0" x2="1" y2="0" gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(1,-1.11022e-16,-1.11022e-16,-1,0,-2.61861e-06)"><stop offset="0" style="stop-color:rgb(227,50,50);stop-opacity:1"/>
|
||||
<stop offset="1" style="stop-color:rgb(107,0,13);stop-opacity:1"/></linearGradient>
|
||||
<linearGradient id="_Linear4" x1="0" y1="0" x2="1" y2="0" gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(1,-5.55112e-17,-5.55112e-17,-1,0,-1.57562e-06)"><stop offset="0" style="stop-color:rgb(227,50,50);stop-opacity:1"/>
|
||||
<stop offset="1" style="stop-color:rgb(107,0,13);stop-opacity:1"/></linearGradient>
|
||||
<linearGradient id="_Linear5" x1="0" y1="0" x2="1" y2="0" gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(-0.801899,-0.59746,-0.59746,0.801899,1.3495,0.447457)"><stop offset="0" style="stop-color:rgb(227,50,50);stop-opacity:1"/>
|
||||
<stop offset="1" style="stop-color:rgb(107,0,13);stop-opacity:1"/></linearGradient>
|
||||
<linearGradient id="_Linear6" x1="0" y1="0" x2="1" y2="0" gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(1,-2.77556e-17,-2.77556e-17,-1,0,-1.92826e-06)"><stop offset="0" style="stop-color:rgb(227,50,50);stop-opacity:1"/>
|
||||
<stop offset="1" style="stop-color:rgb(107,0,13);stop-opacity:1"/></linearGradient>
|
||||
<linearGradient id="_Linear7" x1="0" y1="0" x2="1" y2="0" gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(1,0,0,-1,0,9.68429e-07)"><stop offset="0" style="stop-color:rgb(227,50,50);stop-opacity:1"/>
|
||||
<stop offset="1" style="stop-color:rgb(107,0,13);stop-opacity:1"/></linearGradient>
|
||||
<linearGradient id="_Linear8" x1="0" y1="0" x2="1" y2="0" gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(1,0,0,-1,0,1.43665e-07)"><stop offset="0" style="stop-color:rgb(227,50,50);stop-opacity:1"/>
|
||||
<stop offset="1" style="stop-color:rgb(107,0,13);stop-opacity:1"/></linearGradient>
|
||||
</defs>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 7.2 KiB |
v2/cmd/wails/internal/commands/generate/template/base/frontend/dist/assets/images/logo-universal.png
Vendored
BIN
Binary file not shown.
|
After Width: | Height: | Size: 147 KiB |
+18
-16
@@ -1,18 +1,20 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<link rel="stylesheet" href="/main.css" />
|
||||
</head>
|
||||
|
||||
<head>
|
||||
<link rel="stylesheet" href="/main.css">
|
||||
</head>
|
||||
|
||||
<body data-wails-drag>
|
||||
<div class="logo"></div>
|
||||
<div class="result" id="result">Please enter your name below 👇</div>
|
||||
<div class="input-box" id="input" data-wails-no-drag>
|
||||
<input class="input" id="name" type="text" autocomplete="off">
|
||||
<button class="btn" onclick="greet()">Greet</button>
|
||||
</div>
|
||||
|
||||
<script src="/main.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
<body>
|
||||
<div id="app" class="app">
|
||||
<div class="logo"></div>
|
||||
<div class="result" id="result">Please enter your name below 👇</div>
|
||||
<div class="input-box" id="input">
|
||||
<input class="input" id="name" type="text" autocomplete="off" />
|
||||
<button class="btn" onclick="greet()">Greet</button>
|
||||
</div>
|
||||
</div>
|
||||
<script src="/main.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
+12
-5
@@ -1,5 +1,5 @@
|
||||
html {
|
||||
background-color: rgba(33, 37, 43, 1);
|
||||
background-color: rgba(27, 38, 54, 1);
|
||||
text-align: center;
|
||||
color: white;
|
||||
}
|
||||
@@ -20,15 +20,22 @@ body {
|
||||
url("assets/fonts/nunito-v16-latin-regular.woff2") format("woff2");
|
||||
}
|
||||
|
||||
#app {
|
||||
height: 100vh;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.logo {
|
||||
display: block;
|
||||
width: 35%;
|
||||
height: 35%;
|
||||
width: 50%;
|
||||
height: 50%;
|
||||
margin: auto;
|
||||
padding: 15% 0 0;
|
||||
padding: 10% 0 0;
|
||||
background-position: center;
|
||||
background-repeat: no-repeat;
|
||||
background-image: url("./assets/images/logo-dark.svg");
|
||||
background-image: url("./assets/images/logo-universal.png");
|
||||
background-size: 100% 100%;
|
||||
background-origin: content-box;
|
||||
}
|
||||
.result {
|
||||
height: 20px;
|
||||
|
||||
+17
-8
@@ -4,20 +4,29 @@ nameElement.focus();
|
||||
|
||||
// Setup the greet function
|
||||
window.greet = function () {
|
||||
|
||||
// Get name
|
||||
let name = nameElement.value;
|
||||
|
||||
// Check if the input is empty
|
||||
if (name === "") return;
|
||||
|
||||
// Call App.Greet(name)
|
||||
window.go.main.App.Greet(name).then((result) => {
|
||||
// Update result with data back from App.Greet()
|
||||
document.getElementById("result").innerText = result;
|
||||
});
|
||||
try {
|
||||
window.go.main.App.Greet(name)
|
||||
.then((result) => {
|
||||
// Update result with data back from App.Greet()
|
||||
document.getElementById("result").innerText = result;
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error(err);
|
||||
});
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
}
|
||||
};
|
||||
|
||||
nameElement.onkeydown = function (e) {
|
||||
console.log(e)
|
||||
if (e.keyCode == 13) {
|
||||
window.greet()
|
||||
window.greet();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -7,36 +7,44 @@ import (
|
||||
"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/mac"
|
||||
"github.com/wailsapp/wails/v2/pkg/options/windows"
|
||||
)
|
||||
|
||||
//go:embed frontend/dist
|
||||
var assets embed.FS
|
||||
|
||||
//go:embed build/appicon.png
|
||||
var icon []byte
|
||||
|
||||
func main() {
|
||||
// Create an instance of the app structure
|
||||
app := NewApp()
|
||||
|
||||
// Create application with options
|
||||
err := wails.Run(&options.App{
|
||||
Title: "{{.ProjectName}}",
|
||||
Width: 1024,
|
||||
Height: 768,
|
||||
// MinWidth: 720,
|
||||
// MinHeight: 570,
|
||||
// MaxWidth: 1280,
|
||||
// MaxHeight: 740,
|
||||
Title: "{{.ProjectName}}",
|
||||
Width: 1024,
|
||||
Height: 768,
|
||||
MinWidth: 1024,
|
||||
MinHeight: 768,
|
||||
MaxWidth: 1280,
|
||||
MaxHeight: 800,
|
||||
DisableResize: false,
|
||||
Fullscreen: false,
|
||||
Frameless: false,
|
||||
StartHidden: false,
|
||||
HideWindowOnClose: false,
|
||||
RGBA: &options.RGBA{255, 255, 255, 255},
|
||||
RGBA: &options.RGBA{R: 255, G: 255, B: 255, A: 255},
|
||||
Assets: assets,
|
||||
Menu: nil,
|
||||
Logger: nil,
|
||||
LogLevel: logger.DEBUG,
|
||||
OnStartup: app.startup,
|
||||
OnDomReady: app.domReady,
|
||||
OnBeforeClose: app.beforeClose,
|
||||
OnShutdown: app.shutdown,
|
||||
WindowStartState: options.Normal,
|
||||
Bind: []interface{}{
|
||||
app,
|
||||
},
|
||||
@@ -45,6 +53,27 @@ func main() {
|
||||
WebviewIsTransparent: false,
|
||||
WindowIsTranslucent: false,
|
||||
DisableWindowIcon: false,
|
||||
// DisableFramelessWindowDecorations: false,
|
||||
WebviewUserDataPath: "",
|
||||
},
|
||||
// Mac platform specific options
|
||||
Mac: &mac.Options{
|
||||
TitleBar: &mac.TitleBar{
|
||||
TitlebarAppearsTransparent: true,
|
||||
HideTitle: false,
|
||||
HideTitleBar: false,
|
||||
FullSizeContent: false,
|
||||
UseToolbar: false,
|
||||
HideToolbarSeparator: true,
|
||||
},
|
||||
Appearance: mac.NSAppearanceNameDarkAqua,
|
||||
WebviewIsTransparent: true,
|
||||
WindowIsTranslucent: true,
|
||||
About: &mac.AboutInfo{
|
||||
Title: "{{.ProjectName}}",
|
||||
Message: "",
|
||||
Icon: icon,
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
{
|
||||
"name": "{{.ProjectName}}",
|
||||
"author": "",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"install": "go install github.com/wailsapp/wails/v2/cmd/wails@latest",
|
||||
"build": "wails build --clean",
|
||||
"build:macos": "npm run build -- --platform darwin/universal",
|
||||
"build:macos-arm": "npm run build -- --platform darwin/arm64",
|
||||
"build:macos-intel": "npm run build -- --platform darwin",
|
||||
"build:windows": "npm run build -- --platform windows/amd64"
|
||||
},
|
||||
"workspaces": [
|
||||
"frontend"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
#! /bin/bash
|
||||
|
||||
echo -e "Start running the script..."
|
||||
cd ../
|
||||
|
||||
echo -e "Start building the app for macos platform..."
|
||||
wails build --clean --platform darwin/arm64
|
||||
|
||||
echo -e "End running the script!"
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user