diff --git a/libnymea-app/configuration/serverconfigurations.cpp b/libnymea-app/configuration/serverconfigurations.cpp index 5078a9bd..37ea112d 100644 --- a/libnymea-app/configuration/serverconfigurations.cpp +++ b/libnymea-app/configuration/serverconfigurations.cpp @@ -104,6 +104,7 @@ void ServerConfigurations::removeConfiguration(const QString &id) beginRemoveRows(QModelIndex(), i, i); m_list.takeAt(i)->deleteLater(); endRemoveRows(); + emit countChanged(); return; } } diff --git a/libnymea-app/thingdiscovery.cpp b/libnymea-app/thingdiscovery.cpp index 751f793d..871474c5 100644 --- a/libnymea-app/thingdiscovery.cpp +++ b/libnymea-app/thingdiscovery.cpp @@ -166,7 +166,7 @@ QString ThingDiscovery::displayMessage() const int ThingDiscovery::discoverThingsInternal(const QUuid &thingClassId, const QVariantList &discoveryParams) { - qCDebug(dcThingManager()) << "Starting thing discovery for thing class" << m_engine->thingManager()->thingClasses()->getThingClass(thingClassId)->name() << thingClassId; + qCInfo(dcThingManager()) << "Starting thing discovery for thing class" << m_engine->thingManager()->thingClasses()->getThingClass(thingClassId)->name() << thingClassId; QVariantMap params; params.insert("thingClassId", thingClassId.toString()); if (!discoveryParams.isEmpty()) { diff --git a/nymea-app/resources.qrc b/nymea-app/resources.qrc index bf671881..9ab8a7f8 100644 --- a/nymea-app/resources.qrc +++ b/nymea-app/resources.qrc @@ -275,5 +275,6 @@ ui/system/TunnelProxyServerConfigurationDialog.qml ui/delegates/StateDelegate.qml ui/system/PackageDetailsPage.qml + ui/system/AdvancedConnectionInterfacesPage.qml diff --git a/nymea-app/translations/nymea-app-de.ts b/nymea-app/translations/nymea-app-de.ts index d97216d7..c5f4406d 100644 --- a/nymea-app/translations/nymea-app-de.ts +++ b/nymea-app/translations/nymea-app-de.ts @@ -83,6 +83,49 @@ Oswald Schrift von "The Oswald Project" + + AdvancedConnectionInterfacesPage + + Connection interfaces + Verbindungs-Schnittstellen + + + TCP server interfaces + TCP Server Schnittstellen + + + Add + Hinzufügen + + + WebSocket server interfaces + WebSocket server Schnittstellen + + + Remote connection server interfaces + Fernverbindungsschnittstellen + + + Server: %1 + Server: %1 + + + nymea:cloud + nymea:cloud + + + Note: nymea:cloud based remote connection is deprecated and will be removed in a future version. + Hinweis: Die nymea:cloud basiere Fernverbindung ist veraltet und wird in einer zukünftigen Version entfernt. + + + Cloud + Cloud + + + Connect this %1 system to %1:cloud + Verbinde dieses %1 System mit %1:cloud + + AppLogPage @@ -102,7 +145,7 @@ Cloud login - Cloud Login + Cloud Login Developer options @@ -126,7 +169,7 @@ Log into %1:cloud and manage connected %1 systems - Logge Dich in %1:cloud ein und Verwalte verbundene %1 systeme + Logge Dich in %1:cloud ein und Verwalte verbundene %1 systeme @@ -965,23 +1008,47 @@ TCP server interfaces - TCP Server Schnittstellen + TCP Server Schnittstellen Add - Hinzufügen + Hinzufügen WebSocket server interfaces - WebSocket server Schnittstellen + WebSocket server Schnittstellen Remote connection server interfaces - Fernverbindungsschnittstellen + Fernverbindungsschnittstellen Server: %1 - Server: %1 + Server: %1 + + + Connection settings + Verbindungseinstellungen + + + Remote connection + Fernverbindung + + + Enabling the remote connection will allow connecting to this %1 system from anywhere. + Das Aktivieren der Fernverbindung erlaubt von überall aus auf dieses %1 system zuzugreifen. + + + Enabled + Aktivier + + + Disabled + Deaktiviert + + + Advanced + Erweitert @@ -1339,6 +1406,22 @@ Configure logging categories Protokollkategorien einrichten + + nymea:cloud + + + + Note: nymea:cloud is deprecated and will be removed in a future version. + + + + Cloud login + Cloud Login + + + Log into %1:cloud and manage connected %1 systems + Logge Dich in %1:cloud ein und Verwalte verbundene %1 systeme + DeveloperTools @@ -5929,7 +6012,7 @@ Möchtest Du fortfahren? Cloud - Cloud + Cloud General @@ -5945,7 +6028,7 @@ Möchtest Du fortfahren? API interfaces - API Schnittstellen + API Schnittstellen MQTT broker @@ -5993,7 +6076,7 @@ Möchtest Du fortfahren? Configure how clients interact with this system - Richte ein, wie andere Geräte mit diesem System kommunizieren + Richte ein, wie andere Geräte mit diesem System kommunizieren User settings @@ -6013,7 +6096,7 @@ Möchtest Du fortfahren? Connect this %1 system to %1:cloud - Verbinde dieses %1 System mit %1:cloud + Verbinde dieses %1 System mit %1:cloud Update your %1 system @@ -6031,6 +6114,14 @@ Möchtest Du fortfahren? Configure Modbus RTU master interfaces Modbug RTU Master Schnittstellen einrichten + + Connection settings + Verbindungseinstellungen + + + Configure how applications can connect to this system + Verwalte wie sich Anwendungen zu diesem System verbinden können + SetupWizard diff --git a/nymea-app/translations/nymea-app-en.ts b/nymea-app/translations/nymea-app-en.ts index 922c835c..9798ad40 100644 --- a/nymea-app/translations/nymea-app-en.ts +++ b/nymea-app/translations/nymea-app-en.ts @@ -83,6 +83,49 @@ + + AdvancedConnectionInterfacesPage + + Connection interfaces + + + + TCP server interfaces + + + + Add + + + + WebSocket server interfaces + + + + Remote connection server interfaces + + + + Server: %1 + + + + nymea:cloud + + + + Note: nymea:cloud based remote connection is deprecated and will be removed in a future version. + + + + Cloud + + + + Connect this %1 system to %1:cloud + + + AppLogPage @@ -104,10 +147,6 @@ Customize the app's look and behavior - - Cloud login - - Developer options @@ -124,10 +163,6 @@ Access tools for debugging and error reporting - - Log into %1:cloud and manage connected %1 systems - - AwningThingsListPage @@ -890,23 +925,27 @@ - TCP server interfaces + Connection settings - Add + Remote connection - WebSocket server interfaces + Enabling the remote connection will allow connecting to this %1 system from anywhere. - Remote connection server interfaces + Enabled - Server: %1 + Disabled + + + + Advanced @@ -1265,6 +1304,22 @@ Configure logging categories + + nymea:cloud + + + + Note: nymea:cloud is deprecated and will be removed in a future version. + + + + Cloud login + + + + Log into %1:cloud and manage connected %1 systems + + DeveloperTools @@ -5731,14 +5786,6 @@ Do you want to proceed? View system log - - Cloud - - - - API interfaces - - MQTT broker @@ -5791,10 +5838,6 @@ Do you want to proceed? Configure the system's network connection - - Configure how clients interact with this system - - User settings @@ -5811,10 +5854,6 @@ Do you want to proceed? Configure ZigBee networks - - Connect this %1 system to %1:cloud - - Update your %1 system @@ -5831,6 +5870,14 @@ Do you want to proceed? Configure Modbus RTU master interfaces + + Connection settings + + + + Configure how applications can connect to this system + + SetupWizard diff --git a/nymea-app/translations/nymea-app-en_US.ts b/nymea-app/translations/nymea-app-en_US.ts index 51dc1ffe..d9ca206a 100644 --- a/nymea-app/translations/nymea-app-en_US.ts +++ b/nymea-app/translations/nymea-app-en_US.ts @@ -83,6 +83,49 @@ + + AdvancedConnectionInterfacesPage + + Connection interfaces + + + + TCP server interfaces + + + + Add + + + + WebSocket server interfaces + + + + Remote connection server interfaces + + + + Server: %1 + + + + nymea:cloud + + + + Note: nymea:cloud based remote connection is deprecated and will be removed in a future version. + + + + Cloud + + + + Connect this %1 system to %1:cloud + + + AppLogPage @@ -104,10 +147,6 @@ Customize the app's look and behavior - - Cloud login - - Developer options @@ -124,10 +163,6 @@ Access tools for debugging and error reporting - - Log into %1:cloud and manage connected %1 systems - - AwningThingsListPage @@ -890,23 +925,27 @@ - TCP server interfaces + Connection settings - Add + Remote connection - WebSocket server interfaces + Enabling the remote connection will allow connecting to this %1 system from anywhere. - Remote connection server interfaces + Enabled - Server: %1 + Disabled + + + + Advanced @@ -1265,6 +1304,22 @@ Configure logging categories + + nymea:cloud + + + + Note: nymea:cloud is deprecated and will be removed in a future version. + + + + Cloud login + + + + Log into %1:cloud and manage connected %1 systems + + DeveloperTools @@ -5731,14 +5786,6 @@ Do you want to proceed? View system log - - Cloud - - - - API interfaces - - MQTT broker @@ -5791,10 +5838,6 @@ Do you want to proceed? Configure the system's network connection - - Configure how clients interact with this system - - User settings @@ -5811,10 +5854,6 @@ Do you want to proceed? Configure ZigBee networks - - Connect this %1 system to %1:cloud - - Update your %1 system @@ -5831,6 +5870,14 @@ Do you want to proceed? Configure Modbus RTU master interfaces + + Connection settings + + + + Configure how applications can connect to this system + + SetupWizard diff --git a/nymea-app/translations/nymea-app-it.ts b/nymea-app/translations/nymea-app-it.ts index 232d81aa..cc7ba34c 100644 --- a/nymea-app/translations/nymea-app-it.ts +++ b/nymea-app/translations/nymea-app-it.ts @@ -83,6 +83,49 @@ Font Oswald di The Oswald Project + + AdvancedConnectionInterfacesPage + + Connection interfaces + + + + TCP server interfaces + + + + Add + Aggiungi + + + WebSocket server interfaces + + + + Remote connection server interfaces + + + + Server: %1 + + + + nymea:cloud + + + + Note: nymea:cloud based remote connection is deprecated and will be removed in a future version. + + + + Cloud + + + + Connect this %1 system to %1:cloud + + + AppLogPage @@ -106,7 +149,7 @@ Cloud login - Login cloud + Login cloud Developer options @@ -124,10 +167,6 @@ Access tools for debugging and error reporting Accedi a strumenti per debug e riportare errori - - Log into %1:cloud and manage connected %1 systems - - AwningThingsListPage @@ -929,23 +968,27 @@ - TCP server interfaces - - - - Add - - - - WebSocket server interfaces - - - - Remote connection server interfaces + Connection settings - Server: %1 + Remote connection + + + + Enabling the remote connection will allow connecting to this %1 system from anywhere. + + + + Enabled + + + + Disabled + + + + Advanced @@ -1304,6 +1347,22 @@ Configure logging categories + + nymea:cloud + + + + Note: nymea:cloud is deprecated and will be removed in a future version. + + + + Cloud login + Login cloud + + + Log into %1:cloud and manage connected %1 systems + + DeveloperTools @@ -5774,14 +5833,6 @@ Do you want to proceed? View system log - - Cloud - - - - API interfaces - - MQTT broker @@ -5834,10 +5885,6 @@ Do you want to proceed? Configure the system's network connection - - Configure how clients interact with this system - - User settings @@ -5854,10 +5901,6 @@ Do you want to proceed? Configure ZigBee networks - - Connect this %1 system to %1:cloud - - Update your %1 system @@ -5874,6 +5917,14 @@ Do you want to proceed? Configure Modbus RTU master interfaces + + Connection settings + + + + Configure how applications can connect to this system + + SetupWizard diff --git a/nymea-app/translations/nymea-app-ko.ts b/nymea-app/translations/nymea-app-ko.ts index 38d6dd51..a51e5d30 100644 --- a/nymea-app/translations/nymea-app-ko.ts +++ b/nymea-app/translations/nymea-app-ko.ts @@ -83,6 +83,49 @@ + + AdvancedConnectionInterfacesPage + + Connection interfaces + 연결 인터페이스 + + + TCP server interfaces + TCP 서버 인터페이스 + + + Add + 추가 + + + WebSocket server interfaces + WebSocket 서버 인터페이스 + + + Remote connection server interfaces + + + + Server: %1 + + + + nymea:cloud + + + + Note: nymea:cloud based remote connection is deprecated and will be removed in a future version. + + + + Cloud + 클라우드 + + + Connect this %1 system to %1:cloud + + + AppLogPage @@ -106,7 +149,7 @@ Cloud login - 클라우드 로그인 + 클라우드 로그인 Developer options @@ -124,10 +167,6 @@ Access tools for debugging and error reporting 디버깅 및 오류 보고를 위한 액세스 도구 - - Log into %1:cloud and manage connected %1 systems - - AwningThingsListPage @@ -933,22 +972,38 @@ TCP server interfaces - TCP 서버 인터페이스 + TCP 서버 인터페이스 Add - 추가 + 추가 WebSocket server interfaces - WebSocket 서버 인터페이스 + WebSocket 서버 인터페이스 - Remote connection server interfaces + Connection settings - Server: %1 + Remote connection + + + + Enabling the remote connection will allow connecting to this %1 system from anywhere. + + + + Enabled + + + + Disabled + + + + Advanced @@ -1307,6 +1362,22 @@ Configure logging categories + + nymea:cloud + + + + Note: nymea:cloud is deprecated and will be removed in a future version. + + + + Cloud login + 클라우드 로그인 + + + Log into %1:cloud and manage connected %1 systems + + DeveloperTools @@ -5833,11 +5904,11 @@ Do you want to proceed? Cloud - 클라우드 + 클라우드 API interfaces - API 인터페이스 + API 인터페이스 MQTT broker @@ -5893,7 +5964,7 @@ Do you want to proceed? Configure how clients interact with this system - 클라이언트가 이 시스템과 상호 작용하는 방식 구성 + 클라이언트가 이 시스템과 상호 작용하는 방식 구성 User settings @@ -5911,10 +5982,6 @@ Do you want to proceed? Configure ZigBee networks - - Connect this %1 system to %1:cloud - - Update your %1 system @@ -5931,6 +5998,14 @@ Do you want to proceed? Configure Modbus RTU master interfaces + + Connection settings + + + + Configure how applications can connect to this system + + SetupWizard diff --git a/nymea-app/translations/nymea-app-nl.ts b/nymea-app/translations/nymea-app-nl.ts index 60650c2e..825b1654 100644 --- a/nymea-app/translations/nymea-app-nl.ts +++ b/nymea-app/translations/nymea-app-nl.ts @@ -83,6 +83,49 @@ Oswald font door The Oswald Project + + AdvancedConnectionInterfacesPage + + Connection interfaces + + + + TCP server interfaces + + + + Add + + + + WebSocket server interfaces + + + + Remote connection server interfaces + + + + Server: %1 + + + + nymea:cloud + + + + Note: nymea:cloud based remote connection is deprecated and will be removed in a future version. + + + + Cloud + + + + Connect this %1 system to %1:cloud + + + AppLogPage @@ -106,7 +149,7 @@ Cloud login - Aanmelden Cloud + Aanmelden Cloud Developer options @@ -126,7 +169,7 @@ Log into %1:cloud and manage connected %1 systems - Aanmelden bij %1:cloud en beheer verbonden %1 systemen + Aanmelden bij %1:cloud en beheer verbonden %1 systemen @@ -932,23 +975,27 @@ - TCP server interfaces - - - - Add - - - - WebSocket server interfaces - - - - Remote connection server interfaces + Connection settings - Server: %1 + Remote connection + Connectie op afstand + + + Enabling the remote connection will allow connecting to this %1 system from anywhere. + + + + Enabled + + + + Disabled + + + + Advanced @@ -1307,6 +1354,22 @@ Configure logging categories Log categorieën instellen + + nymea:cloud + + + + Note: nymea:cloud is deprecated and will be removed in a future version. + + + + Cloud login + + + + Log into %1:cloud and manage connected %1 systems + Aanmelden bij %1:cloud en beheer verbonden %1 systemen + DeveloperTools @@ -5777,14 +5840,6 @@ Do you want to proceed? View system log - - Cloud - - - - API interfaces - - MQTT broker @@ -5837,10 +5892,6 @@ Do you want to proceed? Configure the system's network connection - - Configure how clients interact with this system - - User settings @@ -5857,10 +5908,6 @@ Do you want to proceed? Configure ZigBee networks - - Connect this %1 system to %1:cloud - - Update your %1 system @@ -5877,6 +5924,14 @@ Do you want to proceed? Configure Modbus RTU master interfaces + + Connection settings + + + + Configure how applications can connect to this system + + SetupWizard diff --git a/nymea-app/translations/nymea-app-tr.ts b/nymea-app/translations/nymea-app-tr.ts index 544b834f..3cfdc096 100644 --- a/nymea-app/translations/nymea-app-tr.ts +++ b/nymea-app/translations/nymea-app-tr.ts @@ -83,6 +83,49 @@ Oswald yazı tipi by The Oswald Project + + AdvancedConnectionInterfacesPage + + Connection interfaces + Bağlantı arayüzleri + + + TCP server interfaces + TCP sunucu arayüzleri + + + Add + Ekle + + + WebSocket server interfaces + WebSocket sunucu arayüzleri + + + Remote connection server interfaces + + + + Server: %1 + + + + nymea:cloud + + + + Note: nymea:cloud based remote connection is deprecated and will be removed in a future version. + + + + Cloud + Bulut + + + Connect this %1 system to %1:cloud + Bu %1 sistemini %1:bulut'a bağlayın + + AppLogPage @@ -106,7 +149,7 @@ Cloud login - Bulut giriş + Bulut giriş Developer options @@ -126,7 +169,7 @@ Log into %1:cloud and manage connected %1 systems - %1:bulutta oturum açın ve bağlı %1 sistemlerini yönetin + %1:bulutta oturum açın ve bağlı %1 sistemlerini yönetin @@ -963,22 +1006,38 @@ TCP server interfaces - TCP sunucu arayüzleri + TCP sunucu arayüzleri Add - Ekle + Ekle WebSocket server interfaces - WebSocket sunucu arayüzleri + WebSocket sunucu arayüzleri - Remote connection server interfaces + Connection settings - Server: %1 + Remote connection + Uzak bağlantı + + + Enabling the remote connection will allow connecting to this %1 system from anywhere. + + + + Enabled + Etkin + + + Disabled + + + + Advanced @@ -1337,6 +1396,22 @@ Configure logging categories Günlük kategorilerini yapılandırın + + nymea:cloud + + + + Note: nymea:cloud is deprecated and will be removed in a future version. + + + + Cloud login + + + + Log into %1:cloud and manage connected %1 systems + %1:bulutta oturum açın ve bağlı %1 sistemlerini yönetin + DeveloperTools @@ -5870,11 +5945,11 @@ Do you want to proceed? Cloud - Bulut + Bulut API interfaces - API arayüzleri + API arayüzleri MQTT broker @@ -5930,7 +6005,7 @@ Do you want to proceed? Configure how clients interact with this system - İstemcilerin bu sistemle nasıl etkileşime gireceğini yapılandırın + İstemcilerin bu sistemle nasıl etkileşime gireceğini yapılandırın User settings @@ -5950,7 +6025,7 @@ Do you want to proceed? Connect this %1 system to %1:cloud - Bu %1 sistemini %1:bulut'a bağlayın + Bu %1 sistemini %1:bulut'a bağlayın Modbus RTU @@ -5968,6 +6043,14 @@ Do you want to proceed? About %1 Hakkında %1 + + Connection settings + + + + Configure how applications can connect to this system + + SetupWizard diff --git a/nymea-app/translations/nymea-app-vi.ts b/nymea-app/translations/nymea-app-vi.ts index 53abbedc..04c0dcc8 100644 --- a/nymea-app/translations/nymea-app-vi.ts +++ b/nymea-app/translations/nymea-app-vi.ts @@ -83,6 +83,49 @@ + + AdvancedConnectionInterfacesPage + + Connection interfaces + + + + TCP server interfaces + + + + Add + + + + WebSocket server interfaces + + + + Remote connection server interfaces + + + + Server: %1 + + + + nymea:cloud + + + + Note: nymea:cloud based remote connection is deprecated and will be removed in a future version. + + + + Cloud + + + + Connect this %1 system to %1:cloud + + + AppLogPage @@ -104,10 +147,6 @@ Customize the app's look and behavior - - Cloud login - - Developer options @@ -124,10 +163,6 @@ Access tools for debugging and error reporting - - Log into %1:cloud and manage connected %1 systems - - AwningThingsListPage @@ -889,23 +924,27 @@ - TCP server interfaces - - - - Add - - - - WebSocket server interfaces - - - - Remote connection server interfaces + Connection settings - Server: %1 + Remote connection + + + + Enabling the remote connection will allow connecting to this %1 system from anywhere. + + + + Enabled + + + + Disabled + + + + Advanced @@ -1264,6 +1303,22 @@ Configure logging categories + + nymea:cloud + + + + Note: nymea:cloud is deprecated and will be removed in a future version. + + + + Cloud login + + + + Log into %1:cloud and manage connected %1 systems + + DeveloperTools @@ -5714,14 +5769,6 @@ Do you want to proceed? View system log - - Cloud - - - - API interfaces - - MQTT broker @@ -5774,10 +5821,6 @@ Do you want to proceed? Configure the system's network connection - - Configure how clients interact with this system - - User settings @@ -5786,10 +5829,6 @@ Do you want to proceed? Configure who can log in - - Connect this %1 system to %1:cloud - - ZigBee @@ -5814,6 +5853,14 @@ Do you want to proceed? Configure Modbus RTU master interfaces + + Connection settings + + + + Configure how applications can connect to this system + + SetupWizard diff --git a/nymea-app/ui/SettingsPage.qml b/nymea-app/ui/SettingsPage.qml index 7d5398b1..f0da310f 100644 --- a/nymea-app/ui/SettingsPage.qml +++ b/nymea-app/ui/SettingsPage.qml @@ -84,20 +84,11 @@ Page { onClicked: pageStack.push(Qt.resolvedUrl("system/NetworkSettingsPage.qml")) } - SettingsTile { - Layout.fillWidth: true - iconSource: "../images/connections/cloud.svg" - text: qsTr("Cloud") - subText: qsTr("Connect this %1 system to %1:cloud").arg(Configuration.systemName) - visible: NymeaUtils.hasPermissionScope(engine.jsonRpcClient.permissions, UserInfo.PermissionScopeAdmin) - onClicked: pageStack.push(Qt.resolvedUrl("system/CloudSettingsPage.qml")) - } - SettingsTile { Layout.fillWidth: true iconSource: "../images/connections/network-vpn.svg" - text: qsTr("API interfaces") - subText: qsTr("Configure how clients interact with this system") + text: qsTr("Connection settings") + subText: qsTr("Configure how applications can connect to this system") visible: NymeaUtils.hasPermissionScope(engine.jsonRpcClient.permissions, UserInfo.PermissionScopeAdmin) && Configuration.apiSettingsEnabled onClicked: pageStack.push(Qt.resolvedUrl("system/ConnectionInterfacesPage.qml")) } diff --git a/nymea-app/ui/appsettings/AppSettingsPage.qml b/nymea-app/ui/appsettings/AppSettingsPage.qml index 37608815..3bc6fab6 100644 --- a/nymea-app/ui/appsettings/AppSettingsPage.qml +++ b/nymea-app/ui/appsettings/AppSettingsPage.qml @@ -63,13 +63,6 @@ Page { onClicked: pageStack.push(Qt.resolvedUrl("LookAndFeelSettingsPage.qml")) } - SettingsTile { - Layout.fillWidth: true - text: qsTr("Cloud login") - subText: qsTr("Log into %1:cloud and manage connected %1 systems").arg(Configuration.systemName) - iconSource: "../images/connections/cloud.svg" - onClicked: pageStack.push(Qt.resolvedUrl("CloudLoginPage.qml")) - } SettingsTile { Layout.fillWidth: true text: qsTr("Developer options") diff --git a/nymea-app/ui/appsettings/DeveloperOptionsPage.qml b/nymea-app/ui/appsettings/DeveloperOptionsPage.qml index fe8571e2..958a2ad1 100644 --- a/nymea-app/ui/appsettings/DeveloperOptionsPage.qml +++ b/nymea-app/ui/appsettings/DeveloperOptionsPage.qml @@ -84,4 +84,25 @@ SettingsPageBase { } } } + + SettingsPageSectionHeader { + text: qsTr("nymea:cloud") + } + + Label { + Layout.fillWidth: true + Layout.leftMargin: Style.margins + Layout.rightMargin: Style.margins + text: qsTr("Note: nymea:cloud is deprecated and will be removed in a future version.") + wrapMode: Text.WordWrap + } + + NymeaItemDelegate { + Layout.fillWidth: true + text: qsTr("Cloud login") + subText: qsTr("Log into %1:cloud and manage connected %1 systems").arg(Configuration.systemName) + iconName: "../images/connections/cloud.svg" + onClicked: pageStack.push(Qt.resolvedUrl("CloudLoginPage.qml")) + } + } diff --git a/nymea-app/ui/system/AdvancedConnectionInterfacesPage.qml b/nymea-app/ui/system/AdvancedConnectionInterfacesPage.qml new file mode 100644 index 00000000..00fdbac2 --- /dev/null +++ b/nymea-app/ui/system/AdvancedConnectionInterfacesPage.qml @@ -0,0 +1,212 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +* +* Copyright 2013 - 2022, nymea GmbH +* Contact: contact@nymea.io +* +* This file is part of nymea. +* This project including source code and documentation is protected by +* copyright law, and remains the property of nymea GmbH. All rights, including +* reproduction, publication, editing and translation, are reserved. The use of +* this project is subject to the terms of a license agreement to be concluded +* with nymea GmbH in accordance with the terms of use of nymea GmbH, available +* under https://nymea.io/license +* +* GNU General Public License Usage +* Alternatively, this project may be redistributed and/or modified under the +* terms of the GNU General Public License as published by the Free Software +* Foundation, GNU version 3. This project is distributed in the hope that it +* will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty +* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General +* Public License for more details. +* +* You should have received a copy of the GNU General Public License along with +* this project. If not, see . +* +* For any further details and any questions please contact us under +* contact@nymea.io or see our FAQ/Licensing Information on +* https://nymea.io/license/faq +* +* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +import QtQuick 2.9 +import QtQuick.Controls 2.2 +import QtQuick.Layouts 1.3 +import Nymea 1.0 +import "../components" + +SettingsPageBase { + id: root + title: qsTr("Connection interfaces") + + SettingsPageSectionHeader { + text: qsTr("TCP server interfaces") + } + + Repeater { + model: engine.nymeaConfiguration.tcpServerConfigurations + delegate: ConnectionInterfaceDelegate { + Layout.fillWidth: true + iconColor: inUse ? Style.accentColor : Style.iconColor + readonly property bool inUse: (engine.jsonRpcClient.currentConnection.hostAddress === model.address || model.address === "0.0.0.0") + && engine.jsonRpcClient.currentConnection.port === model.port + canDelete: !inUse + onClicked: { + var component = Qt.createComponent(Qt.resolvedUrl("ServerConfigurationDialog.qml")); + var popup = component.createObject(root, { serverConfiguration: engine.nymeaConfiguration.tcpServerConfigurations.get(index).clone() }); + popup.accepted.connect(function() { + engine.nymeaConfiguration.setTcpServerConfiguration(popup.serverConfiguration) + popup.serverConfiguration.destroy(); + }) + popup.rejected.connect(function() { + popup.serverConfiguration.destroy(); + }) + popup.open() + } + onDeleteClicked: { + engine.nymeaConfiguration.deleteTcpServerConfiguration(model.id) + } + } + } + Button { + Layout.fillWidth: true + Layout.margins: app.margins + text: qsTr("Add") + onClicked: { + var config = engine.nymeaConfiguration.createServerConfiguration("0.0.0.0", 2222 + engine.nymeaConfiguration.tcpServerConfigurations.count, false, false); + var component = Qt.createComponent(Qt.resolvedUrl("ServerConfigurationDialog.qml")); + var popup = component.createObject(root, { serverConfiguration: config }); + popup.accepted.connect(function() { + engine.nymeaConfiguration.setTcpServerConfiguration(popup.serverConfiguration) + popup.serverConfiguration.destroy(); + }) + popup.rejected.connect(function() { + popup.serverConfiguration.destroy(); + }) + popup.open() + } + } + + SettingsPageSectionHeader { + text: qsTr("WebSocket server interfaces") + } + + Repeater { + model: engine.nymeaConfiguration.webSocketServerConfigurations + delegate: ConnectionInterfaceDelegate { + Layout.fillWidth: true + iconColor: inUse ? Style.accentColor : Style.iconColor + readonly property bool inUse: (engine.jsonRpcClient.currentConnection.hostAddress === model.address || model.address === "0.0.0.0") + && engine.jsonRpcClient.currentConnection.port === model.port + canDelete: !inUse + onClicked: { + var component = Qt.createComponent(Qt.resolvedUrl("ServerConfigurationDialog.qml")); + var popup = component.createObject(root, { serverConfiguration: engine.nymeaConfiguration.webSocketServerConfigurations.get(index).clone() }); + popup.accepted.connect(function() { + print("configuring:", popup.serverConfiguration.port) + engine.nymeaConfiguration.setWebSocketServerConfiguration(popup.serverConfiguration) + popup.serverConfiguration.destroy(); + }) + popup.rejected.connect(function() { + popup.serverConfiguration.destroy(); + }) + popup.open() + } + onDeleteClicked: { + print("should delete", model.id) + engine.nymeaConfiguration.deleteWebSocketServerConfiguration(model.id) + } + } + } + Button { + Layout.fillWidth: true + Layout.margins: app.margins + text: qsTr("Add") + onClicked: { + var config = engine.nymeaConfiguration.createServerConfiguration("0.0.0.0", 4444 + engine.nymeaConfiguration.webSocketServerConfigurations.count, false, false); + var component = Qt.createComponent(Qt.resolvedUrl("ServerConfigurationDialog.qml")); + var popup = component.createObject(root, { serverConfiguration: config }); + popup.accepted.connect(function() { + engine.nymeaConfiguration.setWebSocketServerConfiguration(popup.serverConfiguration) + popup.serverConfiguration.destroy(); + }) + popup.rejected.connect(function() { + popup.serverConfiguration.destroy(); + }) + popup.open() + } + } + SettingsPageSectionHeader { + text: qsTr("Remote connection server interfaces") + visible: engine.jsonRpcClient.ensureServerVersion("6.0") + } + + Repeater { + model: engine.nymeaConfiguration.tunnelProxyServerConfigurations + delegate: ConnectionInterfaceDelegate { + Layout.fillWidth: true + text: qsTr("Server: %1").arg(model.address) + iconColor: inUse ? Style.accentColor : Style.iconColor + readonly property bool inUse: (engine.jsonRpcClient.currentConnection.hostAddress === model.address || model.address === "0.0.0.0") + && engine.jsonRpcClient.currentConnection.port === model.port + canDelete: !inUse + onClicked: { + var component = Qt.createComponent(Qt.resolvedUrl("TunnelProxyServerConfigurationDialog.qml")); + var popup = component.createObject(root, { serverConfiguration: engine.nymeaConfiguration.tunnelProxyServerConfigurations.get(index).clone() }); + popup.accepted.connect(function() { + print("configuring:", popup.serverConfiguration.port) + engine.nymeaConfiguration.setTunnelProxyServerConfiguration(popup.serverConfiguration) + popup.serverConfiguration.destroy(); + }) + popup.rejected.connect(function() { + popup.serverConfiguration.destroy(); + }) + popup.open() + } + onDeleteClicked: { + engine.nymeaConfiguration.deleteTunnelProxyServerConfiguration(model.id) + } + } + } + Button { + Layout.fillWidth: true + Layout.margins: app.margins + text: qsTr("Add") + visible: engine.jsonRpcClient.ensureServerVersion("6.0") + onClicked: { + var config = engine.nymeaConfiguration.createTunnelProxyServerConfiguration("remoteproxy.nymea.io", 2213, true, true, false); + var component = Qt.createComponent(Qt.resolvedUrl("TunnelProxyServerConfigurationDialog.qml")); + var popup = component.createObject(root, { serverConfiguration: config }); + popup.accepted.connect(function() { + engine.nymeaConfiguration.setTunnelProxyServerConfiguration(popup.serverConfiguration) + popup.serverConfiguration.destroy(); + }) + popup.rejected.connect(function() { + popup.serverConfiguration.destroy(); + }) + popup.open() + } + } + + SettingsPageSectionHeader { + text: qsTr("nymea:cloud") + } + + Label { + Layout.fillWidth: true + Layout.leftMargin: Style.margins + Layout.rightMargin: Style.margins + text: qsTr("Note: nymea:cloud based remote connection is deprecated and will be removed in a future version.") + wrapMode: Text.WordWrap + } + + NymeaItemDelegate { + Layout.fillWidth: true + iconName: "../images/connections/cloud.svg" + text: qsTr("Cloud") + subText: qsTr("Connect this %1 system to %1:cloud").arg(Configuration.systemName) + visible: NymeaUtils.hasPermissionScope(engine.jsonRpcClient.permissions, UserInfo.PermissionScopeAdmin) + onClicked: pageStack.push(Qt.resolvedUrl("CloudSettingsPage.qml")) + } + + +} diff --git a/nymea-app/ui/system/ConnectionInterfacesPage.qml b/nymea-app/ui/system/ConnectionInterfacesPage.qml index 82f324d7..163580a8 100644 --- a/nymea-app/ui/system/ConnectionInterfacesPage.qml +++ b/nymea-app/ui/system/ConnectionInterfacesPage.qml @@ -36,155 +36,43 @@ import "../components" SettingsPageBase { id: root - title: qsTr("Connection interfaces") - + title: qsTr("Connection settings") SettingsPageSectionHeader { - text: qsTr("TCP server interfaces") + text: qsTr("Remote connection") + } + Label { + Layout.fillWidth: true + Layout.leftMargin: Style.margins + Layout.rightMargin: Style.margins + text: qsTr("Enabling the remote connection will allow connecting to this %1 system from anywhere.").arg(Configuration.systemName) + wrapMode: Text.WordWrap } - Repeater { - model: engine.nymeaConfiguration.tcpServerConfigurations - delegate: ConnectionInterfaceDelegate { - Layout.fillWidth: true - iconColor: inUse ? Style.accentColor : Style.iconColor - readonly property bool inUse: (engine.jsonRpcClient.currentConnection.hostAddress === model.address || model.address === "0.0.0.0") - && engine.jsonRpcClient.currentConnection.port === model.port - canDelete: !inUse - onClicked: { - var component = Qt.createComponent(Qt.resolvedUrl("ServerConfigurationDialog.qml")); - var popup = component.createObject(root, { serverConfiguration: engine.nymeaConfiguration.tcpServerConfigurations.get(index).clone() }); - popup.accepted.connect(function() { - engine.nymeaConfiguration.setTcpServerConfiguration(popup.serverConfiguration) - popup.serverConfiguration.destroy(); - }) - popup.rejected.connect(function() { - popup.serverConfiguration.destroy(); - }) - popup.open() - } - onDeleteClicked: { - engine.nymeaConfiguration.deleteTcpServerConfiguration(model.id) - } - } - } - Button { + SwitchDelegate { Layout.fillWidth: true - Layout.margins: app.margins - text: qsTr("Add") + text: checked ? qsTr("Enabled") : qsTr("Disabled") + checked: engine.nymeaConfiguration.tunnelProxyServerConfigurations.count > 0 onClicked: { - var config = engine.nymeaConfiguration.createServerConfiguration("0.0.0.0", 2222 + engine.nymeaConfiguration.tcpServerConfigurations.count, false, false); - var component = Qt.createComponent(Qt.resolvedUrl("ServerConfigurationDialog.qml")); - var popup = component.createObject(root, { serverConfiguration: config }); - popup.accepted.connect(function() { - engine.nymeaConfiguration.setTcpServerConfiguration(popup.serverConfiguration) - popup.serverConfiguration.destroy(); - }) - popup.rejected.connect(function() { - popup.serverConfiguration.destroy(); - }) - popup.open() + if (!checked) { + for (var i = 0; i < engine.nymeaConfiguration.tunnelProxyServerConfigurations.count; i++) { + var config = engine.nymeaConfiguration.tunnelProxyServerConfigurations.get(i); + engine.nymeaConfiguration.deleteTunnelProxyServerConfiguration(config.id) + } + } else { + var config = engine.nymeaConfiguration.createTunnelProxyServerConfiguration("remoteproxy.nymea.io", 2213, true, true, false); + engine.nymeaConfiguration.setTunnelProxyServerConfiguration(config) + } } } SettingsPageSectionHeader { - text: qsTr("WebSocket server interfaces") + text: qsTr("Advanced") } - Repeater { - model: engine.nymeaConfiguration.webSocketServerConfigurations - delegate: ConnectionInterfaceDelegate { - Layout.fillWidth: true - iconColor: inUse ? Style.accentColor : Style.iconColor - readonly property bool inUse: (engine.jsonRpcClient.currentConnection.hostAddress === model.address || model.address === "0.0.0.0") - && engine.jsonRpcClient.currentConnection.port === model.port - canDelete: !inUse - onClicked: { - var component = Qt.createComponent(Qt.resolvedUrl("ServerConfigurationDialog.qml")); - var popup = component.createObject(root, { serverConfiguration: engine.nymeaConfiguration.webSocketServerConfigurations.get(index).clone() }); - popup.accepted.connect(function() { - print("configuring:", popup.serverConfiguration.port) - engine.nymeaConfiguration.setWebSocketServerConfiguration(popup.serverConfiguration) - popup.serverConfiguration.destroy(); - }) - popup.rejected.connect(function() { - popup.serverConfiguration.destroy(); - }) - popup.open() - } - onDeleteClicked: { - print("should delete", model.id) - engine.nymeaConfiguration.deleteWebSocketServerConfiguration(model.id) - } - } - } - Button { + NymeaItemDelegate { Layout.fillWidth: true - Layout.margins: app.margins - text: qsTr("Add") - onClicked: { - var config = engine.nymeaConfiguration.createServerConfiguration("0.0.0.0", 4444 + engine.nymeaConfiguration.webSocketServerConfigurations.count, false, false); - var component = Qt.createComponent(Qt.resolvedUrl("ServerConfigurationDialog.qml")); - var popup = component.createObject(root, { serverConfiguration: config }); - popup.accepted.connect(function() { - engine.nymeaConfiguration.setWebSocketServerConfiguration(popup.serverConfiguration) - popup.serverConfiguration.destroy(); - }) - popup.rejected.connect(function() { - popup.serverConfiguration.destroy(); - }) - popup.open() - } - } - SettingsPageSectionHeader { - text: qsTr("Remote connection server interfaces") - visible: engine.jsonRpcClient.ensureServerVersion("6.0") - } - - Repeater { - model: engine.nymeaConfiguration.tunnelProxyServerConfigurations - delegate: ConnectionInterfaceDelegate { - Layout.fillWidth: true - text: qsTr("Server: %1").arg(model.address) - iconColor: inUse ? Style.accentColor : Style.iconColor - readonly property bool inUse: (engine.jsonRpcClient.currentConnection.hostAddress === model.address || model.address === "0.0.0.0") - && engine.jsonRpcClient.currentConnection.port === model.port - canDelete: !inUse - onClicked: { - var component = Qt.createComponent(Qt.resolvedUrl("TunnelProxyServerConfigurationDialog.qml")); - var popup = component.createObject(root, { serverConfiguration: engine.nymeaConfiguration.tunnelProxyServerConfigurations.get(index).clone() }); - popup.accepted.connect(function() { - print("configuring:", popup.serverConfiguration.port) - engine.nymeaConfiguration.setTunnelProxyServerConfiguration(popup.serverConfiguration) - popup.serverConfiguration.destroy(); - }) - popup.rejected.connect(function() { - popup.serverConfiguration.destroy(); - }) - popup.open() - } - onDeleteClicked: { - engine.nymeaConfiguration.deleteTunnelProxyServerConfiguration(model.id) - } - } - } - Button { - Layout.fillWidth: true - Layout.margins: app.margins - text: qsTr("Add") - visible: engine.jsonRpcClient.ensureServerVersion("6.0") - onClicked: { - var config = engine.nymeaConfiguration.createTunnelProxyServerConfiguration("dev-remoteproxy.nymea.io", 2213, true, true, false); - var component = Qt.createComponent(Qt.resolvedUrl("TunnelProxyServerConfigurationDialog.qml")); - var popup = component.createObject(root, { serverConfiguration: config }); - popup.accepted.connect(function() { - engine.nymeaConfiguration.setTunnelProxyServerConfiguration(popup.serverConfiguration) - popup.serverConfiguration.destroy(); - }) - popup.rejected.connect(function() { - popup.serverConfiguration.destroy(); - }) - popup.open() - } + text: qsTr("Connection interfaces") + onClicked: pageStack.push("AdvancedConnectionInterfacesPage.qml") } }