mirror of
https://github.com/taigrr/wails.git
synced 2026-04-11 17:41:31 -07:00
Compare commits
3 Commits
561-Suppor
...
firebug
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
02d6fe609c | ||
|
|
93e7432ba9 | ||
|
|
cb933cc987 |
@@ -39,4 +39,3 @@ Wails is what it is because of the time and effort given by these great people.
|
|||||||
* [Kyle](https://github.com/kmuchmore)
|
* [Kyle](https://github.com/kmuchmore)
|
||||||
* [Balakrishna Prasad Ganne](https://github.com/aayush420)
|
* [Balakrishna Prasad Ganne](https://github.com/aayush420)
|
||||||
* [Charaf Rezrazi](https://github.com/Rezrazi)
|
* [Charaf Rezrazi](https://github.com/Rezrazi)
|
||||||
* [misitebao](https://github.com/misitebao)
|
|
||||||
@@ -65,8 +65,6 @@ const (
|
|||||||
Solus
|
Solus
|
||||||
// Ctlos Linux distribution
|
// Ctlos Linux distribution
|
||||||
Ctlos
|
Ctlos
|
||||||
// EndeavourOS linux distribution
|
|
||||||
EndeavourOS
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// DistroInfo contains all the information relating to a linux distribution
|
// DistroInfo contains all the information relating to a linux distribution
|
||||||
@@ -134,7 +132,7 @@ func parseOsRelease(osRelease string) *DistroInfo {
|
|||||||
case "archlabs":
|
case "archlabs":
|
||||||
result.Distribution = ArchLabs
|
result.Distribution = ArchLabs
|
||||||
case "ctlos":
|
case "ctlos":
|
||||||
result.Distribution = Ctlos
|
result.Distribution = Ctlos
|
||||||
case "debian":
|
case "debian":
|
||||||
result.Distribution = Debian
|
result.Distribution = Debian
|
||||||
case "ubuntu":
|
case "ubuntu":
|
||||||
@@ -173,8 +171,6 @@ func parseOsRelease(osRelease string) *DistroInfo {
|
|||||||
result.Distribution = PopOS
|
result.Distribution = PopOS
|
||||||
case "solus":
|
case "solus":
|
||||||
result.Distribution = Solus
|
result.Distribution = Solus
|
||||||
case "endeavouros":
|
|
||||||
result.Distribution = EndeavourOS
|
|
||||||
default:
|
default:
|
||||||
result.Distribution = Unknown
|
result.Distribution = Unknown
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -202,16 +202,7 @@ distributions:
|
|||||||
name: Ctlos Linux
|
name: Ctlos Linux
|
||||||
gccversioncommand: *gccdumpversion
|
gccversioncommand: *gccdumpversion
|
||||||
programs: *archdefaultprograms
|
programs: *archdefaultprograms
|
||||||
libraries: *archdefaultlibraries
|
libraries: *archdefaultlibraries
|
||||||
endeavouros:
|
|
||||||
id: endeavouros
|
|
||||||
releases:
|
|
||||||
default:
|
|
||||||
version: default
|
|
||||||
name: EndeavourOS
|
|
||||||
gccversioncommand: *gccdumpversion
|
|
||||||
programs: *archdefaultprograms
|
|
||||||
libraries: *archdefaultlibraries
|
|
||||||
manjaro:
|
manjaro:
|
||||||
id: manjaro
|
id: manjaro
|
||||||
releases:
|
releases:
|
||||||
|
|||||||
@@ -276,7 +276,7 @@ func CheckDependencies(logger *Logger) (bool, error) {
|
|||||||
switch distroInfo.Distribution {
|
switch distroInfo.Distribution {
|
||||||
case Ubuntu, Debian, Zorin, Parrot, Linuxmint, Elementary, Kali, Neon, Deepin, Raspbian, PopOS:
|
case Ubuntu, Debian, Zorin, Parrot, Linuxmint, Elementary, Kali, Neon, Deepin, Raspbian, PopOS:
|
||||||
libraryChecker = DpkgInstalled
|
libraryChecker = DpkgInstalled
|
||||||
case Arch, ArcoLinux, ArchLabs, Ctlos, Manjaro, ManjaroARM, EndeavourOS:
|
case Arch, ArcoLinux, ArchLabs, Ctlos, Manjaro, ManjaroARM:
|
||||||
libraryChecker = PacmanInstalled
|
libraryChecker = PacmanInstalled
|
||||||
case CentOS, Fedora, Tumbleweed, Leap:
|
case CentOS, Fedora, Tumbleweed, Leap:
|
||||||
libraryChecker = RpmInstalled
|
libraryChecker = RpmInstalled
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
package cmd
|
package cmd
|
||||||
|
|
||||||
// Version - Wails version
|
// Version - Wails version
|
||||||
const Version = "v1.10.0-pre1"
|
const Version = "v1.8.1-pre6"
|
||||||
|
|||||||
@@ -73,6 +73,7 @@ func init() {
|
|||||||
// Project options
|
// Project options
|
||||||
projectOptions := &cmd.ProjectOptions{}
|
projectOptions := &cmd.ProjectOptions{}
|
||||||
projectOptions.Verbose = verbose
|
projectOptions.Verbose = verbose
|
||||||
|
projectOptions.UseFirebug = usefirebug
|
||||||
|
|
||||||
// Check we are in project directory
|
// Check we are in project directory
|
||||||
// Check project.json loads correctly
|
// Check project.json loads correctly
|
||||||
@@ -82,9 +83,6 @@ func init() {
|
|||||||
return fmt.Errorf("Unable to find 'project.json'. Please check you are in a Wails project directory")
|
return fmt.Errorf("Unable to find 'project.json'. Please check you are in a Wails project directory")
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set firebug flag
|
|
||||||
projectOptions.UseFirebug = usefirebug
|
|
||||||
|
|
||||||
// Check that this platform is supported
|
// Check that this platform is supported
|
||||||
if !projectOptions.PlatformSupported() {
|
if !projectOptions.PlatformSupported() {
|
||||||
logger.Yellow("WARNING: This project is unsupported on %s - it probably won't work!\n Valid platforms: %s\n", runtime.GOOS, strings.Join(projectOptions.Platforms, ", "))
|
logger.Yellow("WARNING: This project is unsupported on %s - it probably won't work!\n Valid platforms: %s\n", runtime.GOOS, strings.Join(projectOptions.Platforms, ", "))
|
||||||
|
|||||||
54
config.go
54
config.go
@@ -1,39 +1,20 @@
|
|||||||
package wails
|
package wails
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
|
||||||
"net/url"
|
|
||||||
"strings"
|
|
||||||
|
|
||||||
"github.com/leaanthony/mewn"
|
"github.com/leaanthony/mewn"
|
||||||
"github.com/wailsapp/wails/runtime"
|
"github.com/wailsapp/wails/runtime"
|
||||||
)
|
)
|
||||||
|
|
||||||
// AppConfig is the configuration structure used when creating a Wails App object
|
// AppConfig is the configuration structure used when creating a Wails App object
|
||||||
type AppConfig struct {
|
type AppConfig struct {
|
||||||
// The width and height of your application in pixels
|
Width, Height int
|
||||||
Width, Height int
|
Title string
|
||||||
|
defaultHTML string
|
||||||
// The title to put in the title bar
|
HTML string
|
||||||
Title string
|
JS string
|
||||||
|
CSS string
|
||||||
// The HTML your app should use. If you leave it blank, a default will be used:
|
Colour string
|
||||||
// <!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta http-equiv="IE=edge" content="IE=edge"></head><body><div id="app"></div><script type="text/javascript"></script></body></html>
|
Resizable bool
|
||||||
HTML string
|
|
||||||
|
|
||||||
// The Javascript your app should use. Normally this should be generated by a bundler.
|
|
||||||
JS string
|
|
||||||
|
|
||||||
// The CSS your app should use. Normally this should be generated by a bundler.
|
|
||||||
CSS string
|
|
||||||
|
|
||||||
// The colour of your window. Can take "#fff", "rgb(255,255,255)", "rgba(255,255,255,1)" formats
|
|
||||||
Colour string
|
|
||||||
|
|
||||||
// Indicates whether your app should be resizable
|
|
||||||
Resizable bool
|
|
||||||
|
|
||||||
// Indicated if the devtools should be disabled
|
|
||||||
DisableInspector bool
|
DisableInspector bool
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -52,14 +33,9 @@ func (a *AppConfig) GetTitle() string {
|
|||||||
return a.Title
|
return a.Title
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetHTML returns the default HTML
|
// GetDefaultHTML returns the default HTML
|
||||||
func (a *AppConfig) GetHTML() string {
|
func (a *AppConfig) GetDefaultHTML() string {
|
||||||
if len(a.HTML) > 0 {
|
return a.defaultHTML
|
||||||
a.HTML = url.QueryEscape(a.HTML)
|
|
||||||
a.HTML = "data:text/html," + strings.ReplaceAll(a.HTML, "+", "%20")
|
|
||||||
a.HTML = strings.ReplaceAll(a.HTML, "%3D", "=")
|
|
||||||
}
|
|
||||||
return a.HTML
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetResizable returns true if the window should be resizable
|
// GetResizable returns true if the window should be resizable
|
||||||
@@ -103,10 +79,6 @@ func (a *AppConfig) merge(in *AppConfig) error {
|
|||||||
a.JS = in.JS
|
a.JS = in.JS
|
||||||
}
|
}
|
||||||
|
|
||||||
if in.HTML != "" {
|
|
||||||
a.HTML = in.HTML
|
|
||||||
}
|
|
||||||
|
|
||||||
if in.Width != 0 {
|
if in.Width != 0 {
|
||||||
a.Width = in.Width
|
a.Width = in.Width
|
||||||
}
|
}
|
||||||
@@ -137,9 +109,5 @@ func newConfig(userConfig *AppConfig) (*AppConfig, error) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
println("****************************************************")
|
|
||||||
fmt.Printf("%+v\n", result)
|
|
||||||
println("****************************************************")
|
|
||||||
|
|
||||||
return result, nil
|
return result, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,9 +6,9 @@ type AppConfig interface {
|
|||||||
GetHeight() int
|
GetHeight() int
|
||||||
GetTitle() string
|
GetTitle() string
|
||||||
GetResizable() bool
|
GetResizable() bool
|
||||||
GetHTML() string
|
GetDefaultHTML() string
|
||||||
GetDisableInspector() bool
|
GetDisableInspector() bool
|
||||||
GetColour() string
|
GetColour() string
|
||||||
GetCSS() string
|
GetCSS() string
|
||||||
GetJS() string
|
GetJS() string
|
||||||
}
|
}
|
||||||
@@ -58,7 +58,7 @@ func (w *WebView) Initialise(config interfaces.AppConfig, ipc interfaces.IPCMana
|
|||||||
Height: config.GetHeight(),
|
Height: config.GetHeight(),
|
||||||
Title: config.GetTitle(),
|
Title: config.GetTitle(),
|
||||||
Resizable: config.GetResizable(),
|
Resizable: config.GetResizable(),
|
||||||
URL: config.GetHTML(),
|
URL: config.GetDefaultHTML(),
|
||||||
Debug: !config.GetDisableInspector(),
|
Debug: !config.GetDisableInspector(),
|
||||||
ExternalInvokeCallback: func(_ wv.WebView, message string) {
|
ExternalInvokeCallback: func(_ wv.WebView, message string) {
|
||||||
w.ipc.Dispatch(message, w.callback)
|
w.ipc.Dispatch(message, w.callback)
|
||||||
|
|||||||
Reference in New Issue
Block a user