2022-06-08 12:06:44 -04:00
|
|
|
import QtQuick 2.7
|
2022-06-08 12:55:22 -04:00
|
|
|
import QtQuick.Controls 2.15
|
2022-06-08 12:06:44 -04:00
|
|
|
import QtQuick.Window 2.0
|
2022-06-08 13:55:15 -04:00
|
|
|
import Astra 1.0
|
2022-06-08 12:06:44 -04:00
|
|
|
|
|
|
|
ApplicationWindow {
|
|
|
|
id: window
|
|
|
|
|
|
|
|
width: 640
|
|
|
|
height: 480
|
|
|
|
|
|
|
|
visible: true
|
|
|
|
|
|
|
|
Label {
|
2022-06-08 12:55:22 -04:00
|
|
|
id: usernameLabel
|
2022-06-08 12:06:44 -04:00
|
|
|
|
2022-06-08 12:55:22 -04:00
|
|
|
text: "Username"
|
|
|
|
}
|
|
|
|
|
|
|
|
TextField {
|
|
|
|
id: usernameField
|
|
|
|
|
|
|
|
anchors.top: usernameLabel.bottom
|
|
|
|
}
|
|
|
|
|
|
|
|
Label {
|
|
|
|
id: passwordLabel
|
|
|
|
|
|
|
|
text: "Password"
|
|
|
|
|
|
|
|
anchors.top: usernameField.bottom
|
|
|
|
}
|
|
|
|
|
|
|
|
TextField {
|
|
|
|
id: passwordField
|
|
|
|
|
|
|
|
echoMode: TextInput.Password
|
|
|
|
|
|
|
|
anchors.top: passwordLabel.bottom
|
|
|
|
}
|
|
|
|
|
2022-09-05 17:46:27 -04:00
|
|
|
Label {
|
|
|
|
id: otpLabel
|
|
|
|
|
|
|
|
text: "One-Time Password"
|
|
|
|
|
|
|
|
anchors.top: passwordField.bottom
|
|
|
|
}
|
|
|
|
|
|
|
|
TextField {
|
|
|
|
id: otpField
|
|
|
|
|
|
|
|
anchors.top: otpLabel.bottom
|
|
|
|
}
|
|
|
|
|
2022-06-08 12:55:22 -04:00
|
|
|
Button {
|
|
|
|
id: loginButton
|
|
|
|
|
|
|
|
text: "Login"
|
|
|
|
|
2022-09-05 17:46:27 -04:00
|
|
|
anchors.top: otpField.bottom
|
2022-06-08 12:55:22 -04:00
|
|
|
|
2022-06-08 13:55:15 -04:00
|
|
|
onClicked: {
|
|
|
|
var info = core.createNewLoginInfo();
|
|
|
|
info.settings = core.getProfileQML(0);
|
|
|
|
info.username = usernameField.text
|
|
|
|
info.password = passwordField.text
|
2022-09-05 17:46:27 -04:00
|
|
|
info.oneTimePassword = otpField.text
|
2022-06-08 13:55:15 -04:00
|
|
|
|
2022-09-05 17:49:02 -04:00
|
|
|
core.login(info);
|
2022-06-08 13:55:15 -04:00
|
|
|
}
|
2022-06-08 12:06:44 -04:00
|
|
|
}
|
|
|
|
}
|