vpn mode to eww

This commit is contained in:
sora committed 2026-11-01 12:12:59 +01:00
1 parent 086d8651ff
commit 9a99024688
6 files changed
+90 -16

No files matched your search

@@ -96,12 +96,19 @@
(box :orientation "v" :space-evenly false :class "wg-row"
(box :orientation "h" :space-evenly false :valign "center"
(label :class "wg-name ${wg.up ? 'wg-up' : 'wg-down'}" :halign "start" :hexpand true :text {wg.name})
(button
:class "net-toggle-btn net-add-btn ${wg.vpn ? 'net-toggle-on' : 'net-toggle-off'}"
:visible {wg.vpn_able}
:onclick "scripts/net/wg-vpn-toggle ${wg.name}"
:tooltip {wg.vpn ? "VPN: all traffic through ${wg.name}" : "VPN off: only the private subnet"}
(label :text "󰖟"))
(button
:class "net-toggle-btn ${wg.up ? 'net-toggle-on' : 'net-toggle-off'}"
:onclick "scripts/net/wg-toggle ${wg.name}"
:tooltip {wg.up ? "Disconnect" : "Connect"}
(label :text {wg.up ? "󰖂" : "󰦞"})))
(box :orientation "v" :space-evenly false :visible {wg.up}
(netinfo-row :label "Routing" :value {wg.vpn ? "All traffic" : "Private subnet"})
(netinfo-row :label "IP" :value {wg.ip})
(netinfo-row :label "Peer" :value {wg.endpoint != "" ? "${wg.peers} · ${wg.endpoint}" : wg.peers})
(netinfo-row :label "Traffic" :value "󰇚 ${wg.rx} 󰕒 ${wg.tx}"))