Add page to show go-e device integrations page
This commit is contained in:
3
.gitmodules
vendored
3
.gitmodules
vendored
@ -4,3 +4,6 @@
|
||||
[submodule "3rdparty/QtZeroConf"]
|
||||
path = 3rdparty/QtZeroConf
|
||||
url = ../../0xFEEDC0DE64/QtZeroConf.git
|
||||
[submodule "3rdparty/qrcode-svg"]
|
||||
path = 3rdparty/qrcode-svg
|
||||
url = ../../papnkukn/qrcode-svg.git
|
||||
|
1
3rdparty/qrcode-svg
vendored
Submodule
1
3rdparty/qrcode-svg
vendored
Submodule
Submodule 3rdparty/qrcode-svg added at 47d56ec28f
@ -72,6 +72,7 @@ qt_add_qml_module(evcharger-app
|
||||
qml/ChargerTabPage.qml
|
||||
qml/ChargingConfigurationPage.qml
|
||||
qml/ChargingSpeedPage.qml
|
||||
qml/CloudApiQrCodePage.qml
|
||||
qml/CloudPage.qml
|
||||
qml/CloudUrlsModel.qml
|
||||
qml/ConfirmingOnOffSwitch.qml
|
||||
@ -116,6 +117,7 @@ qt_add_qml_module(evcharger-app
|
||||
qml/OpenLinkButton.qml
|
||||
qml/PasswordPage.qml
|
||||
qml/PvSurplusPage.qml
|
||||
qml/QrCode.qml
|
||||
qml/RebootPage.qml
|
||||
qml/RequestStatusText.qml
|
||||
qml/SchedulerDayPage.qml
|
||||
@ -159,6 +161,7 @@ qt_add_qml_module(evcharger-app
|
||||
qml/images/wattpilot.png
|
||||
qml/images/phoenix.png
|
||||
qml/images/geminiFix.png
|
||||
qml/js/qrcode.min.js
|
||||
qml/material-icons/add.svg
|
||||
qml/material-icons/grid_guides.svg
|
||||
qml/material-icons/open_in_new.svg
|
||||
|
439
i18n/qml_de.ts
439
i18n/qml_de.ts
File diff suppressed because it is too large
Load Diff
@ -119,6 +119,17 @@ NavigationPage {
|
||||
text: qsTr("API documentation")
|
||||
url: qsTr("https://github.com/goecharger/go-eCharger-API-v2/blob/main/cloudapi-en.md")
|
||||
}
|
||||
|
||||
Button {
|
||||
text: qsTr("3rdparty integrations (QR-Code)")
|
||||
onClicked: stackView.push(cloudApiQrCodePage)
|
||||
|
||||
Component {
|
||||
id: cloudApiQrCodePage
|
||||
CloudApiQrCodePage {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
38
qml/CloudApiQrCodePage.qml
Normal file
38
qml/CloudApiQrCodePage.qml
Normal file
@ -0,0 +1,38 @@
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
import EVChargerApp
|
||||
|
||||
NavigationPage {
|
||||
title: qsTr("3rdparty integrations")
|
||||
|
||||
ApiKeyValueHelper {
|
||||
id: serial
|
||||
deviceConnection: theDeviceConnection
|
||||
apiKey: "sse"
|
||||
}
|
||||
|
||||
ApiKeyValueHelper {
|
||||
id: cloudApiKey
|
||||
deviceConnection: theDeviceConnection
|
||||
apiKey: "cak"
|
||||
}
|
||||
|
||||
property string integrationUrl: qsTr("https://device.go-e.io/%0?t=%1").arg(serial.value).arg(cloudApiKey.value)
|
||||
|
||||
QrCode {
|
||||
Layout.fillWidth: true
|
||||
fillMode: Image.PreserveAspectFit
|
||||
anchors.leftMargin: 50
|
||||
anchors.rightMargin: 50
|
||||
|
||||
visible: (typeof serial.value === 'string' || serial.value instanceof String) && serial.value != "" &&
|
||||
(typeof cloudApiKey.value === 'string' || cloudApiKey.value instanceof String) && cloudApiKey.value != ""
|
||||
content: integrationUrl
|
||||
}
|
||||
|
||||
OpenLinkButton {
|
||||
text: qsTr("Open integrations page")
|
||||
url: integrationUrl
|
||||
}
|
||||
}
|
48
qml/QrCode.qml
Normal file
48
qml/QrCode.qml
Normal file
@ -0,0 +1,48 @@
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
import EVChargerApp
|
||||
|
||||
import "js/qrcode.min.js" as QrSvg
|
||||
|
||||
Image {
|
||||
required property string content
|
||||
//property int padding: 4
|
||||
//property int width: 256
|
||||
//property int height: 256
|
||||
//property string color: "black"
|
||||
//property string background: "white"
|
||||
//property string ecl: "M"
|
||||
//property bool join: false
|
||||
//property bool predefined: false
|
||||
//property bool pretty: true
|
||||
//property bool swap: false
|
||||
//property bool xmlDeclaration: true
|
||||
//property string container: "svg"
|
||||
|
||||
function createSvgString() {
|
||||
const svg = new QrSvg.QRCode({
|
||||
content: content,
|
||||
//padding: root.padding,
|
||||
//width: root.width,
|
||||
//height: root.height,
|
||||
//color: root.color,
|
||||
//background: root.background,
|
||||
//ecl: root.ecl,
|
||||
//join: root.join,
|
||||
//predefined: root.predefined,
|
||||
//pretty: root.pretty,
|
||||
//swap: root.swap,
|
||||
//xmlDeclaration: root.xmlDeclaration,
|
||||
//container: root.container
|
||||
}).svg()
|
||||
|
||||
if (svg === "")
|
||||
source = ""
|
||||
else
|
||||
source = "data:image/svg+xml;utf8," + svg;
|
||||
}
|
||||
|
||||
onContentChanged: createSvgString()
|
||||
Component.onCompleted: createSvgString()
|
||||
}
|
1
qml/js/qrcode.min.js
vendored
Symbolic link
1
qml/js/qrcode.min.js
vendored
Symbolic link
@ -0,0 +1 @@
|
||||
../../3rdparty/qrcode-svg/dist/qrcode.min.js
|
@ -17,6 +17,7 @@ EVChargerApp 1.0 CenteredDialog.qml
|
||||
EVChargerApp 1.0 ChargerTabPage.qml
|
||||
EVChargerApp 1.0 ChargingConfigurationPage.qml
|
||||
EVChargerApp 1.0 ChargingSpeedPage.qml
|
||||
EVChargerApp 1.0 CloudApiQrCodePage.qml
|
||||
EVChargerApp 1.0 CloudPage.qml
|
||||
EVChargerApp 1.0 CloudUrlsModel.qml
|
||||
EVChargerApp 1.0 ConfirmingOnOffSwitch.qml
|
||||
@ -61,6 +62,7 @@ EVChargerApp 1.0 OcppPage.qml
|
||||
EVChargerApp 1.0 OpenLinkButton.qml
|
||||
EVChargerApp 1.0 PasswordPage.qml
|
||||
EVChargerApp 1.0 PvSurplusPage.qml
|
||||
EVChargerApp 1.0 QrCode.qml
|
||||
EVChargerApp 1.0 RebootPage.qml
|
||||
EVChargerApp 1.0 RequestStatusText.qml
|
||||
EVChargerApp 1.0 SchedulerDayPage.qml
|
||||
|
Reference in New Issue
Block a user