You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by ma...@apache.org on 2018/08/16 13:19:38 UTC
[airavata-django-portal] branch master updated (6d11273 -> 6d6d0ac)
This is an automated email from the ASF dual-hosted git repository.
machristie pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/airavata-django-portal.git.
from 6d11273 Updated to a more complete project README
new dce54e0 AIRAVATA-2727 Display name of group resource profile, compute preference
new 065e78d AIRAVATA-2727 Convert batch queue policy max values to integers
new cce53cd AIRAVATA-2727 Removing, no longer used
new 6d6d0ac AIRAVATA-2727 Credential token editor
The 4 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.../BatchQueueResourcePolicy.vue | 7 ++
.../ComputePreference.vue | 44 ++++++-
.../ComputeResourcePolicy.vue | 138 ---------------------
.../GroupComputeResourcePreference.vue | 5 +-
django_airavata/apps/api/serializers.py | 16 ++-
.../api/static/django_airavata_api/js/index.js | 3 +
.../django_airavata_api/js/models/BaseEnum.js | 10 +-
.../django_airavata_api/js/models/BaseModel.js | 9 +-
.../js/models/CredentialSummary.js | 25 ++++
.../django_airavata_api/js/models/SummaryType.js | 9 ++
.../django_airavata_api/js/service_config.js | 10 +-
django_airavata/apps/api/thrift_utils.py | 27 +++-
django_airavata/apps/api/urls.py | 2 +
django_airavata/apps/api/views.py | 10 ++
14 files changed, 159 insertions(+), 156 deletions(-)
delete mode 100644 django_airavata/apps/admin/static/django_airavata_admin/src/components/admin/group_resource_preferences/ComputeResourcePolicy.vue
create mode 100644 django_airavata/apps/api/static/django_airavata_api/js/models/CredentialSummary.js
create mode 100644 django_airavata/apps/api/static/django_airavata_api/js/models/SummaryType.js
[airavata-django-portal] 03/04: AIRAVATA-2727 Removing,
no longer used
Posted by ma...@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 cce53cd5b13737749e5cc8d2ccc37cf50068aee3
Author: Marcus Christie <ma...@iu.edu>
AuthorDate: Wed Aug 15 12:54:10 2018 -0400
AIRAVATA-2727 Removing, no longer used
---
.../ComputeResourcePolicy.vue | 138 ---------------------
1 file changed, 138 deletions(-)
diff --git a/django_airavata/apps/admin/static/django_airavata_admin/src/components/admin/group_resource_preferences/ComputeResourcePolicy.vue b/django_airavata/apps/admin/static/django_airavata_admin/src/components/admin/group_resource_preferences/ComputeResourcePolicy.vue
deleted file mode 100644
index cbf567a..0000000
--- a/django_airavata/apps/admin/static/django_airavata_admin/src/components/admin/group_resource_preferences/ComputeResourcePolicy.vue
+++ /dev/null
@@ -1,138 +0,0 @@
-<template>
- <transition name="fade">
- <div>
- <div class="entry">
- <div class="heading">Batch Queues</div>
- <div v-for="batchQueue,index in batchQueues" v-bind:key="index">
- <input type="checkbox" v-model="batchQueues[index].selected"/>
- <label>{{batchQueue.name}}</label>
- <batch-queue-resource-policy v-if="resourcePolicies[index]"
- v-model="resourcePolicies[index]"></batch-queue-resource-policy>
- </div>
- </div>
- </div>
- </transition>
-</template>
-
-<script>
- import TabSubSection from '../../tabs/TabSubSection'
- import ComputeResourcePolicy from './ComputeResourcePolicy'
- import BatchQueueResourcePolicy from './BatchQueueResourcePolicy'
- import VModelMixin from '../../commons/vmodel_mixin'
-
- import Vue from 'vue';
-
- export default {
- name: "compute-resource-policy",
- components: {
- TabSubSection,
- ComputeResourcePolicy,
- BatchQueueResourcePolicy
- },
- data: function () {
- return {
- resourcePolicies: [],
- batchQueues: [],
- defaultBatchQueueValues: [],
- data: this.value
- }
- },
- props: {
- computeResource: {
- default: null,
- required: true
- }
- },
- mixins: [VModelMixin],
- methods: {
- parseComputeResource: function () {
- console.log("Compute Resource Policy", this.computeResource.batchQueues.length);
- let defaultBatchQueueValues = [];
- this.batchQueues = this.computeResource.batchQueues.map((batchQueue) => {
- defaultBatchQueueValues.push({
- maxAllowedCores: batchQueue.defaultCPUCount,
- maxAllowedNodes: batchQueue.defaultNodeCount,
- maxAllowedWalltime: batchQueue.defaultWalltime,
- queuename: batchQueue.queueName
- });
- this.defaultBatchQueueValues = defaultBatchQueueValues;
- return {
- name: batchQueue.queueName,
- selected: false,
- batchQueueResourcePolicy: null
- }
- });
- this.data.batchQueueResourcePolicies.forEach(value => {
- for (let index in this.batchQueues) {
- let queue = this.batchQueues[index];
- if (queue.name == value.queuename) {
- queue.selected = true;
- this.resourcePolicies[index] = value;
- break;
- }
- }
- });
- },
- createBatchQueue: function (index) {
- if (index >= 0) {
- return this.defaultBatchQueueValues[index];
- }
- let batchQueuePreference = {
- maxAllowedNodes: null,
- maxAllowedCores: null,
- maxAllowedWalltime: null,
- queuename: queueName
- }
- return batchQueuePreference;
- },
- updateBatchQueues: function (data) {
- for (let index in this.batchQueues) {
- let batchQueue = this.batchQueues[index];
- if (batchQueue.selected) {
- if (data.batchQueueResourcePolicies && !this.resourcePolicies[index]) {
- for (let val of data.batchQueueResourcePolicies) {
- if (val.queuename == batchQueue.name) {
- Vue.set(this.resourcePolicies, index, val);
- }
- }
- }
- if (!this.resourcePolicies[index]) {
- Vue.set(this.resourcePolicies, index, this.createBatchQueue(index));
- }
- if (this.data.allowedBatchQueues.indexOf(batchQueue.name) < 0) {
- this.data.allowedBatchQueues.push(batchQueue.name)
- }
- } else if (this.resourcePolicies[index]) {
- Vue.delete(this.resourcePolicies, index);
- this.data.allowedBatchQueues = this.data.allowedBatchQueues.filter((batchQueueName) => batchQueueName != batchQueue.name);
- }
- }
- }
- },
- watch: {
- batchQueues: {
- handler: function (newValue) {
- this.updateBatchQueues(newValue);
- },
- deep: true
- },
- resourcePolicies: {
- handler: function (newValue) {
- let resourcePolicies = [];
- for (let prop in newValue) {
- resourcePolicies.push(this.resourcePolicies[prop]);
- }
- this.data.batchQueueResourcePolicies = resourcePolicies;
- },
- deep: true
- },
- computeResource:function (newValue) {
- this.parseComputeResource();
- }
- }
- }
-</script>
-
-<style scoped>
-
-</style>
[airavata-django-portal] 02/04: AIRAVATA-2727 Convert batch queue
policy max values to integers
Posted by ma...@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 065e78d11d45cdbbf8170878741bcbc3886eed66
Author: Marcus Christie <ma...@iu.edu>
AuthorDate: Wed Aug 15 12:51:40 2018 -0400
AIRAVATA-2727 Convert batch queue policy max values to integers
---
.../admin/group_resource_preferences/BatchQueueResourcePolicy.vue | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/django_airavata/apps/admin/static/django_airavata_admin/src/components/admin/group_resource_preferences/BatchQueueResourcePolicy.vue b/django_airavata/apps/admin/static/django_airavata_admin/src/components/admin/group_resource_preferences/BatchQueueResourcePolicy.vue
index a40aeb4..9b9c723 100644
--- a/django_airavata/apps/admin/static/django_airavata_admin/src/components/admin/group_resource_preferences/BatchQueueResourcePolicy.vue
+++ b/django_airavata/apps/admin/static/django_airavata_admin/src/components/admin/group_resource_preferences/BatchQueueResourcePolicy.vue
@@ -5,6 +5,7 @@
<b-form-input id="max-allowed-nodes" type="number"
v-model="data.maxAllowedNodes" @input="policyUpdated"
min="1" :max="batchQueue.maxNodes"
+ :formatter="numberFormatter"
:placeholder="'Max Nodes: ' + batchQueue.maxNodes">
</b-form-input>
</b-form-group>
@@ -14,6 +15,7 @@
<b-form-input id="max-allowed-cores" type="number"
v-model="data.maxAllowedCores" @input="policyUpdated"
min="1" :max="batchQueue.maxProcessors"
+ :formatter="numberFormatter"
:placeholder="'Max Cores: ' + batchQueue.maxProcessors">
</b-form-input>
</b-form-group>
@@ -23,6 +25,7 @@
<b-form-input id="max-allowed-walltime" type="number"
v-model="data.maxAllowedWalltime" @input="policyUpdated"
min="1" :max="batchQueue.maxRunTime"
+ :formatter="numberFormatter"
:placeholder="'Max Wall Time: ' + batchQueue.maxRunTime">
</b-form-input>
</b-form-group>
@@ -58,6 +61,10 @@
} else {
this.$emit('input', null);
}
+ },
+ numberFormatter: function(value, event) {
+ const num = parseInt(value);
+ return !isNaN(num) ? num : null;
}
}
}
[airavata-django-portal] 04/04: AIRAVATA-2727 Credential token
editor
Posted by ma...@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 6d6d0ac0a98e5dce7f161a599ef01a7380158d4f
Author: Marcus Christie <ma...@iu.edu>
AuthorDate: Wed Aug 15 15:31:19 2018 -0400
AIRAVATA-2727 Credential token editor
---
.../ComputePreference.vue | 31 +++++++++++++++++++++-
django_airavata/apps/api/serializers.py | 16 +++++++----
.../api/static/django_airavata_api/js/index.js | 3 +++
.../django_airavata_api/js/models/BaseEnum.js | 10 ++++---
.../django_airavata_api/js/models/BaseModel.js | 9 +++++--
.../js/models/CredentialSummary.js | 25 +++++++++++++++++
.../django_airavata_api/js/models/SummaryType.js | 9 +++++++
.../django_airavata_api/js/service_config.js | 10 ++++++-
django_airavata/apps/api/thrift_utils.py | 27 +++++++++++++++++--
django_airavata/apps/api/urls.py | 2 ++
django_airavata/apps/api/views.py | 10 +++++++
11 files changed, 137 insertions(+), 15 deletions(-)
diff --git a/django_airavata/apps/admin/static/django_airavata_admin/src/components/admin/group_resource_preferences/ComputePreference.vue b/django_airavata/apps/admin/static/django_airavata_admin/src/components/admin/group_resource_preferences/ComputePreference.vue
index a92ec70..a43a971 100644
--- a/django_airavata/apps/admin/static/django_airavata_admin/src/components/admin/group_resource_preferences/ComputePreference.vue
+++ b/django_airavata/apps/admin/static/django_airavata_admin/src/components/admin/group_resource_preferences/ComputePreference.vue
@@ -17,6 +17,15 @@
v-model="data.loginUserName">
</b-form-input>
</b-form-group>
+ <b-form-group label="SSH Credential" label-for="credential-store-token">
+ <b-form-select id="credential-store-token"
+ v-model="data.resourceSpecificCredentialStoreToken"
+ :options="credentialStoreTokenOptions">
+ <template slot="first">
+ <option :value="null"><em>Use this profile's default SSH credential</em></option>
+ </template>
+ </b-form-select>
+ </b-form-group>
<b-form-group label="Allocation Project Number" label-for="allocation-number">
<b-form-input id="allocation-number" type="text"
v-model="data.allocationProjectNumber">
@@ -116,6 +125,7 @@
} else if (!this.computeResourcePolicy) {
this.createDefaultComputeResourcePolicy(computeResourcePromise);
}
+ this.fetchCredentialSummaries();
},
data: function () {
return {
@@ -126,7 +136,22 @@
computeResource: {
batchQueues: [],
jobSubmissionInterfaces: []
- }
+ },
+ credentialSummaries: [],
+ }
+ },
+ computed: {
+ credentialStoreTokenOptions: function() {
+ const options = this.credentialSummaries
+ .filter(summary => summary.type === models.SummaryType.SSH)
+ .map(summary => {
+ return {
+ value: summary.token,
+ text: summary.description
+ }
+ });
+ options.sort((a, b) => a.text.toLowerCase().localeCompare(b.text.toLowerCase()));
+ return options;
}
},
mixins: [VModelMixin],
@@ -168,6 +193,10 @@
return this.computeResource = value;
});
},
+ fetchCredentialSummaries: function() {
+ return services.CredentialSummaryService.list()
+ .then(summaries => this.credentialSummaries = summaries);
+ },
save: function() {
let groupResourceProfile = this.localGroupResourceProfile.clone();
groupResourceProfile.mergeComputeResourcePreference(this.data, this.localComputeResourcePolicy, this.localBatchQueueResourcePolicies);
diff --git a/django_airavata/apps/api/serializers.py b/django_airavata/apps/api/serializers.py
index 3ccd9d8..a174565 100644
--- a/django_airavata/apps/api/serializers.py
+++ b/django_airavata/apps/api/serializers.py
@@ -15,13 +15,14 @@ from airavata.model.appcatalog.appdeployment.ttypes import (ApplicationDeploymen
SetEnvPaths)
from airavata.model.appcatalog.appinterface.ttypes import \
ApplicationInterfaceDescription
-from airavata.model.appcatalog.computeresource.ttypes \
- import (BatchQueue,
- ComputeResourceDescription)
+from airavata.model.appcatalog.computeresource.ttypes import (BatchQueue,
+ ComputeResourceDescription)
from airavata.model.appcatalog.groupresourceprofile.ttypes import \
GroupResourceProfile
from airavata.model.application.io.ttypes import (InputDataObjectType,
OutputDataObjectType)
+from airavata.model.credential.store.ttypes import (CredentialSummary,
+ SummaryType)
from airavata.model.data.replica.ttypes import (DataProductModel,
DataReplicaLocationModel)
from airavata.model.experiment.ttypes import (ExperimentModel,
@@ -32,8 +33,7 @@ from airavata.model.status.ttypes import ExperimentStatus
from airavata.model.user.ttypes import UserProfile
from airavata.model.workspace.ttypes import Project
-from . import datastore
-from . import thrift_utils
+from . import datastore, thrift_utils
log = logging.getLogger(__name__)
@@ -615,3 +615,9 @@ class SharedEntitySerializer(serializers.Serializer):
def get_isOwner(self, shared_entity):
request = self.context['request']
return shared_entity['owner'].userId == request.user.username
+
+
+class CredentialSummarySerializer(
+ thrift_utils.create_serializer_class(CredentialSummary)):
+ type = thrift_utils.ThriftEnumField(SummaryType)
+ persistedTime = UTCPosixTimestampDateTimeField()
diff --git a/django_airavata/apps/api/static/django_airavata_api/js/index.js b/django_airavata/apps/api/static/django_airavata_api/js/index.js
index 49f08c1..0e3502b 100644
--- a/django_airavata/apps/api/static/django_airavata_api/js/index.js
+++ b/django_airavata/apps/api/static/django_airavata_api/js/index.js
@@ -17,6 +17,7 @@ import OutputDataObjectType from './models/OutputDataObjectType'
import Project from './models/Project'
import ResourcePermissionType from './models/ResourcePermissionType'
import SharedEntity from './models/SharedEntity'
+import SummaryType from './models/SummaryType'
import UserPermission from './models/UserPermission'
import ApplicationDeploymentService from './services/ApplicationDeploymentService'
@@ -60,6 +61,7 @@ exports.models = {
Project,
ResourcePermissionType,
SharedEntity,
+ SummaryType,
UserPermission,
}
@@ -67,6 +69,7 @@ exports.services = {
ApplicationDeploymentService,
ApplicationInterfaceService,
ApplicationModuleService,
+ CredentialSummaryService: ServiceFactory.service("CredentialSummaries"),
ExperimentService,
ExperimentSearchService,
FullExperimentService,
diff --git a/django_airavata/apps/api/static/django_airavata_api/js/models/BaseEnum.js b/django_airavata/apps/api/static/django_airavata_api/js/models/BaseEnum.js
index bb11276..d6d9f07 100644
--- a/django_airavata/apps/api/static/django_airavata_api/js/models/BaseEnum.js
+++ b/django_airavata/apps/api/static/django_airavata_api/js/models/BaseEnum.js
@@ -1,13 +1,15 @@
export default class BaseEnum {
- constructor(name, value) {
+ // TODO: add parameter
+ constructor(name, value, writeName=false) {
this.name = name;
this.value = value;
+ this.writeName = writeName;
// immutable
Object.freeze(this);
}
toJSON() {
- return this.value;
+ return this.writeName ? this.name : this.value;
}
static byName(name) {
return this.values.find(x => x.name === name);
@@ -16,8 +18,8 @@ export default class BaseEnum {
return this.values.find(x => x.value === value);
}
// This must be called to initialize static methods on the Enum subclass
- static init(names) {
- const enums = names.map((name, index) => new this(name, index));
+ static init(names, writeName=false) {
+ const enums = names.map((name, index) => new this(name, index, writeName));
Object.freeze(enums);
Object.defineProperty(this, 'values', {get: function() { return enums;}});
this.values.forEach(v => this[v.name] = v);
diff --git a/django_airavata/apps/api/static/django_airavata_api/js/models/BaseModel.js b/django_airavata/apps/api/static/django_airavata_api/js/models/BaseModel.js
index 56cf29f..43cc5a6 100644
--- a/django_airavata/apps/api/static/django_airavata_api/js/models/BaseModel.js
+++ b/django_airavata/apps/api/static/django_airavata_api/js/models/BaseModel.js
@@ -60,8 +60,13 @@ export default class BaseModel {
if (fieldValue instanceof BaseEnum){
return fieldValue;
}
- // Otherwise it is an integer that we need to convert to enum
- return modelClass.byValue(fieldValue);
+ if (typeof fieldValue === 'string') {
+ // convert by name if type is string
+ return modelClass.byName(fieldValue);
+ } else {
+ // Otherwise it is an integer that we need to convert to enum
+ return modelClass.byValue(fieldValue);
+ }
} else {
return new modelClass(fieldValue);
}
diff --git a/django_airavata/apps/api/static/django_airavata_api/js/models/CredentialSummary.js b/django_airavata/apps/api/static/django_airavata_api/js/models/CredentialSummary.js
new file mode 100644
index 0000000..a85d89e
--- /dev/null
+++ b/django_airavata/apps/api/static/django_airavata_api/js/models/CredentialSummary.js
@@ -0,0 +1,25 @@
+import BaseModel from './BaseModel'
+import SummaryType from './SummaryType'
+
+const FIELDS = [
+ {
+ name: 'type',
+ type: SummaryType,
+ },
+ 'gatewayId',
+ 'username',
+ 'publicKey',
+ {
+ name: 'persistedTime',
+ type: Date,
+ },
+ 'token',
+ 'description',
+];
+
+export default class CredentialSummary extends BaseModel {
+
+ constructor(data = {}) {
+ super(FIELDS, data);
+ }
+}
diff --git a/django_airavata/apps/api/static/django_airavata_api/js/models/SummaryType.js b/django_airavata/apps/api/static/django_airavata_api/js/models/SummaryType.js
new file mode 100644
index 0000000..7e01256
--- /dev/null
+++ b/django_airavata/apps/api/static/django_airavata_api/js/models/SummaryType.js
@@ -0,0 +1,9 @@
+import BaseEnum from './BaseEnum'
+
+export default class SummaryType extends BaseEnum {
+}
+SummaryType.init([
+ 'SSH',
+ 'PASSWD',
+ 'CERT',
+], true);
diff --git a/django_airavata/apps/api/static/django_airavata_api/js/service_config.js b/django_airavata/apps/api/static/django_airavata_api/js/service_config.js
index 86074ed..6b62431 100644
--- a/django_airavata/apps/api/static/django_airavata_api/js/service_config.js
+++ b/django_airavata/apps/api/static/django_airavata_api/js/service_config.js
@@ -1,4 +1,5 @@
import ApplicationDeploymentDescription from './models/ApplicationDeploymentDescription'
+import CredentialSummary from './models/CredentialSummary'
import Group from './models/Group'
import GroupResourceProfile from './models/GroupResourceProfile'
import SharedEntity from './models/SharedEntity'
@@ -58,6 +59,13 @@ export default {
}],
modelClass: ApplicationDeploymentDescription,
},
+ "CredentialSummaries": {
+ url: "/api/credential-summaries/",
+ viewSet: [{
+ name: "list"
+ }],
+ modelClass: CredentialSummary,
+ },
"GroupResourceProfiles": {
url: "/api/group-resource-profiles/",
viewSet: true,
@@ -82,4 +90,4 @@ export default {
}],
modelClass: UserProfile,
},
-}
\ No newline at end of file
+}
diff --git a/django_airavata/apps/api/thrift_utils.py b/django_airavata/apps/api/thrift_utils.py
index dd4442a..bbff521 100644
--- a/django_airavata/apps/api/thrift_utils.py
+++ b/django_airavata/apps/api/thrift_utils.py
@@ -5,8 +5,10 @@ import copy
import datetime
from django.utils import six
-from rest_framework.serializers import CharField, BooleanField, DecimalField, IntegerField, Serializer, \
- DictField, SerializerMetaclass, ListField, DateTimeField
+from rest_framework.serializers import (BooleanField, CharField, DateTimeField,
+ DecimalField, DictField, Field,
+ IntegerField, ListField, Serializer,
+ SerializerMetaclass, ValidationError)
from thrift.Thrift import TType
# used to map apache thrift data types to django serializer fields
@@ -46,6 +48,27 @@ class UTCPosixTimestampDateTimeField(DateTimeField):
return int(datetime.datetime.utcnow().timestamp() * 1000)
+class ThriftEnumField(Field):
+
+ def __init__(self, enumClass, *args, **kwargs):
+ super().__init__(*args, **kwargs)
+ self.enumClass = enumClass
+
+ def to_representation(self, obj):
+ if obj is None:
+ return None
+ return self.enumClass._VALUES_TO_NAMES[obj]
+
+ def to_internal_value(self, data):
+ if self.allow_null and data is None:
+ return None
+ if data not in self.enumClass._NAMES_TO_VALUES:
+ raise ValidationError(
+ "Not an allowed name of enum {}".format(
+ self.enumClass.__name__))
+ return self.enumClass._NAMES_TO_VALUES.get(data, None)
+
+
def create_serializer(thrift_data_type, enable_date_time_conversion=False, **kwargs):
"""
Create django rest framework serializer based on the thrift data type
diff --git a/django_airavata/apps/api/urls.py b/django_airavata/apps/api/urls.py
index c6e9c56..5e4f0bf 100644
--- a/django_airavata/apps/api/urls.py
+++ b/django_airavata/apps/api/urls.py
@@ -26,6 +26,8 @@ router.register(r'shared-entities', views.SharedEntityViewSet,
base_name='shared-entity')
router.register(r'compute-resources', views.ComputeResourceViewSet,
base_name='compute-resource')
+router.register(r'credential-summaries', views.CredentialSummaryViewSet,
+ base_name='credential-summary')
app_name = 'django_airavata_api'
urlpatterns = [
diff --git a/django_airavata/apps/api/views.py b/django_airavata/apps/api/views.py
index a2f473c..f3b4359 100644
--- a/django_airavata/apps/api/views.py
+++ b/django_airavata/apps/api/views.py
@@ -869,3 +869,13 @@ class SharedEntityViewSet(mixins.RetrieveModelMixin,
self.request.airavata_client.revokeSharingOfResourceFromGroups(
self.authz_token, entity_id,
{group_id: permission_type for group_id in group_ids})
+
+
+class CredentialSummaryViewSet(mixins.ListModelMixin,
+ GenericAPIBackedViewSet):
+ serializer_class = serializers.CredentialSummarySerializer
+
+ def get_list(self):
+ # NOTE: only supported SummaryType is SSH for now
+ return self.request.airavata_client.getAllCredentialSummaryForGateway(
+ self.authz_token, SummaryType.SSH, settings.GATEWAY_ID)
[airavata-django-portal] 01/04: AIRAVATA-2727 Display name of group
resource profile, compute preference
Posted by ma...@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 dce54e0ca3538b57f52251fb2e77674362dc249a
Author: Marcus Christie <ma...@iu.edu>
AuthorDate: Wed Aug 15 12:51:06 2018 -0400
AIRAVATA-2727 Display name of group resource profile, compute preference
---
.../admin/group_resource_preferences/ComputePreference.vue | 13 +++++++++++--
.../GroupComputeResourcePreference.vue | 5 ++++-
2 files changed, 15 insertions(+), 3 deletions(-)
diff --git a/django_airavata/apps/admin/static/django_airavata_admin/src/components/admin/group_resource_preferences/ComputePreference.vue b/django_airavata/apps/admin/static/django_airavata_admin/src/components/admin/group_resource_preferences/ComputePreference.vue
index 86a08de..a92ec70 100644
--- a/django_airavata/apps/admin/static/django_airavata_admin/src/components/admin/group_resource_preferences/ComputePreference.vue
+++ b/django_airavata/apps/admin/static/django_airavata_admin/src/components/admin/group_resource_preferences/ComputePreference.vue
@@ -2,7 +2,10 @@
<div>
<div class="row">
<div class="col">
- <h1 class="h4 mb-4">Compute Preference</h1>
+ <h1 class="h4 mb-4">
+ <div v-if="localGroupResourceProfile" class="group-resource-profile-name text-muted text-uppercase"><i class="fa fa-server" aria-hidden="true"></i> {{ localGroupResourceProfile.groupResourceProfileName }}</div>
+ {{ computeResource.hostName }}
+ </h1>
</div>
</div>
<div class="row">
@@ -253,4 +256,10 @@
}
}
}
-</script>
\ No newline at end of file
+</script>
+
+<style scoped>
+.group-resource-profile-name {
+ font-size: 12px;
+}
+</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 849bb6d..206661e 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
@@ -2,7 +2,7 @@
<div>
<div class="row">
<div class="col">
- <h1 class="h4 mb-4">Group Resource Profile</h1>
+ <h1 class="h4 mb-4">{{ title }}</h1>
</div>
</div>
<div class="row">
@@ -130,6 +130,9 @@
options.sort((a, b) => a.text.toLowerCase().localeCompare(b.text.toLowerCase()));
return options;
},
+ title: function() {
+ return this.id ? this.data.groupResourceProfileName : "New Group Resource Profile";
+ }
},
methods: {
saveGroupResourceProfile: function () {