airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From machris...@apache.org
Subject [airavata-django-portal] branch master updated: AIRAVATA-2727 Summary compute pref info for GroupResourceProfile
Date Mon, 27 Aug 2018 17:04:29 GMT
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


The following commit(s) were added to refs/heads/master by this push:
     new 921e89f  AIRAVATA-2727 Summary compute pref info for GroupResourceProfile
921e89f is described below

commit 921e89f98fe31b190fdad83fc902b487092df96d
Author: Marcus Christie <machrist@iu.edu>
AuthorDate: Mon Aug 27 13:04:18 2018 -0400

    AIRAVATA-2727 Summary compute pref info for GroupResourceProfile
---
 .../ComputeResourcePolicySummary.vue               | 63 ++++++++++++++++++++++
 .../GroupComputeResourcePreference.vue             | 24 +++++++--
 2 files changed, 84 insertions(+), 3 deletions(-)

diff --git a/django_airavata/apps/admin/static/django_airavata_admin/src/components/admin/group_resource_preferences/ComputeResourcePolicySummary.vue
b/django_airavata/apps/admin/static/django_airavata_admin/src/components/admin/group_resource_preferences/ComputeResourcePolicySummary.vue
new file mode 100644
index 0000000..2751378
--- /dev/null
+++ b/django_airavata/apps/admin/static/django_airavata_admin/src/components/admin/group_resource_preferences/ComputeResourcePolicySummary.vue
@@ -0,0 +1,63 @@
+<template>
+    <ul>
+        <li v-for="queuePolicy in queuePolicies" :key="queuePolicy.name">
+            {{ queuePolicy.name }}
+            <template v-if="queuePolicy.policy">
+                (<span title="Max Allowed Nodes">N: {{ queuePolicy.policy.maxAllowedNodes
? queuePolicy.policy.maxAllowedNodes : 'Unlimited' }}</span>,
+                 <span title="Max Allowed Cores">C: {{ queuePolicy.policy.maxAllowedCores
? queuePolicy.policy.maxAllowedCores : 'Unlimited' }}</span>,
+                 <span title="Max Allowed Walltime">W: {{ queuePolicy.policy.maxAllowedWalltime
? queuePolicy.policy.maxAllowedWalltime : 'Unlimited' }}</span>)
+            </template>
+        </li>
+    </ul>
+</template>
+
+<script>
+import { models } from "django-airavata-api";
+
+export default {
+  name: "compute-resource-policy-summary",
+  props: {
+    computeResourceId: {
+      type: String,
+      required: true
+    },
+    groupResourceProfile: {
+      type: models.GroupResourceProfile
+    }
+  },
+  computed: {
+    queues: function() {
+      const computeResourcePolicy = this.groupResourceProfile.getComputeResourcePolicy(
+        this.computeResourceId
+      );
+      if (computeResourcePolicy && computeResourcePolicy.allowedBatchQueues) {
+        const queues = computeResourcePolicy.allowedBatchQueues.slice();
+        queues.sort((a, b) => a.toLowerCase().localeCompare(b.toLowerCase()));
+        return queues;
+      } else {
+        return [];
+      }
+    },
+    queuePolicies: function() {
+        const result = [];
+        for (const queue of this.queues) {
+            const batchQueueResourcePolicies = this.groupResourceProfile.getBatchQueueResourcePolicies(this.computeResourceId);
+            const batchQueueResourcePolicy = batchQueueResourcePolicies.find(pol => pol.queuename
=== queue);
+            result.push({
+                name: queue,
+                policy: batchQueueResourcePolicy,
+            });
+        }
+        return result;
+    }
+  }
+};
+</script>
+
+<style scoped>
+ul {
+    padding-left: 20px;
+}
+</style>
+
+
diff --git a/django_airavata/apps/admin/static/django_airavata_admin/src/components/admin/group_resource_preferences/GroupComputeResourcePreference.vue
b/django_airavata/apps/admin/static/django_airavata_admin/src/components/admin/group_resource_preferences/GroupComputeResourcePreference.vue
index 8699553..2218d95 100644
--- a/django_airavata/apps/admin/static/django_airavata_admin/src/components/admin/group_resource_preferences/GroupComputeResourcePreference.vue
+++ b/django_airavata/apps/admin/static/django_airavata_admin/src/components/admin/group_resource_preferences/GroupComputeResourcePreference.vue
@@ -27,12 +27,16 @@
 
         <b-table hover :fields="computePreferencesFields" :items="slotProps.items"
           sort-by="computeResourceId">
-          <template slot="action" slot-scope="data">
-            <a href="#" @click.prevent="computePreferenceClickHandler(data.item.computeResourceId)">
+          <template slot="policy" slot-scope="row">
+            <compute-resource-policy-summary :compute-resource-id="row.item.computeResourceId"
+              :group-resource-profile="data"/>
+          </template>
+          <template slot="action" slot-scope="row">
+            <a href="#" @click.prevent="computePreferenceClickHandler(row.item.computeResourceId)">
               Edit
               <i class="fa fa-edit" aria-hidden="true"></i>
             </a>
-            <a href="#" class="text-danger" @click.prevent="removeComputePreference(data.item.computeResourceId)">
+            <a href="#" class="text-danger" @click.prevent="removeComputePreference(row.item.computeResourceId)">
               Delete
               <i class="fa fa-trash" aria-hidden="true"></i>
             </a>
@@ -60,6 +64,7 @@
 <script>
   import {components as comps, layouts} from 'django-airavata-common-ui'
   import {models, services} from 'django-airavata-api'
+  import ComputeResourcePolicySummary from './ComputeResourcePolicySummary.vue'
 
   export default {
     name: "group-compute-resource-preference",
@@ -100,6 +105,18 @@
             formatter: (value) => this.getComputeResourceName(value),
           },
           {
+            label: 'Username',
+            key: 'loginUserName'
+          },
+          {
+            label: 'Allocation',
+            key: 'allocationProjectNumber'
+          },
+          {
+            label: 'Policy',
+            key: 'policy', // custom rendering
+          },
+          {
             label: 'Action',
             key: 'action',
           },
@@ -112,6 +129,7 @@
     components: {
       "share-button": comps.ShareButton,
       "list-layout": layouts.ListLayout,
+      ComputeResourcePolicySummary,
     },
     computed: {
       modalSelectComputeResourceOkDisabled: function() {


Mime
View raw message