diff --git a/pages/settings/PageSettingsTailscale.qml b/pages/settings/PageSettingsTailscale.qml index 0d6252dcb..8472bacd3 100644 --- a/pages/settings/PageSettingsTailscale.qml +++ b/pages/settings/PageSettingsTailscale.qml @@ -50,7 +50,7 @@ Page { property VeQuickItem hostNameItem: VeQuickItem { uid: Global.systemSettings.serviceUid + "/Settings/Services/Tailscale/Hostname" } property int connectState: stateItem.isValid ? stateItem.value : 0 - property string errorMessage: errorMessageItem.isValid && errorMessageItem.value !== "" && isEnabled ? "\n\nERROR: " + errorMessageItem.value : "" + property string errorMessage: errorMessageItem.isValid && errorMessageItem.value !== "" && isEnabled ? "ERROR: " + errorMessageItem.value : "" property string hostName: hostNameItem.isValid ? hostNameItem.value : "" property string ipV4: ipV4Item.isValid ? ipV4Item.value : "" property string ipV6: ipV6Item.isValid ? ipV6Item.value : "" @@ -61,6 +61,12 @@ Page { property bool isEnabledAndRunning: isEnabled && isRunning property bool isConnected: connectState == 100 && isEnabledAndRunning + + property string network: "Wired" + property string tech: "ethernet" + + property alias service: service.service + VeQuickItem { id: service @@ -79,19 +85,15 @@ Page { readonly property bool manual: method_ === "manual" property bool secured property bool favorite - property bool completed // Only handle changed value after component completion because otherwise may not be set correctly. // onValueChanged: if (completed) parseJson() Component.onCompleted: { - completed = true parseJson() - if (root._wifi) { - setAgent("on") - } } function parseJson() { + if (!isValid || typeof value !== "string") { return } @@ -127,8 +129,9 @@ Page { secured = details["Secured"] === "yes" favorite = details["Favorite"] === "yes" - subnet = calculateSubnetFromNetmask(ipAddress, netmask) - console.log("Subnet: " + subnet) + // make subnet available outside of this function + root.subnet = calculateSubnetFromNetmask(ipAddress, netmask) + console.log("Subnet: " + root.subnet) } } } @@ -200,9 +203,9 @@ Page { //% "" //text: qsTrId("settings_tailscale_") // NOTE: maybe put this in a separate page to not distract unexpected users - text: "Tailscale is a VPN solution that is based on Wireguard, a fast, modern and secure VPN solution. Enabling Tailscale on a GX device offers remote access to the GX as well as other devices in the same network. A few examples:\n - - Remotely access all ports on the GX device (HTTP, SSH, Modbus TCP, etc.)\n - - Remotely access all ports on other devices in the same network (Web control panel, SSH, Modbus TCP, etc.)" + text: "Tailscale is a VPN solution that is based on Wireguard, a fast, modern and secure VPN solution. Enabling Tailscale on a GX device offers remote access to the GX as well as other devices in the same network. A few examples:\n" + + "- Remotely access all ports on the GX device (HTTP, SSH, Modbus TCP, etc.)\n" + + "- Remotely access all ports on other devices in the same network (Web control panel, SSH, Modbus TCP, etc.)" allowed: VenusOS.User_AccessType_Installer } @@ -340,10 +343,10 @@ Page { color: Theme.color_font_secondary //% "" // text: qsTrId("settings_tailscale_") - text: "Expose physical subnet routes to your entire Tailscale network. Separate multiple IP/subnets by comma.\n - Enter \"" + subnet + "\" to be able to access your local network via Tailscale.\n - \n - NOTE: If you haven't enabled \"autoApprovers\" in the Tailscale admin console, then you need to manually approve the route in the Tailscale admin console. See https://tailscale.com/kb/1019/subnets -> Enable subnet routes from the admin console" + text: "Expose physical subnet routes to your entire Tailscale network. Separate multiple IP/subnets by comma.\n" + + "Enter \"" + service.subnet + "\" to be able to access your local network via Tailscale.\n" + + "\n" + + "NOTE: If you haven't enabled \"autoApprovers\" in the Tailscale admin console, then you need to manually approve the route in the Tailscale admin console. See https://tailscale.com/kb/1019/subnets -> Enable subnet routes from the admin console" } enabled: ! isEnabled