Skip to content

Commit

Permalink
wails: less parameters to try |readme: friendly one ❤️
Browse files Browse the repository at this point in the history
  • Loading branch information
guiklimek committed Jan 31, 2024
1 parent 0a9c08f commit a86df42
Show file tree
Hide file tree
Showing 4 changed files with 108 additions and 97 deletions.
15 changes: 12 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@

TODO add screenshot

## 1. Installation
## 1. Installation ⚙️

- **Windows**:
- **MacOS**:
- **Linux**:

## 2. Usage
## 2. Usage 📚

Prepare your server authentication with the **MQTT Information** panel. Possibly in TLS.
Then connect, get a success notification and starts to receive messages. They hydrate the **Messages** and the **Topics
Expand Down Expand Up @@ -71,7 +71,7 @@ customizable:

Then lock it again, in order to use the software. It's saved automatically.

## 3. Technical Stack
## 3. Technical Stack 🤓

Thank you all for the beautiful technologies:

Expand All @@ -98,3 +98,12 @@ Thank you all for the beautiful technologies:
- [GitHub](https://github.com) for the nice pace
- [JetBrains](https://www.jetbrains.com/) for the Rock Star IDE's
- and many others 🙏

## 4. Sponsors ❤️

If you like this project or if you wish more [Ambre.io](https://ambre.io/) open sourced projects,
please consider:
- Become an Ambre.io Sponsor via GitHub (demand in progress)
- Become an Ambre.io Subscriber via [Patreon](patreon.com/user?u=117579457)

Thank you for your time and your energy here. Appreciate it.
3 changes: 3 additions & 0 deletions sparkplugui/frontend/wailsjs/go/core/App.d.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
// This file is automatically generated. DO NOT EDIT
import {core} from '../models';
import {context} from '../models';

export function CmdConnect(arg1:core.MQTTSetup):Promise<boolean>;

export function CmdDisconnect():Promise<boolean>;

export function EvtPayload():Promise<core.MQTTMessage>;

export function Startup(arg1:context.Context):Promise<void>;
4 changes: 4 additions & 0 deletions sparkplugui/frontend/wailsjs/go/core/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,7 @@ export function CmdDisconnect() {
export function EvtPayload() {
return window['go']['core']['App']['EvtPayload']();
}

export function Startup(arg1) {
return window['go']['core']['App']['Startup'](arg1);
}
183 changes: 89 additions & 94 deletions sparkplugui/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,7 @@ package main

import (
"embed"
"github.com/wailsapp/wails/v2/pkg/logger"
"github.com/wailsapp/wails/v2/pkg/options/linux"
"github.com/wailsapp/wails/v2/pkg/options/mac"
"github.com/wailsapp/wails/v2/pkg/options/windows"
"net/http"
"os"
"sparkplugui/backend/core"

"github.com/wailsapp/wails/v2"
Expand Down Expand Up @@ -55,100 +50,100 @@ func main() {
// Create application with options
// see: https://wails.io/docs/reference/options/#application-options
err := wails.Run(&options.App{
Title: "SparkpluGUI",
Width: popWindowWidth,
Height: popWindowHeight,
DisableResize: false,
Fullscreen: false,
WindowStartState: options.Normal,
Frameless: false, // top bar disapear if true, but it's needed to drag the soft
MinWidth: minWindowWidth,
MinHeight: minWindowHeight,
MaxWidth: maxWindowWidth,
MaxHeight: maxWindowHeight,
StartHidden: false,
HideWindowOnClose: false,
BackgroundColour: &options.RGBA{R: 0, G: 0, B: 0, A: 255},
//AlwaysOnTop: false,
Title: "SparkpluGUI",
Width: popWindowWidth,
Height: popWindowHeight,
DisableResize: false,
Fullscreen: false,
WindowStartState: options.Normal,
Frameless: false, // top bar disapear if true, but it's needed to drag the soft
MinWidth: minWindowWidth,
MinHeight: minWindowHeight,
MaxWidth: maxWindowWidth,
MaxHeight: maxWindowHeight,
StartHidden: false,
//HideWindowOnClose: false,
//BackgroundColour: &options.RGBA{R: 0, G: 0, B: 0, A: 255},
////AlwaysOnTop: false,
AssetServer: &assetserver.Options{
Assets: assets,
Handler: assetsHandler,
Middleware: assetsMidldeware,
Assets: assets,
//Handler: assetsHandler,
//Middleware: assetsMidldeware,
},
//Menu: app.applicationMenu(),
LogLevel: logger.DEBUG,
LogLevelProduction: logger.ERROR,
OnStartup: app.Startup,
//OnDomReady: app.domready,
//OnShutdown: app.shutdown,
//OnBeforeClose: app.beforeClose,
CSSDragProperty: "--wails-draggable",
CSSDragValue: "drag",
EnableDefaultContextMenu: false,
EnableFraudulentWebsiteDetection: false,
////Menu: app.applicationMenu(),
//LogLevel: logger.DEBUG,
//LogLevelProduction: logger.ERROR,
//OnStartup: app.Startup,
////OnDomReady: app.domready,
////OnShutdown: app.shutdown,
////OnBeforeClose: app.beforeClose,
//CSSDragProperty: "--wails-draggable",
//CSSDragValue: "drag",
//EnableDefaultContextMenu: false,
//EnableFraudulentWebsiteDetection: false,
Bind: []interface{}{
app,
},
//EnumBind: []interface{}{}, // A slice of Enum arrays that need to be bound to the frontend.
ErrorFormatter: func(err error) any { return err.Error() },
SingleInstanceLock: &options.SingleInstanceLock{
UniqueId: "c9c8fd93-6758-4144-87d1-34bdb0a8bd60",
OnSecondInstanceLaunch: func(secondInstanceData options.SecondInstanceData) { os.Exit(0) },
},
Windows: &windows.Options{
WebviewIsTransparent: false,
WindowIsTranslucent: false,
BackdropType: windows.None,
DisableWindowIcon: false,
DisableFramelessWindowDecorations: false,
WebviewUserDataPath: "",
WebviewBrowserPath: "",
Theme: windows.SystemDefault,
CustomTheme: &windows.ThemeSettings{
DarkModeTitleBar: windows.RGB(20, 20, 20),
DarkModeTitleText: windows.RGB(200, 200, 200),
DarkModeBorder: windows.RGB(20, 0, 20),
LightModeTitleBar: windows.RGB(200, 200, 200),
LightModeTitleText: windows.RGB(20, 20, 20),
LightModeBorder: windows.RGB(200, 200, 200),
},
// User messages that can be customised
//Messages *windows.Messages
// OnSuspend is called when Windows enters low power mode
//OnSuspend func()
// OnResume is called when Windows resumes from low power mode
//OnResume func(),
WebviewGpuIsDisabled: false,
},
Mac: &mac.Options{
TitleBar: &mac.TitleBar{
TitlebarAppearsTransparent: true,
HideTitle: false,
HideTitleBar: false,
FullSizeContent: false,
UseToolbar: false,
HideToolbarSeparator: true,
//OnFileOpen: app.onFileOpen,
//OnUrlOpen: app.onUrlOpen,
},
Appearance: mac.DefaultAppearance,
WebviewIsTransparent: false,
WindowIsTranslucent: false,
About: &mac.AboutInfo{
Title: "SparkpluGUI",
Message: "Software that displays decoded Sparkplug messages from MQTT IoT",
Icon: icon,
},
},
Linux: &linux.Options{
Icon: icon,
WindowIsTranslucent: false,
WebviewGpuPolicy: linux.WebviewGpuPolicyAlways,
ProgramName: "SparkpluGUI",
},
Debug: options.Debug{
OpenInspectorOnStartup: false,
},
////EnumBind: []interface{}{}, // A slice of Enum arrays that need to be bound to the frontend.
//ErrorFormatter: func(err error) any { return err.Error() },
//SingleInstanceLock: &options.SingleInstanceLock{
// UniqueId: "c9c8fd93-6758-4144-87d1-34bdb0a8bd60",
// OnSecondInstanceLaunch: func(secondInstanceData options.SecondInstanceData) { os.Exit(0) },
//},
//Windows: &windows.Options{
// WebviewIsTransparent: false,
// WindowIsTranslucent: false,
// BackdropType: windows.None,
// DisableWindowIcon: false,
// DisableFramelessWindowDecorations: false,
// WebviewUserDataPath: "",
// WebviewBrowserPath: "",
// Theme: windows.SystemDefault,
// CustomTheme: &windows.ThemeSettings{
// DarkModeTitleBar: windows.RGB(20, 20, 20),
// DarkModeTitleText: windows.RGB(200, 200, 200),
// DarkModeBorder: windows.RGB(20, 0, 20),
// LightModeTitleBar: windows.RGB(200, 200, 200),
// LightModeTitleText: windows.RGB(20, 20, 20),
// LightModeBorder: windows.RGB(200, 200, 200),
// },
// // User messages that can be customised
// //Messages *windows.Messages
// // OnSuspend is called when Windows enters low power mode
// //OnSuspend func()
// // OnResume is called when Windows resumes from low power mode
// //OnResume func(),
// WebviewGpuIsDisabled: false,
//},
//Mac: &mac.Options{
// TitleBar: &mac.TitleBar{
// TitlebarAppearsTransparent: true,
// HideTitle: false,
// HideTitleBar: false,
// FullSizeContent: false,
// UseToolbar: false,
// HideToolbarSeparator: true,
// //OnFileOpen: app.onFileOpen,
// //OnUrlOpen: app.onUrlOpen,
// },
// Appearance: mac.DefaultAppearance,
// WebviewIsTransparent: false,
// WindowIsTranslucent: false,
// About: &mac.AboutInfo{
// Title: "SparkpluGUI",
// Message: "Software that displays decoded Sparkplug messages from MQTT IoT",
// Icon: icon,
// },
//},
//Linux: &linux.Options{
// Icon: icon,
// WindowIsTranslucent: false,
// WebviewGpuPolicy: linux.WebviewGpuPolicyAlways,
// ProgramName: "SparkpluGUI",
//},
//Debug: options.Debug{
// OpenInspectorOnStartup: false,
//},
})

if err != nil {
Expand Down

0 comments on commit a86df42

Please sign in to comment.