From 26e02b898d3f4e63c942d2742cb920aec9e6489c Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Sat, 22 Jul 2017 01:39:09 +0200 Subject: Display corresponding account information with log entry --- components/kube/contents/ui/LogView.qml | 38 +++++++++++++++++++++++++++++---- 1 file changed, 34 insertions(+), 4 deletions(-) (limited to 'components') diff --git a/components/kube/contents/ui/LogView.qml b/components/kube/contents/ui/LogView.qml index f3297ac6..0d01ed6f 100644 --- a/components/kube/contents/ui/LogView.qml +++ b/components/kube/contents/ui/LogView.qml @@ -50,9 +50,7 @@ Controls.SplitView { } onCurrentItemChanged: { - if (details.resourceId) { - details.resourceId = currentItem.currentData.resource - } + details.resourceId = currentItem.currentData.resource details.message = currentItem.currentData.message details.timestamp = currentItem.currentData.timestamp } @@ -123,9 +121,25 @@ Controls.SplitView { id: details property date timestamp property string message - //TODO get account name from resource id property string resourceId: "" + property string accountId: "" + property string accountName: "" color: Kube.Colors.backgroundColor + Repeater { + model: Kube.AccountsModel { + id: accountsModel + resourceId: details.resourceId + } + Item { + property string account: model.accountId + property string accountName: model.name + onAccountChanged: { + details.accountId = account + details.accountName = name + } + visible: false + } + } Rectangle { anchors { fill: parent @@ -135,6 +149,22 @@ Controls.SplitView { GridLayout { anchors.fill: parent columns: 2 + Kube.Label { + text: qsTr("Account:") + visible: details.accountName + } + Kube.Label { + text: details.accountName + visible: details.accountName + } + Kube.Label { + text: qsTr("Account Id:") + visible: details.accountId + } + Kube.Label { + text: details.accountId + visible: details.accountId + } Kube.Label { text: qsTr("Resource Id:") visible: details.resourceId -- cgit v1.2.3