Compare commits

..

No commits in common. "ac1669f9906e1e533d893635083d40ed4e483979" and "2227cb60fe9907cc949accd9b7b5f62172c352ee" have entirely different histories.

View file

@ -11,6 +11,7 @@ PluginComponent {
id: root id: root
property bool isConnected: false property bool isConnected: false
property bool binaryAvailable: true
property string tailscaleIP: "" property string tailscaleIP: ""
property string currentExitNode: "" property string currentExitNode: ""
property var peers: [] property var peers: []
@ -106,17 +107,30 @@ PluginComponent {
root.tailscaleIP = "" root.tailscaleIP = ""
root.currentExitNode = "" root.currentExitNode = ""
root.peers = [] root.peers = []
ToastService.showError("tailscalectl", TailscaleLib.errorMessage("status")) if (code === 127) {
root.binaryAvailable = false
ToastService.showError("tailscalectl", "Tailscale binary not found")
} else {
ToastService.showError("tailscalectl", TailscaleLib.errorMessage("status"))
}
} }
} }
} }
function toggleTailscale() { function toggleTailscale() {
if (!root.binaryAvailable) {
ToastService.showError("tailscalectl", "Tailscale not available")
return
}
toggleProcess.command = TailscaleLib.buildToggleCommand(root.isConnected) toggleProcess.command = TailscaleLib.buildToggleCommand(root.isConnected)
toggleProcess.running = true toggleProcess.running = true
} }
function setExitNode(hostname) { function setExitNode(hostname) {
if (!root.binaryAvailable) {
ToastService.showError("tailscalectl", "Tailscale not available")
return
}
exitNodeProcess.command = TailscaleLib.makeExitNodeCommand(hostname) exitNodeProcess.command = TailscaleLib.makeExitNodeCommand(hostname)
exitNodeProcess.running = true exitNodeProcess.running = true
} }
@ -153,6 +167,14 @@ PluginComponent {
width: parent.width width: parent.width
height: Theme.spacingM + statusRow.implicitHeight + Theme.spacingM + peerList.height + Theme.spacingM height: Theme.spacingM + statusRow.implicitHeight + Theme.spacingM + peerList.height + Theme.spacingM
StyledText {
visible: !root.binaryAvailable
text: "Tailscale not available"
anchors.centerIn: parent
font.pixelSize: Theme.fontSizeSmall
color: Theme.surfaceVariantText
}
Row { Row {
id: statusRow id: statusRow
y: Theme.spacingM y: Theme.spacingM