1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-04-04 04:42:05 -04:00
Files
Jonas Bloch b0da45d6d0 Wifi QR code generation (requires testing) (#1794)
* fix: add mockery v2 to nix flake pkgs

* feat: add requests for generating wifi qr codes as png files in /tmp, and to delete them later. only supports NetworkManager backend for now.

* feat: add modal for sharing wifi via qr code and saving the code as png file.

* fix: uncomment QR code file deletion

* network: light refactor and cleanup for QR code generation

---------

Co-authored-by: bbedward <bbedward@gmail.com>
2026-02-23 10:02:51 -05:00

81 lines
2.5 KiB
Go

package network
type Backend interface {
Initialize() error
Close()
GetWiFiEnabled() (bool, error)
SetWiFiEnabled(enabled bool) error
ScanWiFi() error
ScanWiFiDevice(device string) error
GetWiFiNetworkDetails(ssid string) (*NetworkInfoResponse, error)
GetWiFiQRCodeContent(ssid string) (string, error)
GetWiFiDevices() []WiFiDevice
ConnectWiFi(req ConnectionRequest) error
DisconnectWiFi() error
DisconnectWiFiDevice(device string) error
ForgetWiFiNetwork(ssid string) error
SetWiFiAutoconnect(ssid string, autoconnect bool) error
GetEthernetDevices() []EthernetDevice
GetWiredConnections() ([]WiredConnection, error)
GetWiredNetworkDetails(uuid string) (*WiredNetworkInfoResponse, error)
ConnectEthernet() error
DisconnectEthernet() error
DisconnectEthernetDevice(device string) error
ActivateWiredConnection(uuid string) error
ListVPNProfiles() ([]VPNProfile, error)
ListActiveVPN() ([]VPNActive, error)
ConnectVPN(uuidOrName string, singleActive bool) error
DisconnectVPN(uuidOrName string) error
DisconnectAllVPN() error
ClearVPNCredentials(uuidOrName string) error
ListVPNPlugins() ([]VPNPlugin, error)
ImportVPN(filePath string, name string) (*VPNImportResult, error)
GetVPNConfig(uuidOrName string) (*VPNConfig, error)
UpdateVPNConfig(uuid string, updates map[string]any) error
SetVPNCredentials(uuid string, username string, password string, save bool) error
DeleteVPN(uuidOrName string) error
GetCurrentState() (*BackendState, error)
StartMonitoring(onStateChange func()) error
StopMonitoring()
GetPromptBroker() PromptBroker
SetPromptBroker(broker PromptBroker) error
SubmitCredentials(token string, secrets map[string]string, save bool) error
CancelCredentials(token string) error
}
type BackendState struct {
Backend string
NetworkStatus NetworkStatus
EthernetIP string
EthernetDevice string
EthernetConnected bool
EthernetConnectionUuid string
EthernetDevices []EthernetDevice
WiFiIP string
WiFiDevice string
WiFiConnected bool
WiFiEnabled bool
WiFiSSID string
WiFiBSSID string
WiFiSignal uint8
WiFiNetworks []WiFiNetwork
WiFiDevices []WiFiDevice
WiredConnections []WiredConnection
VPNProfiles []VPNProfile
VPNActive []VPNActive
IsConnecting bool
ConnectingSSID string
ConnectingDevice string
IsConnectingVPN bool
ConnectingVPNUUID string
LastError string
}