mirror of
https://github.com/wailsapp/wails.git
synced 2026-03-16 15:45:50 +01:00
* feat(v3): add server mode for headless HTTP deployment Server mode allows Wails applications to run as pure HTTP servers without native GUI dependencies. Enable with `-tags server` build tag. Features: - HTTP server with configurable host/port via ServerOptions - WAILS_SERVER_HOST and WAILS_SERVER_PORT env var overrides - WebSocket event broadcasting to connected browsers - Browser clients represented as BrowserWindow (Window interface) - Health check endpoint at /health - Graceful shutdown with configurable timeout - Docker support with Dockerfile.server template and tasks Build and run: wails3 task build:server wails3 task run:server wails3 task build:docker wails3 task run:docker Documentation at docs/guides/server-build.mdx Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * feat(v3): add server mode for headless HTTP deployment Server mode allows Wails applications to run as pure HTTP servers without native GUI dependencies. Enable with `-tags server` build tag. Features: - HTTP server with configurable host/port via ServerOptions - WAILS_SERVER_HOST and WAILS_SERVER_PORT env var overrides - WebSocket event broadcasting to connected browsers - Browser clients represented as BrowserWindow (Window interface) - Health check endpoint at /health - Graceful shutdown with configurable timeout - Docker support with Dockerfile.server template and tasks Build and run: wails3 task build:server wails3 task run:server wails3 task build:docker wails3 task run:docker Documentation at docs/guides/server-build.mdx Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * fix: address CodeRabbit review comments - Fix corrupted test file with embedded terminal output - Fix module name mismatch in gin-routing (was gin-example) - Fix replace directive version mismatch in gin-service - Fix placeholder module name in ios example (was changeme) - Fix Dockerfile COPY path to work from both build contexts - Fix bare URL in README (MD034 compliance) - Fix comment accuracy in getScreens (returns error, not empty slice) - Remove deprecated docker-compose version field - Add port documentation in Taskfile template Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * fix: address CodeRabbit review comments - Add note about healthcheck wget not being available in distroless images - Add !server build constraint to menu_windows.go and menu_darwin.go - Downgrade window-visibility-test go.mod from 1.25 to 1.24 to match CI Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
87 lines
1.8 KiB
Go
87 lines
1.8 KiB
Go
//go:build linux && !android && !server
|
|
|
|
package application
|
|
|
|
func (a *linuxApp) showAboutDialog(title string, message string, icon []byte) {
|
|
window, _ := globalApplication.Window.GetByID(a.getCurrentWindowID())
|
|
var parent uintptr
|
|
if window != nil {
|
|
nativeWindow := window.NativeWindow()
|
|
if nativeWindow != nil {
|
|
parent = uintptr(nativeWindow)
|
|
}
|
|
}
|
|
about := newMessageDialog(InfoDialogType)
|
|
about.SetTitle(title).
|
|
SetMessage(message).
|
|
SetIcon(icon)
|
|
InvokeAsync(func() {
|
|
runQuestionDialog(
|
|
pointer(parent),
|
|
about,
|
|
)
|
|
})
|
|
}
|
|
|
|
type linuxDialog struct {
|
|
dialog *MessageDialog
|
|
}
|
|
|
|
func (m *linuxDialog) show() {
|
|
windowId := getNativeApplication().getCurrentWindowID()
|
|
window, _ := globalApplication.Window.GetByID(windowId)
|
|
var parent uintptr
|
|
if window != nil {
|
|
nativeWindow := window.NativeWindow()
|
|
if nativeWindow != nil {
|
|
parent = uintptr(nativeWindow)
|
|
}
|
|
}
|
|
|
|
InvokeAsync(func() {
|
|
response := runQuestionDialog(pointer(parent), m.dialog)
|
|
if response >= 0 && response < len(m.dialog.Buttons) {
|
|
button := m.dialog.Buttons[response]
|
|
if button.Callback != nil {
|
|
go func() {
|
|
defer handlePanic()
|
|
button.Callback()
|
|
}()
|
|
}
|
|
}
|
|
})
|
|
}
|
|
|
|
func newDialogImpl(d *MessageDialog) *linuxDialog {
|
|
return &linuxDialog{
|
|
dialog: d,
|
|
}
|
|
}
|
|
|
|
type linuxOpenFileDialog struct {
|
|
dialog *OpenFileDialogStruct
|
|
}
|
|
|
|
func newOpenFileDialogImpl(d *OpenFileDialogStruct) *linuxOpenFileDialog {
|
|
return &linuxOpenFileDialog{
|
|
dialog: d,
|
|
}
|
|
}
|
|
|
|
func (m *linuxOpenFileDialog) show() (chan string, error) {
|
|
return runOpenFileDialog(m.dialog)
|
|
}
|
|
|
|
type linuxSaveFileDialog struct {
|
|
dialog *SaveFileDialogStruct
|
|
}
|
|
|
|
func newSaveFileDialogImpl(d *SaveFileDialogStruct) *linuxSaveFileDialog {
|
|
return &linuxSaveFileDialog{
|
|
dialog: d,
|
|
}
|
|
}
|
|
|
|
func (m *linuxSaveFileDialog) show() (chan string, error) {
|
|
return runSaveFileDialog(m.dialog)
|
|
}
|