summaryrefslogtreecommitdiffstats
path: root/components
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2017-10-27 11:19:44 +0200
committerChristian Mollekopf <chrigi_1@fastmail.fm>2017-10-27 11:19:44 +0200
commited91fe6cddd689382f23167c1136e3a8386df0b5 (patch)
tree1455d4b403bb1f327265150447c1503bda8483d5 /components
parente666c8a42b931f547cdb2176475b2124203fe64b (diff)
downloadkube-ed91fe6cddd689382f23167c1136e3a8386df0b5.tar.gz
kube-ed91fe6cddd689382f23167c1136e3a8386df0b5.zip
Handle host not found
Diffstat (limited to 'components')
-rw-r--r--components/kube/contents/ui/Kube.qml5
-rw-r--r--components/kube/contents/ui/LogView.qml51
2 files changed, 54 insertions, 2 deletions
diff --git a/components/kube/contents/ui/Kube.qml b/components/kube/contents/ui/Kube.qml
index a7451b13..008d4899 100644
--- a/components/kube/contents/ui/Kube.qml
+++ b/components/kube/contents/ui/Kube.qml
@@ -111,6 +111,11 @@ Controls2.ApplicationWindow {
111 onMessageReceived: kubeViews.setLoginView() 111 onMessageReceived: kubeViews.setLoginView()
112 } 112 }
113 113
114 Kube.Listener {
115 filter: Kube.Messages.requestAccountsConfiguration
116 onMessageReceived: kubeViews.setAccountsView()
117 }
118
114 //BEGIN Shortcuts 119 //BEGIN Shortcuts
115 Shortcut { 120 Shortcut {
116 sequence: StandardKey.Quit 121 sequence: StandardKey.Quit
diff --git a/components/kube/contents/ui/LogView.qml b/components/kube/contents/ui/LogView.qml
index 24d42373..75e768d9 100644
--- a/components/kube/contents/ui/LogView.qml
+++ b/components/kube/contents/ui/LogView.qml
@@ -84,7 +84,9 @@ Controls.SplitView {
84 } 84 }
85 details.message = error.message + "\n" + error.details 85 details.message = error.message + "\n" + error.details
86 details.timestamp = error.timestamp 86 details.timestamp = error.timestamp
87 details.subtype = currentItem.currentData.subtype 87 if (!!currentItem.currentData.subtype) {
88 details.subtype = currentItem.currentData.subtype
89 }
88 } 90 }
89 91
90 delegate: Kube.ListDelegate { 92 delegate: Kube.ListDelegate {
@@ -163,7 +165,17 @@ Controls.SplitView {
163 property string accountId: retriever.currentData ? retriever.currentData.accountId : "" 165 property string accountId: retriever.currentData ? retriever.currentData.accountId : ""
164 property string accountName: retriever.currentData ? retriever.currentData.name : "" 166 property string accountName: retriever.currentData ? retriever.currentData.name : ""
165 167
166 sourceComponent: details.subtype == Kube.Notifications.loginError ? loginErrorComponent : detailsComponent 168 function getComponent(subtype) {
169 if (subtype == Kube.Notifications.loginError) {
170 return loginErrorComponent
171 }
172 if (subtype == Kube.Notifications.hostNotFoundError) {
173 return hostNotFoundErrorComponent
174 }
175 return detailsComponent
176 }
177
178 sourceComponent: getComponent(details.subtype)
167 } 179 }
168 } 180 }
169 181
@@ -274,4 +286,39 @@ Controls.SplitView {
274 } 286 }
275 } 287 }
276 } 288 }
289
290 Component {
291 id: hostNotFoundErrorComponent
292 Item {
293 Column {
294 anchors {
295 top: parent.top
296 left: parent.left
297 right: parent.right
298 }
299 spacing: Kube.Units.largeSpacing
300 Column {
301 Kube.Heading {
302 id: heading
303 text: qsTr("Host not found")
304 color: Kube.Colors.warningColor
305 }
306
307 Kube.Label {
308 id: subHeadline
309 text: accountName + ": " + qsTr("Please check your network connection and settings.")
310 color: Kube.Colors.disabledTextColor
311 wrapMode: Text.Wrap
312 }
313 }
314 Kube.Button {
315 text: qsTr("Account settings")
316 onClicked: {
317 Kube.Fabric.postMessage(Kube.Messages.componentDone, {})
318 Kube.Fabric.postMessage(Kube.Messages.requestAccountsConfiguration, {})
319 }
320 }
321 }
322 }
323 }
277} 324}