Make tunnelProxy url and port configurable
Signed-off-by: Martin Lukas <martin.lukas@chargebyte.com>
This commit is contained in:
parent
38f334f5ab
commit
5950a2325d
@ -19,6 +19,7 @@ ConfigurationBase {
|
|||||||
modbusSettingsEnabled: true
|
modbusSettingsEnabled: true
|
||||||
pluginSettingsEnabled: true
|
pluginSettingsEnabled: true
|
||||||
|
|
||||||
|
tunnelProxyUrl: "tunnelproxy.nymea.io"
|
||||||
|
|
||||||
mainMenuLinks: [
|
mainMenuLinks: [
|
||||||
{
|
{
|
||||||
|
|||||||
@ -9,6 +9,9 @@ Item {
|
|||||||
|
|
||||||
property string connectionWizard: ""
|
property string connectionWizard: ""
|
||||||
|
|
||||||
|
property string tunnelProxyUrl: ""
|
||||||
|
property int tunnelProxyPort: 2213
|
||||||
|
|
||||||
// Enable/disable certain features
|
// Enable/disable certain features
|
||||||
property bool magicEnabled: false
|
property bool magicEnabled: false
|
||||||
property bool networkSettingsEnabled: false
|
property bool networkSettingsEnabled: false
|
||||||
|
|||||||
@ -69,7 +69,7 @@ ColumnLayout {
|
|||||||
id: addressTextInput
|
id: addressTextInput
|
||||||
objectName: "addressTextInput"
|
objectName: "addressTextInput"
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
placeholderText: connectionTypeComboBox.currentIndex < 2 ? "127.0.0.1" : "tunnelproxy.nymea.io"
|
placeholderText: connectionTypeComboBox.currentIndex < 2 ? "127.0.0.1" : Configuration.tunnelProxyUrl
|
||||||
}
|
}
|
||||||
|
|
||||||
Label {
|
Label {
|
||||||
@ -89,7 +89,7 @@ ColumnLayout {
|
|||||||
? "2222"
|
? "2222"
|
||||||
: connectionTypeComboBox.currentIndex == 1
|
: connectionTypeComboBox.currentIndex == 1
|
||||||
? "4444"
|
? "4444"
|
||||||
: "2213"
|
: Configuration.tunnelProxyPort
|
||||||
validator: IntValidator{bottom: 1; top: 65535;}
|
validator: IntValidator{bottom: 1; top: 65535;}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -173,7 +173,7 @@ SettingsPageBase {
|
|||||||
text: qsTr("Add")
|
text: qsTr("Add")
|
||||||
visible: engine.jsonRpcClient.ensureServerVersion("6.0")
|
visible: engine.jsonRpcClient.ensureServerVersion("6.0")
|
||||||
onClicked: {
|
onClicked: {
|
||||||
var config = engine.nymeaConfiguration.createTunnelProxyServerConfiguration("tunnelproxy.nymea.io", 2213, true, true, false);
|
var config = engine.nymeaConfiguration.createTunnelProxyServerConfiguration(Configuration.tunnelProxyUrl, Configuration.tunnelProxyPort, true, true, false);
|
||||||
var component = Qt.createComponent(Qt.resolvedUrl("TunnelProxyServerConfigurationDialog.qml"));
|
var component = Qt.createComponent(Qt.resolvedUrl("TunnelProxyServerConfigurationDialog.qml"));
|
||||||
var popup = component.createObject(root, { serverConfiguration: config });
|
var popup = component.createObject(root, { serverConfiguration: config });
|
||||||
popup.accepted.connect(function() {
|
popup.accepted.connect(function() {
|
||||||
|
|||||||
@ -60,7 +60,7 @@ SettingsPageBase {
|
|||||||
engine.nymeaConfiguration.deleteTunnelProxyServerConfiguration(config.id)
|
engine.nymeaConfiguration.deleteTunnelProxyServerConfiguration(config.id)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
var config = engine.nymeaConfiguration.createTunnelProxyServerConfiguration("tunnelproxy.nymea.io", 2213, true, true, false);
|
var config = engine.nymeaConfiguration.createTunnelProxyServerConfiguration(Configuration.tunnelProxyUrl, Configuration.tunnelProxyPort, true, true, false);
|
||||||
engine.nymeaConfiguration.setTunnelProxyServerConfiguration(config)
|
engine.nymeaConfiguration.setTunnelProxyServerConfiguration(config)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user