Show the URL to the debug interface
This commit is contained in:
parent
b22e1f9110
commit
34d1e08aa8
@ -100,24 +100,19 @@ SettingsPageBase {
|
|||||||
text: qsTr("Please enable the web server to be accessed on this address.")
|
text: qsTr("Please enable the web server to be accessed on this address.")
|
||||||
wrapMode: Text.WordWrap
|
wrapMode: Text.WordWrap
|
||||||
font.pixelSize: app.smallFont
|
font.pixelSize: app.smallFont
|
||||||
visible: engine.nymeaConfiguration.webServerConfigurations.count > 0 && root.usedConfig === null
|
visible: engine.nymeaConfiguration.webServerConfigurations.count > 0 && root.usedConfig == null
|
||||||
}
|
}
|
||||||
|
|
||||||
Button {
|
Label {
|
||||||
id: debugServerButton
|
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.margins: app.margins
|
Layout.margins: Style.margins
|
||||||
visible: debugServerEnabledSwitch.checked
|
wrapMode: Text.WordWrap
|
||||||
enabled: root.usedConfig !== null && engine.nymeaConfiguration.webServerConfigurations.count > 0
|
visible: debugServerEnabledSwitch.checked && root.usedConfig != null
|
||||||
text: qsTr("Open debug interface")
|
text: {
|
||||||
onClicked: {
|
|
||||||
print("opening:", engine.jsonRpcClient.currentConnection.url)
|
|
||||||
|
|
||||||
var proto = "http" + (root.usedConfig.sslEnabled ? "s" : "") + "://"
|
var proto = "http" + (root.usedConfig.sslEnabled ? "s" : "") + "://"
|
||||||
var path = engine.jsonRpcClient.currentConnection.hostAddress + ":" + root.usedConfig.port + "/debug"
|
var path = engine.jsonRpcClient.currentConnection.hostAddress + ":" + root.usedConfig.port + "/debug"
|
||||||
print("opening:", proto + path)
|
return qsTr("Debug interface active at %1.").arg('<a href="' + proto + path + '">' + proto + path + '</a>')
|
||||||
Qt.openUrlExternally(proto + path)
|
|
||||||
}
|
}
|
||||||
|
onLinkActivated: Qt.openUrlExternally(link)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user