-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDB_Connection_Formular.qml
134 lines (121 loc) · 3.29 KB
/
DB_Connection_Formular.qml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
import QtQuick
import QtQuick.Window
import QtQuick.Controls
import QtQuick.Layouts
Window {
id: dbFormular
visible: true
width: 400
height: 300
title: "Timescale Database Connection"
GridLayout {
anchors.fill: parent
anchors.margins: 10
columns: 2
Label {
text: "Hostname:"
color: "#999999"
}
TextField {
id: hostnameField
Layout.fillWidth: true
text: "10.35.8.10"
placeholderText: "<Enter host address>"
color: "white"
background: Rectangle {
color: "#4d4d4d"
}
}
Label {
text: "Port:"
color: "#999999"
}
TextField {
id: portField
Layout.fillWidth: true
text: "5432"
placeholderText: "<Enter port>"
//inputMethodHints: Qt.ImhDigitsOnly
color: "white"
background: Rectangle {
color: "#4d4d4d"
}
}
Label {
text: "Database:"
color: "#999999"
}
TextField {
id: nameField
Layout.fillWidth: true
text: "edumpi_tsdb"
placeholderText: "<Enter database name>"
color: "white"
background: Rectangle {
color: "#4d4d4d"
}
}
Label {
text: "User:"
color: "#999999"
}
TextField {
id: userField
Layout.fillWidth: true
text: "edumpi"
placeholderText: "<Enter user name>"
color: "white"
background: Rectangle {
color: "#4d4d4d"
}
}
Label {
text: "Password:"
color: "#999999"
}
TextField {
id: passwordField
echoMode: TextInput.Password
Layout.fillWidth: true
placeholderText: "<password>"
color: "white"
background: Rectangle {
color: "#4d4d4d"
}
}
Button {
id: connectButton
HoverHandler {
cursorShape: Qt.PointingHandCursor
}
text: "confirm"
Layout.columnSpan: 2
Layout.fillWidth: true
palette.button: "#404040"
palette.buttonText: "white"
onClicked: {
db_user = userField.text
db_password = passwordField.text
db_port = portField.text
db_name = nameField.text
db_host = hostnameField.text
controller.connect(db_host, db_name, db_port , db_user, db_password)
controller.signalToClearDB()
}
}
Keys.onPressed: (event)=> {
if (event.key === Qt.Key_Return || event.key === Qt.Key_Enter) {
connectButton.clicked(); // Auslösen des Button-Klicks
}
}
Label {
Layout.topMargin: 2
Layout.columnSpan: 2
id: successfield
text: success_text
color: success_color
Layout.fillWidth: true
wrapMode: Text.WordWrap
}
}
}