From commits-return-20012-archive-asf-public=cust-asf.ponee.io@airavata.apache.org Fri Nov 16 23:00:16 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 55477180778 for ; Fri, 16 Nov 2018 23:00:15 +0100 (CET) Received: (qmail 99613 invoked by uid 500); 16 Nov 2018 22:00:14 -0000 Mailing-List: contact commits-help@airavata.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@airavata.apache.org Delivered-To: mailing list commits@airavata.apache.org Received: (qmail 99589 invoked by uid 99); 16 Nov 2018 22:00:14 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 16 Nov 2018 22:00:14 +0000 Received: by gitbox.apache.org (ASF Mail Server at gitbox.apache.org, from userid 33) id 477CC851AD; Fri, 16 Nov 2018 22:00:13 +0000 (UTC) Date: Fri, 16 Nov 2018 22:00:17 +0000 To: "commits@airavata.apache.org" Subject: [airavata-django-portal] 05/06: AIRAVATA-2907 Formatting storage pref listing MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit From: machristie@apache.org In-Reply-To: <154240561277.24393.15078359743046424870@gitbox.apache.org> References: <154240561277.24393.15078359743046424870@gitbox.apache.org> X-Git-Host: gitbox.apache.org X-Git-Repo: airavata-django-portal X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Rev: fd358e4781ff804e1c3e4a2602d1ea3b6a7b75c3 X-Git-NotificationType: diff X-Git-Multimail-Version: 1.5.dev Auto-Submitted: auto-generated Message-Id: <20181116220013.477CC851AD@gitbox.apache.org> This is an automated email from the ASF dual-hosted git repository. machristie pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/airavata-django-portal.git commit fd358e4781ff804e1c3e4a2602d1ea3b6a7b75c3 Author: Marcus Christie AuthorDate: Fri Nov 16 15:49:56 2018 -0500 AIRAVATA-2907 Formatting storage pref listing --- .../gatewayprofile/StoragePreferenceList.vue | 43 ++++++++++++++++------ 1 file changed, 32 insertions(+), 11 deletions(-) diff --git a/django_airavata/apps/admin/static/django_airavata_admin/src/components/gatewayprofile/StoragePreferenceList.vue b/django_airavata/apps/admin/static/django_airavata_admin/src/components/gatewayprofile/StoragePreferenceList.vue index 7f1424d..00c259f 100644 --- a/django_airavata/apps/admin/static/django_airavata_admin/src/components/gatewayprofile/StoragePreferenceList.vue +++ b/django_airavata/apps/admin/static/django_airavata_admin/src/components/gatewayprofile/StoragePreferenceList.vue @@ -65,7 +65,8 @@ export default { showingDetails: {}, showNewItemEditor: false, newStoragePreference: null, - storageResourceNames: null + storageResourceNames: null, + credentials: null }; }, computed: { @@ -88,8 +89,7 @@ export default { }, { label: "File System Location", - key: "fileSystemRootLocation", - formatter: value => this.formatFileSystemLocation(value) + key: "fileSystemRootLocation" }, { label: "Action", @@ -122,25 +122,46 @@ export default { } } return utils.StringUtils.sortIgnoreCase(options, a => a.text); + }, + defaultCredentialSummary() { + if (this.defaultCredentialStoreToken && this.credentials) { + return this.credentials.find( + cred => cred.token === this.defaultCredentialStoreToken + ); + } else { + return null; + } } }, created() { services.StorageResourceService.names().then(names => { this.storageResourceNames = names; }); + services.CredentialSummaryService.allSSHCredentials().then( + creds => (this.credentials = creds) + ); }, methods: { getStorageResourceName(storageResourceId) { - // TODO: fetch storage resources - return storageResourceId; + if ( + this.storageResourceNames && + storageResourceId in this.storageResourceNames + ) { + return this.storageResourceNames[storageResourceId]; + } else { + return storageResourceId.substring(0, 10) + "..."; + } }, getCredentialName(token) { - // TODO: fetch credential name - return token; - }, - formatFileSystemLocation(fileSystemRootLocation) { - // TODO: truncate to fit - return fileSystemRootLocation; + if (token === null && this.defaultCredentialSummary) { + return this.defaultCredentialSummary.description + " (default)"; + } else if (this.credentials) { + const cred = this.credentials.find(cred => cred.token === token); + if (cred) { + return cred.description; + } + } + return "..."; }, updatedStoragePreference(newValue) { this.$emit("updated", newValue);