added separation for read/write and readonly servers for pageSettingsServerProtocols, PageSettingsServerServices, PageSettingsServerData
- added fields validations for pageSetupWizardCredentials
This commit is contained in:
parent
249be451f7
commit
2ef53c6df9
22 changed files with 466 additions and 325 deletions
|
@ -79,6 +79,10 @@ PageType {
|
|||
text: qsTr("Set up a server the easy way")
|
||||
|
||||
onClicked: function() {
|
||||
if (!isCredentialsFilled()) {
|
||||
return
|
||||
}
|
||||
|
||||
InstallController.setShouldCreateServer(true)
|
||||
InstallController.setCurrentlyInstalledServerCredentials(hostname.textField.text, username.textField.text, secretData.textField.text)
|
||||
|
||||
|
@ -100,6 +104,10 @@ PageType {
|
|||
text: qsTr("Select protocol to install")
|
||||
|
||||
onClicked: function() {
|
||||
if (!isCredentialsFilled()) {
|
||||
return
|
||||
}
|
||||
|
||||
InstallController.setShouldCreateServer(true)
|
||||
InstallController.setCurrentlyInstalledServerCredentials(hostname.textField.text, username.textField.text, secretData.textField.text)
|
||||
|
||||
|
@ -108,4 +116,25 @@ PageType {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
function isCredentialsFilled() {
|
||||
var hasEmptyField = false
|
||||
|
||||
if (hostname.textFieldText === "") {
|
||||
hostname.errorText = qsTr("ip address cannot be empty")
|
||||
hasEmptyField = true
|
||||
} else if (!hostname.textField.acceptableInput) {
|
||||
hostname.errorText = qsTr("Enter the address in the format 255.255.255.255:88")
|
||||
}
|
||||
|
||||
if (username.textFieldText === "") {
|
||||
username.errorText = qsTr("login cannot be empty")
|
||||
hasEmptyField = true
|
||||
}
|
||||
if (secretData.textFieldText === "") {
|
||||
secretData.errorText = qsTr("password/private key cannot be empty")
|
||||
hasEmptyField = true
|
||||
}
|
||||
return !hasEmptyField
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue