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:41 UTC
[airavata-django-portal] 03/04: AIRAVATA-2727 Removing,
no longer used
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>