From 34d1e08aa8c5fc17218e90ff0ce05d1ea6f6f3cf Mon Sep 17 00:00:00 2001 From: Michael Zanetti Date: Wed, 18 Aug 2021 16:45:23 +0200 Subject: [PATCH] Show the URL to the debug interface --- nymea-app/ui/system/DeveloperTools.qml | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/nymea-app/ui/system/DeveloperTools.qml b/nymea-app/ui/system/DeveloperTools.qml index 618e8d21..53e9cabf 100644 --- a/nymea-app/ui/system/DeveloperTools.qml +++ b/nymea-app/ui/system/DeveloperTools.qml @@ -100,24 +100,19 @@ SettingsPageBase { text: qsTr("Please enable the web server to be accessed on this address.") wrapMode: Text.WordWrap font.pixelSize: app.smallFont - visible: engine.nymeaConfiguration.webServerConfigurations.count > 0 && root.usedConfig === null + visible: engine.nymeaConfiguration.webServerConfigurations.count > 0 && root.usedConfig == null } - Button { - id: debugServerButton + Label { Layout.fillWidth: true - Layout.margins: app.margins - visible: debugServerEnabledSwitch.checked - enabled: root.usedConfig !== null && engine.nymeaConfiguration.webServerConfigurations.count > 0 - text: qsTr("Open debug interface") - onClicked: { - print("opening:", engine.jsonRpcClient.currentConnection.url) - + Layout.margins: Style.margins + wrapMode: Text.WordWrap + visible: debugServerEnabledSwitch.checked && root.usedConfig != null + text: { var proto = "http" + (root.usedConfig.sslEnabled ? "s" : "") + "://" var path = engine.jsonRpcClient.currentConnection.hostAddress + ":" + root.usedConfig.port + "/debug" - print("opening:", proto + path) - Qt.openUrlExternally(proto + path) + return qsTr("Debug interface active at %1.").arg('' + proto + path + '') } + onLinkActivated: Qt.openUrlExternally(link) } - }