added processing of private ssh keys

This commit is contained in:
vladimir.kuznetsov 2023-08-02 20:37:43 +09:00
parent 925fd9f268
commit ebcca0c3b8
10 changed files with 137 additions and 8 deletions

View file

@ -106,13 +106,17 @@ ListView {
break
}
case ContainerEnum.WireGuard: {
WireGuardConfigModel.updateModel(config)
goToPage(PageEnum.PageProtocolWireGuardSettings)
ProtocolsModel.updateModel(config)
goToPage(PageEnum.PageProtocolRaw)
// WireGuardConfigModel.updateModel(config)
// goToPage(PageEnum.PageProtocolWireGuardSettings)
break
}
case ContainerEnum.Ipsec: {
Ikev2ConfigModel.updateModel(config)
goToPage(PageEnum.PageProtocolIKev2Settings)
ProtocolsModel.updateModel(config)
goToPage(PageEnum.PageProtocolRaw)
// Ikev2ConfigModel.updateModel(config)
// goToPage(PageEnum.PageProtocolIKev2Settings)
break
}
case ContainerEnum.Sftp: {

View file

@ -134,7 +134,7 @@ PageType {
questionDrawer.yesButtonFunction = function() {
questionDrawer.visible = false
PageController.showBusyIndicator(true)
if (ServersModel.isDefaultServerCurrentlyProcessed && ConnectionController.isConnected) {
if (ServersModel.isDefaultServerCurrentlyProcessed() && ConnectionController.isConnected) {
ConnectionController.closeConnection()
}
InstallController.removeCurrentlyProcessedServer()
@ -165,7 +165,7 @@ PageType {
questionDrawer.yesButtonFunction = function() {
questionDrawer.visible = false
goToPage(PageEnum.PageDeinstalling)
if (ServersModel.isDefaultServerCurrentlyProcessed && ConnectionController.isConnected) {
if (ServersModel.isDefaultServerCurrentlyProcessed() && ConnectionController.isConnected) {
ConnectionController.closeVpnConnection()
}
InstallController.removeAllContainers()

View file

@ -52,7 +52,7 @@ PageType {
PageController.showErrorMessage(errorMessage)
var needCloseCurrentPage = false
var currentPageName = stackView.currentItem.objectName
var currentPageName = tabBarStackView.currentItem.objectName
if (currentPageName === PageController.getPagePath(PageEnum.PageSetupWizardInstalling)) {
needCloseCurrentPage = true

View file

@ -75,6 +75,10 @@ Window {
popupNotificationMessage.open()
popupNotificationTimer.start()
}
function onShowPassphraseRequestDrawer() {
privateKeyPassphraseDrawer.open()
}
}
Item {
@ -111,4 +115,74 @@ Window {
id: popupErrorMessage
}
}
Item {
anchors.right: parent.right
anchors.left: parent.left
anchors.bottom: parent.bottom
implicitHeight: popupErrorMessage.height
DrawerType {
id: privateKeyPassphraseDrawer
width: root.width
height: root.height * 0.35
onVisibleChanged: {
if (privateKeyPassphraseDrawer.visible) {
passphrase.textFieldText = ""
passphrase.textField.forceActiveFocus()
}
}
onAboutToHide: {
PageController.showBusyIndicator(true)
}
onAboutToShow: {
PageController.showBusyIndicator(false)
}
ColumnLayout {
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
anchors.topMargin: 16
anchors.leftMargin: 16
anchors.rightMargin: 16
TextFieldWithHeaderType {
id: passphrase
property bool hidePassword: true
Layout.fillWidth: true
headerText: qsTr("Private key passphrase")
textField.echoMode: hidePassword ? TextInput.Password : TextInput.Normal
buttonImageSource: hidePassword ? "qrc:/images/controls/eye.svg" : "qrc:/images/controls/eye-off.svg"
clickedFunc: function() {
hidePassword = !hidePassword
}
}
BasicButtonType {
Layout.fillWidth: true
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("Save")
onClicked: {
privateKeyPassphraseDrawer.close()
PageController.passphraseRequestDrawerClosed(passphrase.textFieldText)
}
}
}
}
}
}