diff --git a/tailscalectl/TailscaleWidget.qml b/tailscalectl/TailscaleWidget.qml index 016c138..28cd499 100644 --- a/tailscalectl/TailscaleWidget.qml +++ b/tailscalectl/TailscaleWidget.qml @@ -47,8 +47,8 @@ PluginComponent { root.isConnected = data.BackendState === "Running" root.tailscaleIP = (data.Self?.TailscaleIPs?.[0]) || "" root.currentExitNode = data.CurrentExitNode?.HostName || "" - root.peers = Object.keys(data.Peers || {}).map(function(key) { - var p = data.Peers[key] + root.peers = Object.keys(data.Peer || {}).map(function(key) { + var p = data.Peer[key] return { hostname: p.HostName || key, ip: (p.TailscaleIPs && p.TailscaleIPs.length) ? p.TailscaleIPs[0] : "", @@ -84,11 +84,6 @@ PluginComponent { toggleProcess.running = true } - function copyToClipboard(text) { - Quickshell.execDetached(["sh", "-c", "echo -n '" + text + "' | wl-copy"]) - ToastService.showInfo("tailscalectl", "Copied: " + text) - } - popoutContent: Component { PopoutComponent { headerText: "Tailscale" @@ -166,40 +161,16 @@ PluginComponent { spacing: Theme.spacingS anchors.verticalCenter: parent.verticalCenter - MouseArea { - cursorShape: Qt.PointingHandCursor - hoverEnabled: true - anchors.verticalCenter: parent.verticalCenter - width: peerHostnameText.implicitWidth - height: peerHostnameText.implicitHeight - onClicked: { - root.copyToClipboard(modelData.hostname) - } - - StyledText { - id: peerHostnameText - text: modelData.hostname - font.pixelSize: Theme.fontSizeSmall - color: modelData.online ? Theme.primary : Theme.surfaceVariantText - } + StyledText { + text: modelData.hostname + font.pixelSize: Theme.fontSizeSmall + color: modelData.online ? Theme.primary : Theme.surfaceVariantText } - MouseArea { - cursorShape: Qt.PointingHandCursor - hoverEnabled: true - anchors.verticalCenter: parent.verticalCenter - width: peerIpText.implicitWidth - height: peerIpText.implicitHeight - onClicked: { - root.copyToClipboard(modelData.ip) - } - - StyledText { - id: peerIpText - text: modelData.ip - font.pixelSize: Theme.fontSizeSmall - color: Theme.surfaceVariantText - } + StyledText { + text: modelData.ip + font.pixelSize: Theme.fontSizeSmall + color: Theme.surfaceVariantText } } }