summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2017-10-25 17:12:46 +0200
committerChristian Mollekopf <chrigi_1@fastmail.fm>2017-10-25 17:12:46 +0200
commite6a16e843e13744c952aea76a0e57d35029e9b19 (patch)
treebc686ad675544ac76b03684b870b2ba0993905a8
parent7a128f6d9c87fea617d4846b5b939dafbe3feb0d (diff)
downloadkube-e6a16e843e13744c952aea76a0e57d35029e9b19.tar.gz
kube-e6a16e843e13744c952aea76a0e57d35029e9b19.zip
A login error view
-rw-r--r--components/kube/contents/ui/LogView.qml49
1 files changed, 43 insertions, 6 deletions
diff --git a/components/kube/contents/ui/LogView.qml b/components/kube/contents/ui/LogView.qml
index 2ffa978c..4d6035c0 100644
--- a/components/kube/contents/ui/LogView.qml
+++ b/components/kube/contents/ui/LogView.qml
@@ -143,26 +143,25 @@ Controls.SplitView {
143 143
144 Loader { 144 Loader {
145 id: detailsLoader 145 id: detailsLoader
146 visible: message != ""
147 clip: true
146 anchors { 148 anchors {
147 fill: parent 149 fill: parent
148 margins: Kube.Units.largeSpacing 150 margins: Kube.Units.largeSpacing
149 } 151 }
150 property date timestamp: details.timestamp 152 property date timestamp: details.timestamp
151 property string message: details.message 153 property string message: details.message
152 property string resourceId: details.resourceid 154 property string resourceId: details.resourceId
153 property string accountId: retriever.currentData ? retriever.currentData.accountId : "" 155 property string accountId: retriever.currentData ? retriever.currentData.accountId : ""
154 property string accountName: retriever.currentData ? retriever.currentData.name : "" 156 property string accountName: retriever.currentData ? retriever.currentData.name : ""
155 157
156 sourceComponent: detailsComponent 158 sourceComponent: details.subtype == Kube.Notifications.loginError ? loginErrorComponent : detailsComponent
157 } 159 }
158
159 } 160 }
160 161
161 Component { 162 Component {
162 id: detailsComponent 163 id: detailsComponent
163 Rectangle { 164 Rectangle {
164 visible: message != ""
165 clip: true
166 color: Kube.Colors.viewBackgroundColor 165 color: Kube.Colors.viewBackgroundColor
167 GridLayout { 166 GridLayout {
168 id: gridLayout 167 id: gridLayout
@@ -170,8 +169,8 @@ Controls.SplitView {
170 anchors { 169 anchors {
171 top: parent.top 170 top: parent.top
172 left: parent.left 171 left: parent.left
172 right: parent.right
173 } 173 }
174 width: parent.width
175 columns: 2 174 columns: 2
176 Kube.Label { 175 Kube.Label {
177 text: qsTr("Account:") 176 text: qsTr("Account:")
@@ -232,4 +231,42 @@ Controls.SplitView {
232 } 231 }
233 } 232 }
234 } 233 }
234
235 Component {
236 id: loginErrorComponent
237 Item {
238 Column {
239 anchors {
240 top: parent.top
241 left: parent.left
242 right: parent.right
243 }
244 spacing: Kube.Units.largeSpacing
245 Column {
246 Kube.Heading {
247 id: heading
248 text: qsTr("Failed to login")
249 color: Kube.Colors.warningColor
250 }
251
252 Kube.Label {
253 id: subHeadline
254 text: accountName + ": " + qsTr("Please check your credentials.")
255 color: Kube.Colors.disabledTextColor
256 wrapMode: Text.Wrap
257 }
258 }
259 Kube.Button {
260 anchors {
261 right: parent.right
262 }
263 text: qsTr("Change Password")
264 onClicked: {
265 Kube.Fabric.postMessage(Kube.Messages.componentDone, {})
266 Kube.Fabric.postMessage(Kube.Messages.requestLogin, {})
267 }
268 }
269 }
270 }
271 }
235} 272}