101 lines
2.1 KiB
QML
101 lines
2.1 KiB
QML
import QtQuick
|
|
import QtQuick.Controls
|
|
import QtQuick.Layouts
|
|
|
|
GridLayout
|
|
{
|
|
id: createUserGrid
|
|
columns: 2
|
|
columnSpacing: 5
|
|
rowSpacing: 9
|
|
// anchors.fill: parent
|
|
|
|
property string name: "user"
|
|
|
|
Label
|
|
{
|
|
text: qsTr("Admin User erstellen")
|
|
font.pixelSize: 40
|
|
Layout.columnSpan: 2
|
|
Layout.alignment: Qt.AlignHCenter
|
|
padding: 15
|
|
}
|
|
|
|
|
|
Label
|
|
{
|
|
id: benutzerNamelabel
|
|
text: qsTr("Benutzername:")
|
|
Layout.alignment: Qt.AlignRight
|
|
}
|
|
|
|
TextField
|
|
{
|
|
id: benutzerName
|
|
placeholderText: qsTr("Hier Benutzername eingeben")
|
|
Layout.fillWidth: true
|
|
height: 3
|
|
property string name: "PYQCRM_USER"
|
|
}
|
|
|
|
Label
|
|
{
|
|
text: qsTr("Passwort:")
|
|
Layout.alignment: Qt.AlignRight
|
|
}
|
|
|
|
TextField
|
|
{
|
|
id: password
|
|
echoMode: TextInput.Password
|
|
placeholderText: qsTr("Hier Passwort eingeben")
|
|
Layout.fillWidth: true
|
|
property string name: "PYQCRM_USER_PASS"
|
|
color: acceptableInput ? "black" : "red"
|
|
ToolTip.visible: hovered && !acceptableInput
|
|
ToolTip.text: "Passwort muss mind. 12 Zeichen lang sein und Groß-, Kleinbuchstaben, Zahlen sowie Sonderzeichen (!@#$%^&*()_+-=) enthalten."
|
|
|
|
validator: RegularExpressionValidator {
|
|
regularExpression: /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[!@#$%^&*()_+\-=]).{12,}$/
|
|
}
|
|
|
|
|
|
}
|
|
Label
|
|
{
|
|
text: qsTr("Info:")
|
|
Layout.alignment: Qt.AlignRight
|
|
}
|
|
|
|
TextField
|
|
{
|
|
id: gecos
|
|
placeholderText: qsTr("Zusätzliche Info")
|
|
Layout.fillWidth: true
|
|
property string name: "PYQCRM_USER_INFO"
|
|
}
|
|
|
|
Item
|
|
{
|
|
Layout.fillHeight: true
|
|
}
|
|
|
|
|
|
|
|
Component.onCompleted:
|
|
{
|
|
config.adminNotAvailable.connect(adminNotAvailable)
|
|
|
|
}
|
|
function adminNotAvailable()
|
|
{
|
|
benutzerName.placeholderText = qsTr ("Benutzername ist bereits vergeben")
|
|
benutzerName.clear()
|
|
benutzerNamelabel.color = "red"
|
|
benutzerNamelabel.font.bold = true
|
|
}
|
|
|
|
}
|
|
|
|
|