Compare commits
2 commits
5523738dc5
...
fdad635b10
| Author | SHA1 | Date | |
|---|---|---|---|
| fdad635b10 | |||
| 299a2dcf85 |
3 changed files with 7 additions and 7 deletions
|
|
@ -321,14 +321,9 @@ PluginComponent {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// propagateComposedEvents: true so that right-clicks both trigger our context menu
|
|
||||||
// *and* bubble to any parent MouseArea (e.g. for shell-level drag handling).
|
|
||||||
// Documented because the default (false) is far more common and this choice
|
|
||||||
// frequently surprises future maintainers.
|
|
||||||
MouseArea {
|
MouseArea {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
acceptedButtons: Qt.RightButton
|
acceptedButtons: Qt.RightButton
|
||||||
propagateComposedEvents: true
|
|
||||||
onClicked: {
|
onClicked: {
|
||||||
root.toggleTailscale()
|
root.toggleTailscale()
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
function parsePeers(peerMap) {
|
function parsePeers(peerMap) {
|
||||||
if (!peerMap) return []
|
if (!peerMap) return []
|
||||||
return Object.keys(peerMap).map(function (key) {
|
return Object.keys(peerMap).map(function (key) {
|
||||||
|
if (!Object.prototype.hasOwnProperty.call(peerMap, key)) return null
|
||||||
var p = peerMap[key]
|
var p = peerMap[key]
|
||||||
return {
|
return {
|
||||||
hostname: p.HostName || key,
|
hostname: p.HostName || key,
|
||||||
|
|
@ -8,16 +9,20 @@ function parsePeers(peerMap) {
|
||||||
online: p.Online || false,
|
online: p.Online || false,
|
||||||
exitNode: p.ExitNodeOption || false
|
exitNode: p.ExitNodeOption || false
|
||||||
}
|
}
|
||||||
})
|
}).filter(function (peer) { return peer !== null })
|
||||||
}
|
}
|
||||||
|
|
||||||
function makeExitNodeCommand(hostname) {
|
function makeExitNodeCommand(hostname) {
|
||||||
|
if (hostname === "") {
|
||||||
|
return ["tailscale", "set", "--exit-node="]
|
||||||
|
}
|
||||||
return ["tailscale", "set", "--exit-node=" + hostname]
|
return ["tailscale", "set", "--exit-node=" + hostname]
|
||||||
}
|
}
|
||||||
|
|
||||||
function findActiveExitNode(peerMap) {
|
function findActiveExitNode(peerMap) {
|
||||||
if (!peerMap) return ""
|
if (!peerMap) return ""
|
||||||
for (const key in peerMap) {
|
for (const key in peerMap) {
|
||||||
|
if (!Object.prototype.hasOwnProperty.call(peerMap, key)) continue
|
||||||
const p = peerMap[key]
|
const p = peerMap[key]
|
||||||
if (p.ExitNode) {
|
if (p.ExitNode) {
|
||||||
return p.HostName || key
|
return p.HostName || key
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
"name": "Tailscale",
|
"name": "Tailscale",
|
||||||
"description": "Tailscale status and controls on the Dank Bar",
|
"description": "Tailscale status and controls on the Dank Bar",
|
||||||
"version": "0.1.0",
|
"version": "0.1.0",
|
||||||
"author": "John Morris & Vybe (AI Slop... er... Coding Assistant)",
|
"author": "John Morris",
|
||||||
"icon": "vpn_key",
|
"icon": "vpn_key",
|
||||||
"type": "widget",
|
"type": "widget",
|
||||||
"component": "./TailscaleWidget.qml",
|
"component": "./TailscaleWidget.qml",
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue