Files
amnezia-client/client/ui/qml/Pages2/PageSetupWizardCredentials.qml
T

112 lines
3.1 KiB
QML
Raw Normal View History

import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import PageEnum 1.0
import "./"
import "../Controls2"
import "../Config"
import "../Controls2/TextTypes"
PageType {
id: root
2023-06-05 15:49:10 +08:00
BackButtonType {
id: backButton
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
anchors.rightMargin: 16
anchors.leftMargin: 16
anchors.topMargin: 20
}
FlickableType {
id: fl
2023-06-05 15:49:10 +08:00
anchors.top: backButton.bottom
anchors.bottom: parent.bottom
contentHeight: content.height
ColumnLayout {
id: content
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
anchors.rightMargin: 16
anchors.leftMargin: 16
spacing: 16
HeaderType {
Layout.fillWidth: true
headerText: qsTr("Server connection")
}
TextFieldWithHeaderType {
id: hostname
Layout.fillWidth: true
headerText: qsTr("Server IP address [:port]")
textFieldPlaceholderText: qsTr("Enter the address in the format 255.255.255.255:88")
textField.validator: RegularExpressionValidator {
regularExpression: InstallController.ipAddressPortRegExp()
}
}
TextFieldWithHeaderType {
id: username
Layout.fillWidth: true
headerText: qsTr("Login to connect via SSH")
}
TextFieldWithHeaderType {
id: secretData
Layout.fillWidth: true
headerText: qsTr("Password / Private key")
textField.echoMode: TextInput.Password
}
BasicButtonType {
Layout.fillWidth: true
Layout.topMargin: 24
text: qsTr("Set up a server the easy way")
onClicked: function() {
InstallController.setShouldCreateServer(true)
InstallController.setCurrentlyInstalledServerCredentials(hostname.textField.text, username.textField.text, secretData.textField.text)
goToPage(PageEnum.PageSetupWizardEasy)
}
}
BasicButtonType {
Layout.fillWidth: true
Layout.topMargin: -8
defaultColor: "transparent"
hoveredColor: Qt.rgba(1, 1, 1, 0.08)
pressedColor: Qt.rgba(1, 1, 1, 0.12)
disabledColor: "#878B91"
textColor: "#D7D8DB"
borderWidth: 1
text: qsTr("Select protocol to install")
onClicked: function() {
InstallController.setShouldCreateServer(true)
InstallController.setCurrentlyInstalledServerCredentials(hostname.textField.text, username.textField.text, secretData.textField.text)
goToPage(PageEnum.PageSetupWizardProtocols)
}
}
}
}
}