diff --git a/src/app/api/stackato-info.service.js b/src/app/api/stackato-info.service.js new file mode 100644 index 0000000000..86bb480b13 --- /dev/null +++ b/src/app/api/stackato-info.service.js @@ -0,0 +1,45 @@ +(function () { + 'use strict'; + + /** + * @description user info service + */ + angular + .module('app') + .factory('stackatoInfoService', StackatoInfoService); + + StackatoInfoService.$inject = [ + '$q', + '$cookies', + '$http', + 'app.api.apiManager' + ]; + + /** + * @memberof app + * @name app.stackatoInfoService + * @description User information service provider + * @param {object} $q - the angular $q service + * @param {object} $cookies - the angular $cookies service + * @param {object} $http - the $http service + * @param {object} apiManager - API Manager used to fetch session details + * @returns {object} The user info service + */ + function StackatoInfoService($q, $cookies, $http, apiManager) { + var sessionName = apiManager.retrieve('app.api.account').sessionName; + return { + /** + * @function stackatoInfo + * @memberof app.stackatoInfoService + * @description Fetch the user's authorisation information + * @returns {promise} A promise object + */ + stackatoInfo: function () { + if ($cookies.get(sessionName)) { + return $http.get('/pp/v1/stackato/info'); + } + return $q.reject(sessionName + ' cookie missing!'); + } + }; + } +})(); diff --git a/src/app/app.module.js b/src/app/app.module.js index 7339e0cb74..82fceffaab 100644 --- a/src/app/app.module.js +++ b/src/app/app.module.js @@ -10,7 +10,8 @@ 'app.api', 'app.event', 'app.model', - 'app.view' + 'app.view', + 'app.utils' ]) .constant('app.basePath', 'app/') .run(setTranslationLanguage); diff --git a/src/app/model/navigation/navigation.model.js b/src/app/model/navigation/navigation.model.js index 1a6f98d0f2..29bf386c94 100644 --- a/src/app/model/navigation/navigation.model.js +++ b/src/app/model/navigation/navigation.model.js @@ -15,15 +15,16 @@ 'app.model.modelManager', 'app.event.eventService', '$state', - '$rootScope' + '$rootScope', + '$log' ]; - function registerModel(modelManager, eventService, $state, $rootScope) { + function registerModel(modelManager, eventService, $state, $rootScope, $log) { /** * Register 'app.model.navigation' with the model manager service. * This model hosts the application's navigation tree. */ - modelManager.register('app.model.navigation', new NavigationModel(eventService, $state, $rootScope)); + modelManager.register('app.model.navigation', new NavigationModel(eventService, $state, $rootScope, $log)); } /** @@ -34,15 +35,16 @@ * @param {app.event.eventService} eventService - the event bus service * @param {object} $state - ui-router $state service * @param {object} $rootScope - Angular rootScope object + * @param {object} $log - angular log service * @property {app.event.eventService} eventService - the event bus service * @property {object} $state - ui-router $state service * @property {app.model.navigation} menu - the navigation model */ - function NavigationModel(eventService, $state, $rootScope) { + function NavigationModel(eventService, $state, $rootScope, $log) { var that = this; this.eventService = eventService; this.$state = $state; - this.menu = new Menu(); + this.menu = new Menu($log); this.eventService.$on(this.eventService.events.LOGIN, function () { that.onLogin(); }); @@ -109,10 +111,12 @@ * @namespace app.model.navigation.Menu * @memberof app.model.navigation * @name app.model.navigation.Menu + * @param {object} $log - angular log service * @property {string} currentState - current ui-router state */ - function Menu() { + function Menu($log) { this.currentState = null; + this.$log = $log; } // Using an array as the prototype @@ -128,13 +132,13 @@ * @param {string} href - the href / ng-router state we go to when clicking the entry. * e.g. cf.applications.list.gallery-view * @param {string} text - the displayed text of the menu item - * @param {string} icon - the icon of the menu item + * @param {number=} pos - optional position in the menu to insert at + * @param {string=} icon - the icon of the menu item * @param {string=} baseState - optional href / ng-router top-level base state e.g. cf.applications or cf.workspaces * (defaults to name) - * @param {number} pos - optional position in the menu to insert at * @returns {app.model.navigation.Menu} The navigation's Menu object */ - addMenuItem: function (name, href, text, icon, baseState, pos) { + addMenuItem: function (name, href, text, pos, icon, baseState) { var item = { name: name, href: href, @@ -145,7 +149,16 @@ items: new Menu() // sub-menu }; if (angular.isNumber(pos)) { - this.splice(pos, 0, item); + // Fill in the array to have the required number of items + // This allows out of order addMenuItem calls to work as expected + while (this.length <= pos) { + this.push(null); + } + if (this[pos] !== null) { + this.$log.error('addMenuItem: items named ' + "'" + item.name + "' and '" + this[pos].name + + "' have the same position '" + pos + "'"); + } + this.splice(pos, 1, item); } else { this.push(item); } diff --git a/src/app/model/stackato-info.model.js b/src/app/model/stackato-info.model.js new file mode 100644 index 0000000000..dede209b67 --- /dev/null +++ b/src/app/model/stackato-info.model.js @@ -0,0 +1,67 @@ +(function () { + 'use strict'; + + /** + * @namespace app.model.user-info + * @memberOf app.model + * @name user-info + * @description User model + */ + angular + .module('app.model') + .run(registerStackatoInfoModel); + + registerStackatoInfoModel.$inject = [ + 'app.model.modelManager', + 'stackatoInfoService' + ]; + + function registerStackatoInfoModel(modelManager, stackatoInfoService) { + modelManager.register('app.model.stackatoInfo', new StackatoInfo(stackatoInfoService)); + } + + /** + * @namespace app.model.userInfo.UserInfo + * @memberof app.model.userInfo + * @name app.model.userInfo.UserInfo + * @param {app.api.stackatoInfoService} stackatoInfoService - Service with which to fetch data from + * @property {app.api.stackatoInfoService} stackatoInfoService - Service with which to fetch data from + * @property {object} info - the user info data object + * @class + */ + function StackatoInfo(stackatoInfoService) { + this.stackatoInfo = stackatoInfoService; + this.info = {}; + } + + angular.extend(StackatoInfo.prototype, { + /** + * @function getStackatoInfo + * @memberof app.model.stackatoInfo.StackatoInfo + * @description Fetch the user's authorisation information per cnsi + * @returns {promise} A promise object + * @public + */ + getStackatoInfo: function () { + var that = this; + return this.stackatoInfo.stackatoInfo() + .then(function (response) { + that.onStackatoInfo(response); + return that.info; + }); + }, + + /** + * @function onLoggedIn + * @memberof app.model.account.Account + * @description Logged-in handler at model layer + * @param {object} response - the HTTP response object + * @private + */ + onStackatoInfo: function (response) { + this.info = response.data; + } + + }); + +})(); diff --git a/src/app/utils/utils.module.js b/src/app/utils/utils.module.js new file mode 100644 index 0000000000..834154c288 --- /dev/null +++ b/src/app/utils/utils.module.js @@ -0,0 +1,13 @@ +(function () { + 'use strict'; + + /** + * @namespace app.utils + * @memberof app + * @name utils + * @description Various utils such as string manipulations and size conversions + */ + angular + .module('app.utils', []); + +})(); diff --git a/src/app/utils/utils.service.js b/src/app/utils/utils.service.js new file mode 100644 index 0000000000..b7743a4528 --- /dev/null +++ b/src/app/utils/utils.service.js @@ -0,0 +1,65 @@ +(function () { + 'use strict'; + + angular + .module('app.utils') + .factory('app.utils.utilsService', utilsServiceFactory); + + utilsServiceFactory.$inject = [ + '$log' + ]; + + /** + * @namespace app.utils.utilsService + * @memberof app.utils + * @name utilsService + * @description Various utility functions + * @returns {object} the utils service + */ + function utilsServiceFactory($log) { + return { + mbToHumanSize: mbToHumanSize, + chainStateResolve: chainStateResolve + }; + + function mbToHumanSize(sizeMb) { + if (angular.isUndefined(sizeMb)) { + return ''; + } + if (sizeMb === -1) { + return '∞'; + } + if (sizeMb > 1048576) { + return (sizeMb / 1048576).toFixed(1) + ' TB'; + } + if (sizeMb > 1024) { + return (sizeMb / 1024).toFixed(1) + ' GB'; + } + return sizeMb + ' MB'; + } + + /** + * Chain promise returning init functions for ensuring in-order Controller initialisation of nested states + * NB: this uses custom state data to mimick ui-router's resolve functionality. + * Unfortunately we cannot reliably use ui-router's built-in resolve because of the way we register plugins + * during the run phase instead of the config phase. + * @param {Object} $state - The ui-router $state for the current state + * @param {function} initFunc - The promise returning init function for setting up the current state + * */ + function chainStateResolve($state, initFunc) { + $state.current.data = $state.current.data || {}; + var parentPromise = $state.current.data.initialized; + var thisPromise; + if (_.isUndefined(parentPromise)) { + $log.debug('Init promise chain starting from state ' + $state.current.name); + thisPromise = initFunc(); + } else { + $log.debug('Init promise chain continued by state ' + $state.current.name); + thisPromise = parentPromise.then(initFunc); + } + $state.current.data.initialized = thisPromise; + } + + } + +})(); diff --git a/src/app/view/endpoints/clusters/cluster/detail/cluster-detail-organizations.html b/src/app/view/endpoints/clusters/cluster/detail/cluster-detail-organizations.html new file mode 100644 index 0000000000..8a95384f43 --- /dev/null +++ b/src/app/view/endpoints/clusters/cluster/detail/cluster-detail-organizations.html @@ -0,0 +1,13 @@ +
+ +
+
+
An error occurred retrieving organizations
+
+
+
+ +
+
+ + diff --git a/src/app/view/endpoints/clusters/cluster/detail/cluster-detail-users.html b/src/app/view/endpoints/clusters/cluster/detail/cluster-detail-users.html new file mode 100644 index 0000000000..04300d7e84 --- /dev/null +++ b/src/app/view/endpoints/clusters/cluster/detail/cluster-detail-users.html @@ -0,0 +1,36 @@ +
+
+
+ + + + + + + + + + + + + + + + + +
USERS({{ clusterUsersController.users.length }})Organization RolesACTION
{{ user.entity.username }} +
{{ orgRole.name }}: {{ orgRole.role }}
+
None assigned
+
+ + +
+
+ +
+
diff --git a/src/app/view/endpoints/clusters/cluster/detail/cluster-detail.html b/src/app/view/endpoints/clusters/cluster/detail/cluster-detail.html index 2a002a9e85..5cb73a1950 100644 --- a/src/app/view/endpoints/clusters/cluster/detail/cluster-detail.html +++ b/src/app/view/endpoints/clusters/cluster/detail/cluster-detail.html @@ -1 +1,70 @@ -

Cluster Summary: {{ clusterController.guid }}

+
+

{{ clusterController.cluster.name }}

+ +
+
+ Summary + + + Edit + +
+ +
+
+
+
Total Applications
+
+ {{ clusterController.totalApps }} +
+
Total Memory
+
+ {{ clusterController.totalMemoryUsed }} +
+
+
+
+
+
CF Endpoint URL
+
+ {{ clusterController.cluster.api_endpoint.Scheme }}://{{ clusterController.cluster.api_endpoint.Host }} +
+
CF Interactions
+
+ + CLI Commands + +
+
+
+
+
+ + + + +
+ + + + diff --git a/src/app/view/endpoints/clusters/cluster/detail/cluster-detail.module.js b/src/app/view/endpoints/clusters/cluster/detail/cluster-detail.module.js index 52c0ed8969..a8e2f79900 100644 --- a/src/app/view/endpoints/clusters/cluster/detail/cluster-detail.module.js +++ b/src/app/view/endpoints/clusters/cluster/detail/cluster-detail.module.js @@ -2,7 +2,10 @@ 'use strict'; angular - .module('app.view.endpoints.clusters.cluster.detail', []) + .module('app.view.endpoints.clusters.cluster.detail', [ + 'app.view.endpoints.clusters.cluster.detail.organizations', + 'app.view.endpoints.clusters.cluster.detail.users' + ]) .config(registerRoute); registerRoute.$inject = [ @@ -12,20 +15,111 @@ function registerRoute($stateProvider) { $stateProvider.state('endpoint.clusters.cluster.detail', { url: '', + abstract: true, templateUrl: 'app/view/endpoints/clusters/cluster/detail/cluster-detail.html', controller: ClusterDetailController, - controllerAs: 'clusterController' + controllerAs: 'clusterController', + data: {} }); } ClusterDetailController.$inject = [ 'app.model.modelManager', - '$stateParams' + '$stateParams', + '$state', + '$scope', + '$q', + '$log', + 'app.utils.utilsService' ]; - function ClusterDetailController(modelManager, $stateParams) { + function ClusterDetailController(modelManager, $stateParams, $state, $scope, $q, $log, utils) { + var that = this; this.guid = $stateParams.guid; + + this.$scope = $scope; + this.organizationModel = modelManager.retrieve('cloud-foundry.model.organization'); + + // TODO: use model cache instead + this.organizations = []; + this.totalApps = 0; + + // Get the cluster info + this.cluster = { + name: '', + api_endpoint: '' + }; + + this.cnsiModel = modelManager.retrieve('app.model.serviceInstance.user'); + + function init() { + var listCnsisP = that.cnsiModel.list().then(function (registeredInstances) { + that.cluster = registeredInstances[that.guid]; + }); + + var listOrgsDetailsP = that.organizationModel.listAllOrganizations(that.guid, {}).then(function (orgs) { + that.organizations = []; + that.updateTotalApps(); + var promises = []; + _.forEach(orgs, function (org) { + var promise = that.organizationModel.getOrganizationDetails(that.guid, org).then(function (orgDetails) { + that.organizations.push(orgDetails); + + that.updateTotalApps(); + + // Sort organizations by created date + that.organizations.sort(function (o1, o2) { + return o1.created_at - o2.created_at; + }); + }); + promises.push(promise); + }); + return $q.all(promises); + }).catch(function (error) { + $log.error('Error while listing organizations', error); + }); + + return $q.all([listCnsisP, listOrgsDetailsP]).then(function () { + $log.debug('ClusterUsersController finished init'); + }); + } + + this.clusterActions = [ + { + name: gettext('Create Organization'), + disabled: true, + execute: function () { + }, + icon: 'helion-icon-lg helion-icon helion-icon-Tree' + }, + { + name: gettext('Create Space'), + disabled: true, + execute: function () { + }, + icon: 'helion-icon-lg helion-icon helion-icon-Tree' + }, + { + name: gettext('Assign User(s)'), + disabled: true, + execute: function () { + }, + icon: 'helion-icon-lg helion-icon helion-icon-Add_user' + } + ]; + + this.updateTotalApps = function () { + that.totalApps = 0; + var totalMemoryMb = 0; + _.forEach(that.organizations, function (orgDetails) { + that.totalApps += orgDetails.totalApps; + totalMemoryMb += orgDetails.memUsed; + }); + that.totalMemoryUsed = utils.mbToHumanSize(totalMemoryMb); + }; + + utils.chainStateResolve($state, init); + } - angular.extend(ClusterDetailController.prototype, {}); })(); diff --git a/src/app/view/endpoints/clusters/cluster/detail/cluster-detail.organizations.module.js b/src/app/view/endpoints/clusters/cluster/detail/cluster-detail.organizations.module.js new file mode 100644 index 0000000000..6321e455a5 --- /dev/null +++ b/src/app/view/endpoints/clusters/cluster/detail/cluster-detail.organizations.module.js @@ -0,0 +1,27 @@ +(function () { + 'use strict'; + + angular + .module('app.view.endpoints.clusters.cluster.detail.organizations', []) + .config(registerRoute); + + registerRoute.$inject = [ + '$stateProvider' + ]; + + function registerRoute($stateProvider) { + $stateProvider.state('endpoint.clusters.cluster.detail.organizations', { + url: '/organizations', + templateUrl: 'app/view/endpoints/clusters/cluster/detail/cluster-detail-organizations.html', + controller: ClusterOrganizationsController, + controllerAs: 'clusterOrganizationsController' + }); + } + + ClusterOrganizationsController.$inject = []; + + function ClusterOrganizationsController() { + } + + angular.extend(ClusterOrganizationsController.prototype, {}); +})(); diff --git a/src/app/view/endpoints/clusters/cluster/detail/cluster-detail.scss b/src/app/view/endpoints/clusters/cluster/detail/cluster-detail.scss new file mode 100644 index 0000000000..35889a33bc --- /dev/null +++ b/src/app/view/endpoints/clusters/cluster/detail/cluster-detail.scss @@ -0,0 +1,139 @@ +@import 'organization-tile/organization-tile'; + +.cluster-detail { + + .cluster-summary-panel { + .dl-horizontal > dd { + text-transform: none; + font-weight: 500; + .btn { + padding: 0; + font-size: inherit; + text-transform: none; + } + } + } + + .application-nav { + margin-bottom: 15px; + } + + .organizations-card-container { + + $organizations-card-max-width: 420px; + $organizations-card-layout-steps: 5; + + width: 100%; + display: flex; + flex-flow: row wrap; + + .organization-card { + padding-right: 10px; + padding-left: 10px; + + position: relative; + float: left; + min-height: 1px; + + // Set flex-base in percentages for all layout steps + flex: 1 1 100%; + + // Many columns + @for $i from 2 through $organizations-card-layout-steps { + @media (min-width: $i * $organizations-card-max-width) { + flex: 1 1 percentage(1/$i) + } + } + + // Inside the cards, give more room to the value than the label + @media (min-width: 2 * $organizations-card-max-width) { + gallery-card { + .card .dl-horizontal dd { + margin-left: 100px; + text-align: right; + } + .dl-horizontal dt { + width: 140px; + } + } + } + + // Pull the percent-gauge up + .percent-gauge { + padding-top: 0; + .percent-gauge-quota-bar { + margin-top: 0; + } + } + + } + + // Ensure the last card in every row doesn't have right-padding + @for $i from $organizations-card-layout-steps - 1 through 1 { + @media (min-width: $i * $organizations-card-max-width) and (max-width: $organizations-card-max-width + $i * $organizations-card-max-width - 1) { + >:nth-child(#{$i}n) { + padding-right: 0; + } + >:nth-child(#{$i}n+1) { + padding-left: 0; + } + } + } + + @media (min-width: $organizations-card-layout-steps * $organizations-card-max-width) { + >:nth-child(#{$organizations-card-layout-steps}n) { + padding-right: 0; + } + >:nth-child(#{$organizations-card-layout-steps}n+1) { + padding-left: 0; + } + } + + >:last-child { + padding-right: 0; + } + + } + + .cluster-users-table { + > div { + padding-top: 60px; + } + + .select-all-checkbox { + .checkbox-input { + margin-bottom: -5px; + } + } + + th { + text-transform: none; + } + + .user-name { + white-space: nowrap; + min-width: 200px; + } + + .roles-list { + + .role-pill { + cursor: default; + float: left; + margin: 0 8px 8px 0; + padding: 0 4px 4px 4px; + border: solid 2px #ccc; + border-radius: 5px; + } + + i.helion-icon.close-icon { + font-size: 12px; + font-weight: bolder; + color: #aaa; + margin-left: 10px; + } + } + + } + +} diff --git a/src/app/view/endpoints/clusters/cluster/detail/cluster-detail.users.module.js b/src/app/view/endpoints/clusters/cluster/detail/cluster-detail.users.module.js new file mode 100644 index 0000000000..6e93e0a526 --- /dev/null +++ b/src/app/view/endpoints/clusters/cluster/detail/cluster-detail.users.module.js @@ -0,0 +1,110 @@ +(function () { + 'use strict'; + + angular + .module('app.view.endpoints.clusters.cluster.detail.users', []) + .config(registerRoute); + + registerRoute.$inject = [ + '$stateProvider' + ]; + + function registerRoute($stateProvider) { + $stateProvider.state('endpoint.clusters.cluster.detail.users', { + url: '/users', + templateUrl: 'app/view/endpoints/clusters/cluster/detail/cluster-detail-users.html', + controller: ClusterUsersController, + controllerAs: 'clusterUsersController' + }); + } + + ClusterUsersController.$inject = [ + 'app.model.modelManager', + '$stateParams', + '$state', + '$log', + 'app.utils.utilsService' + ]; + + function ClusterUsersController(modelManager, $stateParams, $state, $log, utils) { + var that = this; + + this.guid = $stateParams.guid; + this.users = []; + this.usersModel = modelManager.retrieve('cloud-foundry.model.users'); + this.organizationModel = modelManager.retrieve('cloud-foundry.model.organization'); + + this.userRoles = {}; + + this.selectAllUsers = false; + this.selectedUsers = {}; + + function init() { + return that.usersModel.listAllUsers(that.guid, {}).then(function (res) { + + $log.debug('Received list of Users: ', res); + that.users = res; + + // For each user, get its roles in all organization + _.forEach(that.users, function (aUser) { + var myRoles = {}; + _.forEach(that.organizationModel.organizations[that.guid], function (org) { + var roles = org.roles[aUser.metadata.guid]; + if (!_.isUndefined(roles)) { + myRoles[org.details.name] = roles; + } + }); + that.userRoles[aUser.metadata.guid] = []; + + // Format that in an array of pairs for direct use in the template + _.forEach(myRoles, function (orgRoles, orgName) { + _.forEach(orgRoles, function (role) { + that.userRoles[aUser.metadata.guid].push({ + name: orgName, + role: role // TODO: use role name mapping from organizations-model + }); + }); + }); + + }); + }).then(function () { + $log.debug('ClusterUsersController finished init'); + }); + } + + this.userActions = [ + { + name: gettext('Manage Roles'), + disabled: true, + execute: function (aUser) { + $log.info('TODO: implement manage roles', aUser); + } + }, + { + name: gettext('Remove all roles'), + disabled: true, + execute: function (aUser) { + $log.info('TODO: implement remove all roles', aUser); + } + } + ]; + + this.getOrganizationsRoles = function (aUser) { + return that.userRoles[aUser.metadata.guid]; + }; + + this.selectAllChanged = function () { + if (that.selectAllUsers) { + _.forEach(that.visibleUsers, function (user) { + that.selectedUsers[user.metadata.guid] = true; + }); + } else { + that.selectedUsers = {}; + } + }; + + // Ensure the parent state is fully initialised before we start our own init + utils.chainStateResolve($state, init); + } + +})(); diff --git a/src/app/view/endpoints/clusters/cluster/detail/organization-tile/organization-tile.directive.js b/src/app/view/endpoints/clusters/cluster/detail/organization-tile/organization-tile.directive.js new file mode 100644 index 0000000000..2c0f4ac249 --- /dev/null +++ b/src/app/view/endpoints/clusters/cluster/detail/organization-tile/organization-tile.directive.js @@ -0,0 +1,101 @@ +(function () { + 'use strict'; + + angular + .module('app.view.endpoints') + .directive('organizationTile', OrganizationTile); + + OrganizationTile.$inject = []; + + function OrganizationTile() { + return { + bindToController: true, + controller: OrganizationTileController, + controllerAs: 'organizationTileCtrl', + scope: { + organization: '=' + }, + templateUrl: 'app/view/endpoints/clusters/cluster/detail/organization-tile/organization-tile.html' + }; + } + + OrganizationTileController.$inject = [ + '$state', + 'app.utils.utilsService' + ]; + + /** + * @name OrganizationTileController + * @constructor + * @param {object} $state - the angular $state service + * @param {object} utils - our utils service + * @property {Array} actions - collection of relevant actions that can be executed against cluster + */ + function OrganizationTileController($state, utils) { + this.$state = $state; + this.actions = []; + + // The list of all organization roles is: org_user, org_manager, org_auditor, billing_manager + var ROLE_TO_STRING = { + org_user: gettext('User'), + org_manager: gettext('Manager'), + org_auditor: gettext('Auditor'), + billing_manager: gettext('Billing Manager') + }; + + // Present memory usage + var usedMemHuman = utils.mbToHumanSize(this.organization.memUsed); + var memQuotaHuman = utils.mbToHumanSize(this.organization.memQuota); + this.memory = usedMemHuman + ' / ' + memQuotaHuman; + + // Present instances utilisation + var instancesUsed = this.organization.instances; + var appInstanceQuota = this.organization.instancesQuota; + if (appInstanceQuota === -1) { + appInstanceQuota = '∞'; + } + this.instances = instancesUsed + ' / ' + appInstanceQuota; + + // Present the user's roles + var roles = this.organization.roles; + if (roles.length === 0) { + // Shouldn't happen as we should at least be a user of the org + this.roles = gettext('none'); + } else { + // If there are more than one role, don't show the user role + if (roles.length > 1) { + _.remove(roles, function (role) { + return role === 'org_user'; + }); + } + this.roles = _.map(roles, function (role) { + return ROLE_TO_STRING[role]; + }).join(', '); + } + + this.setActions = function () { + this.actions.push({ + name: gettext('Edit Organization'), + disabled: true, + execute: function () { + } + }); + this.actions.push({ + name: gettext('Delete Organization'), + disabled: true, + execute: function () { + } + }); + this.actions.push({ + name: gettext('Assign User(s)'), + disabled: true, + execute: function () { + } + }); + }; + + this.setActions(); + + } + +})(); diff --git a/src/app/view/endpoints/clusters/cluster/detail/organization-tile/organization-tile.html b/src/app/view/endpoints/clusters/cluster/detail/organization-tile/organization-tile.html new file mode 100644 index 0000000000..8e11eac09f --- /dev/null +++ b/src/app/view/endpoints/clusters/cluster/detail/organization-tile/organization-tile.html @@ -0,0 +1,21 @@ + + +
+
role(s)
+
{{organizationTileCtrl.roles}}
+
total apps
+
{{organizationTileCtrl.organization.totalApps}}
+
instances
+
{{organizationTileCtrl.instances}}
+
memory utilization
+
{{ organizationTileCtrl.memory }}
+ +
+
diff --git a/src/app/view/endpoints/clusters/cluster/detail/organization-tile/organization-tile.scss b/src/app/view/endpoints/clusters/cluster/detail/organization-tile/organization-tile.scss new file mode 100644 index 0000000000..0c2914b101 --- /dev/null +++ b/src/app/view/endpoints/clusters/cluster/detail/organization-tile/organization-tile.scss @@ -0,0 +1,21 @@ +.organization-tile { + + &.unlink { + // Override some extreme oddness in gallery-card with undefined on-card-click + .panel-heading.linked, .panel-body.linked { + cursor: default; + } + } + + .gallery-card-title { + text-transform: uppercase; + } + + .dl-horizontal { + dd { + font-weight: 500; + text-transform: none; + } + + } +} diff --git a/src/app/view/endpoints/clusters/clusters.scss b/src/app/view/endpoints/clusters/clusters.scss index 35171e9140..63b60a3346 100644 --- a/src/app/view/endpoints/clusters/clusters.scss +++ b/src/app/view/endpoints/clusters/clusters.scss @@ -1 +1,2 @@ -@import 'tiles/cluster-tiles'; +@import 'tiles/cluster-tiles', + 'cluster/detail/cluster-detail'; diff --git a/src/app/view/endpoints/clusters/tiles/cluster-tile/cluster-tile.directive.js b/src/app/view/endpoints/clusters/tiles/cluster-tile/cluster-tile.directive.js index 741f072cd4..2d0c65deae 100644 --- a/src/app/view/endpoints/clusters/tiles/cluster-tile/cluster-tile.directive.js +++ b/src/app/view/endpoints/clusters/tiles/cluster-tile/cluster-tile.directive.js @@ -168,7 +168,7 @@ * @description Navigate to the cluster summary page for this cluster */ summary: function () { - this.$state.go('endpoint.clusters.cluster.detail', {guid: this.service.guid}); + this.$state.go('endpoint.clusters.cluster.detail.organizations', {guid: this.service.guid}); } }); diff --git a/src/app/view/endpoints/clusters/tiles/cluster-tile/cluster-tile.scss b/src/app/view/endpoints/clusters/tiles/cluster-tile/cluster-tile.scss index c0e1f3b9b0..edb9f6044a 100644 --- a/src/app/view/endpoints/clusters/tiles/cluster-tile/cluster-tile.scss +++ b/src/app/view/endpoints/clusters/tiles/cluster-tile/cluster-tile.scss @@ -1,7 +1,7 @@ .cluster-tile { &.unlink { - // Override some extreme oddness in gallary-card with undefined on-card-click + // Override some extreme oddness in gallery-card with undefined on-card-click .panel-heading.linked, .panel-body.linked { cursor: default; } diff --git a/src/app/view/endpoints/clusters/tiles/cluster-tiles.scss b/src/app/view/endpoints/clusters/tiles/cluster-tiles.scss index 532d8d72d9..4639cd5f2b 100644 --- a/src/app/view/endpoints/clusters/tiles/cluster-tiles.scss +++ b/src/app/view/endpoints/clusters/tiles/cluster-tiles.scss @@ -21,12 +21,12 @@ } } -.flyout-content-thin { - .flyout-content { - width: 564px; - min-width: 564px; - max-width: 564px; + .flyout-content-thin { + .flyout-content { + width: 564px; + min-width: 564px; + max-width: 564px; + } } } -} diff --git a/src/app/view/endpoints/dashboard/endpoints-dashboard.module.js b/src/app/view/endpoints/dashboard/endpoints-dashboard.module.js index f02e552c52..8f9790286b 100644 --- a/src/app/view/endpoints/dashboard/endpoints-dashboard.module.js +++ b/src/app/view/endpoints/dashboard/endpoints-dashboard.module.js @@ -38,7 +38,7 @@ * @constructor */ function EndpointsDashboardController(modelManager, $state, hceRegistration, hcfRegistration, $q) { - + var that = this; this.modelManager = modelManager; this.serviceInstanceModel = modelManager.retrieve('app.model.serviceInstance'); this.userServiceInstanceModel = modelManager.retrieve('app.model.serviceInstance.user'); @@ -53,18 +53,14 @@ // serviceInstanceModel has previously been updated // to decrease load time, we will use that data. this.listPromiseResolved = true; - this._updateLocalServiceInstances(); + _updateLocalServiceInstances(); } // Show welcome message only if no endpoints are registered this.showWelcomeMessage = this.serviceInstanceModel.serviceInstances.length === 0; this.serviceInstanceModel.list(); this.$q = $q; - this._updateEndpoints(); - - } - - angular.extend(EndpointsDashboardController.prototype, { + _updateEndpoints(); /** * @namespace app.view.endpoints.dashboard @@ -73,7 +69,7 @@ * @description Show cluster add form * @param {boolean} isHcf when true show cluster add form for HCF */ - showClusterAddForm: function (isHcf) { + this.showClusterAddForm = function (isHcf) { var that = this; if (isHcf) { this.hcfRegistration.add() @@ -86,7 +82,7 @@ return that._updateEndpoints; }); } - }, + }; /** * @namespace app.view.endpoints.dashboard @@ -94,9 +90,9 @@ * @name hideWelcomeMessage * @description Hide Welcome message */ - hideWelcomeMessage: function () { + this.hideWelcomeMessage = function () { this.showWelcomeMessage = false; - }, + }; /** * @function isUserAdmin @@ -104,9 +100,9 @@ * @description Is current user an admin? * @returns {Boolean} */ - isUserAdmin: function () { - return this.currentUserAccount.isAdmin(); - }, + this.isUserAdmin = function () { + return that.currentUserAccount.isAdmin(); + }; /** * @function _updateLocalServiceInstances @@ -114,12 +110,11 @@ * @description Updates local service instances * @private */ - _updateLocalServiceInstances: function () { - var that = this; - if (this.showWelcomeMessage && this.serviceInstanceModel.serviceInstances.length > 0) { - this.showWelcomeMessage = false; + function _updateLocalServiceInstances() { + if (that.showWelcomeMessage && that.serviceInstanceModel.serviceInstances.length > 0) { + that.showWelcomeMessage = false; } - _.forEach(this.serviceInstanceModel.serviceInstances, function (serviceInstance) { + _.forEach(that.serviceInstanceModel.serviceInstances, function (serviceInstance) { var guid = serviceInstance.guid; if (angular.isUndefined(that.serviceInstances[guid])) { that.serviceInstances[guid] = serviceInstance; @@ -127,23 +122,23 @@ angular.extend(that.serviceInstances[guid], serviceInstance); } }); - }, /** + } + + /** * @function _updateEndpoints * @memberOf app.view.endpoints.dashboard * @description Is current user an admin? * @returns {*} * @private */ - _updateEndpoints: function () { - - var that = this; - return this.$q.all([this.serviceInstanceModel.list(), this.userServiceInstanceModel.list()]) + function _updateEndpoints() { + return that.$q.all([that.serviceInstanceModel.list(), that.userServiceInstanceModel.list()]) .then(function () { - that._updateLocalServiceInstances(); + _updateLocalServiceInstances(); }).then(function () { that.listPromiseResolved = true; }); } - }); + } })(); diff --git a/src/app/view/endpoints/endpoints.module.js b/src/app/view/endpoints/endpoints.module.js index 8f1b4ec06b..d86ecca9dc 100644 --- a/src/app/view/endpoints/endpoints.module.js +++ b/src/app/view/endpoints/endpoints.module.js @@ -48,7 +48,7 @@ onLoggedIn: function () { var menu = this.modelManager.retrieve('app.model.navigation').menu; - menu.addMenuItem('endpoints', 'endpoint.dashboard', gettext('Endpoints')); + menu.addMenuItem('endpoints', 'endpoint.dashboard', gettext('Endpoints'), 1); } }); diff --git a/src/plugins/cloud-foundry/api/hcf/AppUsageEvents.js b/src/plugins/cloud-foundry/api/hcf/AppUsageEvents.js index 0ade377f3a..7cb5f4a8ae 100644 --- a/src/plugins/cloud-foundry/api/hcf/AppUsageEvents.js +++ b/src/plugins/cloud-foundry/api/hcf/AppUsageEvents.js @@ -37,7 +37,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -57,7 +58,8 @@ config.method = 'POST'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -73,7 +75,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); } diff --git a/src/plugins/cloud-foundry/api/hcf/Apps.js b/src/plugins/cloud-foundry/api/hcf/Apps.js index 8a83a3ff4b..dec739423b 100644 --- a/src/plugins/cloud-foundry/api/hcf/Apps.js +++ b/src/plugins/cloud-foundry/api/hcf/Apps.js @@ -34,7 +34,8 @@ config.method = 'PUT'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -54,7 +55,8 @@ config.data = value; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -71,7 +73,8 @@ config.data = value; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -88,7 +91,8 @@ config.data = value; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -104,7 +108,8 @@ config.method = 'DELETE'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -123,7 +128,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -139,7 +145,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -156,7 +163,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -173,7 +181,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -201,7 +210,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -217,7 +227,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -233,7 +244,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -249,7 +261,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -265,7 +278,8 @@ config.method = 'DELETE'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -281,7 +295,8 @@ config.method = 'DELETE'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -297,7 +312,8 @@ config.method = 'POST'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -313,7 +329,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -329,7 +346,8 @@ config.method = 'DELETE'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -346,7 +364,8 @@ config.data = value; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); } diff --git a/src/plugins/cloud-foundry/api/hcf/Blobstores.js b/src/plugins/cloud-foundry/api/hcf/Blobstores.js index 82464bd9e4..245339234a 100644 --- a/src/plugins/cloud-foundry/api/hcf/Blobstores.js +++ b/src/plugins/cloud-foundry/api/hcf/Blobstores.js @@ -39,7 +39,8 @@ config.method = 'DELETE'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); } diff --git a/src/plugins/cloud-foundry/api/hcf/Buildpacks.js b/src/plugins/cloud-foundry/api/hcf/Buildpacks.js index e096d98447..7ae9207a6d 100644 --- a/src/plugins/cloud-foundry/api/hcf/Buildpacks.js +++ b/src/plugins/cloud-foundry/api/hcf/Buildpacks.js @@ -38,7 +38,8 @@ config.data = value; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -55,7 +56,8 @@ config.data = value; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -71,7 +73,8 @@ config.method = 'DELETE'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -88,7 +91,8 @@ config.data = value; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -104,7 +108,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -121,7 +126,8 @@ config.data = value; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -137,7 +143,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); } diff --git a/src/plugins/cloud-foundry/api/hcf/DomainsDeprecated.js b/src/plugins/cloud-foundry/api/hcf/DomainsDeprecated.js index 67f957eeed..15498474c6 100644 --- a/src/plugins/cloud-foundry/api/hcf/DomainsDeprecated.js +++ b/src/plugins/cloud-foundry/api/hcf/DomainsDeprecated.js @@ -35,7 +35,8 @@ config.data = value; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -52,7 +53,8 @@ config.data = value; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -68,7 +70,8 @@ config.method = 'DELETE'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -84,7 +87,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -100,7 +104,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -116,7 +121,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); } diff --git a/src/plugins/cloud-foundry/api/hcf/EnvironmentVariableGroups.js b/src/plugins/cloud-foundry/api/hcf/EnvironmentVariableGroups.js index 22fe3a7222..acb98ef05a 100644 --- a/src/plugins/cloud-foundry/api/hcf/EnvironmentVariableGroups.js +++ b/src/plugins/cloud-foundry/api/hcf/EnvironmentVariableGroups.js @@ -35,7 +35,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -52,7 +53,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -70,7 +72,8 @@ config.data = value; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -88,7 +91,8 @@ config.data = value; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); } diff --git a/src/plugins/cloud-foundry/api/hcf/Events.js b/src/plugins/cloud-foundry/api/hcf/Events.js index ec7edf1424..9b2dbbb7bd 100644 --- a/src/plugins/cloud-foundry/api/hcf/Events.js +++ b/src/plugins/cloud-foundry/api/hcf/Events.js @@ -34,7 +34,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -50,7 +51,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -66,7 +68,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -82,7 +85,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -98,7 +102,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -114,7 +119,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -130,7 +136,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -146,7 +153,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -162,7 +170,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -178,7 +187,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -194,7 +204,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -210,7 +221,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -226,7 +238,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -242,7 +255,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -258,7 +272,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -274,7 +289,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -290,7 +306,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -306,7 +323,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -322,7 +340,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -338,7 +357,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -354,7 +374,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -370,7 +391,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -386,7 +408,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -402,7 +425,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -418,7 +442,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -434,7 +459,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -450,7 +476,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -466,7 +493,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -482,7 +510,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -498,7 +527,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -514,7 +544,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -530,7 +561,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -546,7 +578,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -562,7 +595,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -578,7 +612,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -594,7 +629,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -610,7 +646,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -626,7 +663,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -642,7 +680,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -658,7 +697,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -674,7 +714,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -690,7 +731,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -706,7 +748,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); } diff --git a/src/plugins/cloud-foundry/api/hcf/FeatureFlags.js b/src/plugins/cloud-foundry/api/hcf/FeatureFlags.js index 6b02c75526..8c2e50590a 100644 --- a/src/plugins/cloud-foundry/api/hcf/FeatureFlags.js +++ b/src/plugins/cloud-foundry/api/hcf/FeatureFlags.js @@ -34,7 +34,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -51,7 +52,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -68,7 +70,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -86,7 +89,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -103,7 +107,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -120,7 +125,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -137,7 +143,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -158,7 +165,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -176,7 +184,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -194,7 +203,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -211,7 +221,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -232,7 +243,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -249,7 +261,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -266,7 +279,8 @@ config.data = value; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); } diff --git a/src/plugins/cloud-foundry/api/hcf/Files.js b/src/plugins/cloud-foundry/api/hcf/Files.js index 57dbd5b5e9..058d6071ba 100644 --- a/src/plugins/cloud-foundry/api/hcf/Files.js +++ b/src/plugins/cloud-foundry/api/hcf/Files.js @@ -36,7 +36,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); } diff --git a/src/plugins/cloud-foundry/api/hcf/Info.js b/src/plugins/cloud-foundry/api/hcf/Info.js index 6a015954f4..b9c5c6d840 100644 --- a/src/plugins/cloud-foundry/api/hcf/Info.js +++ b/src/plugins/cloud-foundry/api/hcf/Info.js @@ -34,7 +34,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); } diff --git a/src/plugins/cloud-foundry/api/hcf/Jobs.js b/src/plugins/cloud-foundry/api/hcf/Jobs.js index 3ff035b5ac..d1aac57538 100644 --- a/src/plugins/cloud-foundry/api/hcf/Jobs.js +++ b/src/plugins/cloud-foundry/api/hcf/Jobs.js @@ -34,7 +34,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -50,7 +51,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -66,7 +68,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -82,7 +85,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); } diff --git a/src/plugins/cloud-foundry/api/hcf/OrganizationQuotaDefinitions.js b/src/plugins/cloud-foundry/api/hcf/OrganizationQuotaDefinitions.js index 74c1d16d8c..cf7a62860b 100644 --- a/src/plugins/cloud-foundry/api/hcf/OrganizationQuotaDefinitions.js +++ b/src/plugins/cloud-foundry/api/hcf/OrganizationQuotaDefinitions.js @@ -35,7 +35,8 @@ config.data = value; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -51,7 +52,8 @@ config.method = 'DELETE'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -67,7 +69,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -83,7 +86,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -100,7 +104,8 @@ config.data = value; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); } diff --git a/src/plugins/cloud-foundry/api/hcf/Organizations.js b/src/plugins/cloud-foundry/api/hcf/Organizations.js index 12c3b46167..8339284e65 100644 --- a/src/plugins/cloud-foundry/api/hcf/Organizations.js +++ b/src/plugins/cloud-foundry/api/hcf/Organizations.js @@ -34,7 +34,8 @@ config.method = 'PUT'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -46,12 +47,13 @@ AssociateAuditorWithOrganizationByUsername: function (guid, value, params, httpConfigOptions) { var config = {}; config.params = params; - config.url = '/pp/v1/proxyv2/organizations/' + guid + '/auditors'; + config.url = '/pp/v1/proxy/v2/organizations/' + guid + '/auditors'; config.method = 'PUT'; config.data = value; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -67,7 +69,8 @@ config.method = 'PUT'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -79,12 +82,13 @@ AssociateBillingManagerWithOrganizationByUsername: function (guid, value, params, httpConfigOptions) { var config = {}; config.params = params; - config.url = '/pp/v1/proxyv2/organizations/' + guid + '/billing_managers'; + config.url = '/pp/v1/proxy/v2/organizations/' + guid + '/billing_managers'; config.method = 'PUT'; config.data = value; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -100,7 +104,8 @@ config.method = 'PUT'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -112,12 +117,13 @@ AssociateManagerWithOrganizationByUsername: function (guid, value, params, httpConfigOptions) { var config = {}; config.params = params; - config.url = '/pp/v1/proxyv2/organizations/' + guid + '/managers'; + config.url = '/pp/v1/proxy/v2/organizations/' + guid + '/managers'; config.method = 'PUT'; config.data = value; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -133,7 +139,8 @@ config.method = 'PUT'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -149,7 +156,8 @@ config.method = 'PUT'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -161,12 +169,13 @@ AssociateUserWithOrganizationByUsername: function (guid, value, params, httpConfigOptions) { var config = {}; config.params = params; - config.url = '/pp/v1/proxyv2/organizations/' + guid + '/users'; + config.url = '/pp/v1/proxy/v2/organizations/' + guid + '/users'; config.method = 'PUT'; config.data = value; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -183,7 +192,8 @@ config.data = value; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -199,7 +209,8 @@ config.method = 'DELETE'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -215,7 +226,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -231,7 +243,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -247,7 +260,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -263,7 +277,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -279,7 +294,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -295,7 +311,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -311,7 +328,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -327,7 +345,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -343,7 +362,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -359,7 +379,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -375,7 +396,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -391,7 +413,8 @@ config.method = 'DELETE'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -403,12 +426,13 @@ RemoveAuditorWithOrganizationByUsername: function (guid, value, params, httpConfigOptions) { var config = {}; config.params = params; - config.url = '/pp/v1/proxyv2/organizations/' + guid + '/auditors'; + config.url = '/pp/v1/proxy/v2/organizations/' + guid + '/auditors'; config.method = 'DELETE'; config.data = value; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -424,7 +448,8 @@ config.method = 'DELETE'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -436,12 +461,13 @@ RemoveBillingManagerWithOrganizationByUsername: function (guid, value, params, httpConfigOptions) { var config = {}; config.params = params; - config.url = '/pp/v1/proxyv2/organizations/' + guid + '/billing_managers'; + config.url = '/pp/v1/proxy/v2/organizations/' + guid + '/billing_managers'; config.method = 'DELETE'; config.data = value; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -457,7 +483,8 @@ config.method = 'DELETE'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -469,12 +496,13 @@ RemoveManagerWithOrganizationByUsername: function (guid, value, params, httpConfigOptions) { var config = {}; config.params = params; - config.url = '/pp/v1/proxyv2/organizations/' + guid + '/managers'; + config.url = '/pp/v1/proxy/v2/organizations/' + guid + '/managers'; config.method = 'DELETE'; config.data = value; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -490,7 +518,8 @@ config.method = 'DELETE'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -506,7 +535,8 @@ config.method = 'DELETE'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -518,12 +548,13 @@ RemoveUserWithOrganizationByUsername: function (guid, value, params, httpConfigOptions) { var config = {}; config.params = params; - config.url = '/pp/v1/proxyv2/organizations/' + guid + '/users'; + config.url = '/pp/v1/proxy/v2/organizations/' + guid + '/users'; config.method = 'DELETE'; config.data = value; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -539,7 +570,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -557,7 +589,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -573,7 +606,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -589,7 +623,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -606,7 +641,8 @@ config.data = value; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); } diff --git a/src/plugins/cloud-foundry/api/hcf/PrivateDomains.js b/src/plugins/cloud-foundry/api/hcf/PrivateDomains.js index 872d72cd7d..d97ef8b081 100644 --- a/src/plugins/cloud-foundry/api/hcf/PrivateDomains.js +++ b/src/plugins/cloud-foundry/api/hcf/PrivateDomains.js @@ -35,7 +35,8 @@ config.data = value; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -51,7 +52,8 @@ config.method = 'DELETE'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -67,7 +69,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -83,7 +86,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -99,7 +103,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -115,7 +120,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); } diff --git a/src/plugins/cloud-foundry/api/hcf/ResourceMatch.js b/src/plugins/cloud-foundry/api/hcf/ResourceMatch.js index a1577076c0..5ca09d5e79 100644 --- a/src/plugins/cloud-foundry/api/hcf/ResourceMatch.js +++ b/src/plugins/cloud-foundry/api/hcf/ResourceMatch.js @@ -41,7 +41,8 @@ config.data = value; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); } diff --git a/src/plugins/cloud-foundry/api/hcf/Routes.js b/src/plugins/cloud-foundry/api/hcf/Routes.js index 7729e53c91..9b1dac3151 100644 --- a/src/plugins/cloud-foundry/api/hcf/Routes.js +++ b/src/plugins/cloud-foundry/api/hcf/Routes.js @@ -34,7 +34,8 @@ config.method = 'PUT'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -51,7 +52,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -68,7 +70,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -85,7 +88,8 @@ config.data = value; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -101,7 +105,8 @@ config.method = 'DELETE'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -117,7 +122,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -133,7 +139,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -149,7 +156,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -165,7 +173,8 @@ config.method = 'DELETE'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -181,7 +190,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -198,7 +208,8 @@ config.data = value; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); } diff --git a/src/plugins/cloud-foundry/api/hcf/RoutesMapping.js b/src/plugins/cloud-foundry/api/hcf/RoutesMapping.js index 60b9dbc5d5..bb1dc65681 100644 --- a/src/plugins/cloud-foundry/api/hcf/RoutesMapping.js +++ b/src/plugins/cloud-foundry/api/hcf/RoutesMapping.js @@ -34,7 +34,8 @@ config.method = 'DELETE'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -50,7 +51,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -67,7 +69,8 @@ config.data = value; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -83,7 +86,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -100,7 +104,8 @@ config.data = value; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); } diff --git a/src/plugins/cloud-foundry/api/hcf/SecurityGroupRunningDefaults.js b/src/plugins/cloud-foundry/api/hcf/SecurityGroupRunningDefaults.js index b2fe81f659..8299975054 100644 --- a/src/plugins/cloud-foundry/api/hcf/SecurityGroupRunningDefaults.js +++ b/src/plugins/cloud-foundry/api/hcf/SecurityGroupRunningDefaults.js @@ -34,7 +34,8 @@ config.method = 'DELETE'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -50,7 +51,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -66,7 +68,8 @@ config.method = 'PUT'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); } diff --git a/src/plugins/cloud-foundry/api/hcf/SecurityGroupStagingDefaults.js b/src/plugins/cloud-foundry/api/hcf/SecurityGroupStagingDefaults.js index 21a0efbc61..6bd9079fbe 100644 --- a/src/plugins/cloud-foundry/api/hcf/SecurityGroupStagingDefaults.js +++ b/src/plugins/cloud-foundry/api/hcf/SecurityGroupStagingDefaults.js @@ -34,7 +34,8 @@ config.method = 'DELETE'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -50,7 +51,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -66,7 +68,8 @@ config.method = 'PUT'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); } diff --git a/src/plugins/cloud-foundry/api/hcf/SecurityGroups.js b/src/plugins/cloud-foundry/api/hcf/SecurityGroups.js index bc88edf7e7..4d32c23225 100644 --- a/src/plugins/cloud-foundry/api/hcf/SecurityGroups.js +++ b/src/plugins/cloud-foundry/api/hcf/SecurityGroups.js @@ -34,7 +34,8 @@ config.method = 'PUT'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -51,7 +52,8 @@ config.data = value; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -67,7 +69,8 @@ config.method = 'DELETE'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -83,7 +86,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -99,7 +103,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -115,7 +120,8 @@ config.method = 'DELETE'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -131,7 +137,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -148,7 +155,8 @@ config.data = value; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); } diff --git a/src/plugins/cloud-foundry/api/hcf/ServiceBindings.js b/src/plugins/cloud-foundry/api/hcf/ServiceBindings.js index 21c6a8cf41..f248dcc396 100644 --- a/src/plugins/cloud-foundry/api/hcf/ServiceBindings.js +++ b/src/plugins/cloud-foundry/api/hcf/ServiceBindings.js @@ -35,7 +35,8 @@ config.data = value; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -51,7 +52,8 @@ config.method = 'DELETE'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -67,7 +69,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -83,7 +86,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); } diff --git a/src/plugins/cloud-foundry/api/hcf/ServiceBrokers.js b/src/plugins/cloud-foundry/api/hcf/ServiceBrokers.js index c5e2269022..a66d20cb1c 100644 --- a/src/plugins/cloud-foundry/api/hcf/ServiceBrokers.js +++ b/src/plugins/cloud-foundry/api/hcf/ServiceBrokers.js @@ -35,7 +35,8 @@ config.data = value; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -51,7 +52,8 @@ config.method = 'DELETE'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -67,7 +69,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -83,7 +86,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -100,7 +104,8 @@ config.data = value; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); } diff --git a/src/plugins/cloud-foundry/api/hcf/ServiceInstances.js b/src/plugins/cloud-foundry/api/hcf/ServiceInstances.js index bde99f875c..2ab9043335 100644 --- a/src/plugins/cloud-foundry/api/hcf/ServiceInstances.js +++ b/src/plugins/cloud-foundry/api/hcf/ServiceInstances.js @@ -35,7 +35,8 @@ config.data = value; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -52,7 +53,8 @@ config.data = value; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -68,7 +70,8 @@ config.method = 'DELETE'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -84,7 +87,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -100,7 +104,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -116,7 +121,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -132,7 +138,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -148,7 +155,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -164,7 +172,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -180,7 +189,8 @@ config.method = 'DELETE'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -197,7 +207,8 @@ config.data = value; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); } diff --git a/src/plugins/cloud-foundry/api/hcf/ServiceKeys.js b/src/plugins/cloud-foundry/api/hcf/ServiceKeys.js index 392cf0073c..2113b44f9a 100644 --- a/src/plugins/cloud-foundry/api/hcf/ServiceKeys.js +++ b/src/plugins/cloud-foundry/api/hcf/ServiceKeys.js @@ -35,7 +35,8 @@ config.data = value; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -51,7 +52,8 @@ config.method = 'DELETE'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -67,7 +69,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -83,7 +86,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); } diff --git a/src/plugins/cloud-foundry/api/hcf/ServicePlanVisibilities.js b/src/plugins/cloud-foundry/api/hcf/ServicePlanVisibilities.js index c1336bcd81..d4907c6ed5 100644 --- a/src/plugins/cloud-foundry/api/hcf/ServicePlanVisibilities.js +++ b/src/plugins/cloud-foundry/api/hcf/ServicePlanVisibilities.js @@ -35,7 +35,8 @@ config.data = value; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -51,7 +52,8 @@ config.method = 'DELETE'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -67,7 +69,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -83,7 +86,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -100,7 +104,8 @@ config.data = value; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); } diff --git a/src/plugins/cloud-foundry/api/hcf/ServicePlans.js b/src/plugins/cloud-foundry/api/hcf/ServicePlans.js index 6f757fa218..e5987215d3 100644 --- a/src/plugins/cloud-foundry/api/hcf/ServicePlans.js +++ b/src/plugins/cloud-foundry/api/hcf/ServicePlans.js @@ -34,7 +34,8 @@ config.method = 'DELETE'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -50,7 +51,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -66,7 +68,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -82,7 +85,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -99,7 +103,8 @@ config.data = value; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); } diff --git a/src/plugins/cloud-foundry/api/hcf/ServiceUsageEvents.js b/src/plugins/cloud-foundry/api/hcf/ServiceUsageEvents.js index 8264e0319a..a6de179bfc 100644 --- a/src/plugins/cloud-foundry/api/hcf/ServiceUsageEvents.js +++ b/src/plugins/cloud-foundry/api/hcf/ServiceUsageEvents.js @@ -37,7 +37,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -57,7 +58,8 @@ config.method = 'POST'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -73,7 +75,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); } diff --git a/src/plugins/cloud-foundry/api/hcf/Services.js b/src/plugins/cloud-foundry/api/hcf/Services.js index 5395e77c03..28b1e73efa 100644 --- a/src/plugins/cloud-foundry/api/hcf/Services.js +++ b/src/plugins/cloud-foundry/api/hcf/Services.js @@ -35,7 +35,8 @@ config.method = 'DELETE'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -51,7 +52,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -67,7 +69,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -83,7 +86,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); } diff --git a/src/plugins/cloud-foundry/api/hcf/SharedDomains.js b/src/plugins/cloud-foundry/api/hcf/SharedDomains.js index 6249ebf65b..71642db516 100644 --- a/src/plugins/cloud-foundry/api/hcf/SharedDomains.js +++ b/src/plugins/cloud-foundry/api/hcf/SharedDomains.js @@ -35,7 +35,8 @@ config.data = value; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -51,7 +52,8 @@ config.method = 'DELETE'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -67,7 +69,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -83,7 +86,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -99,7 +103,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); } diff --git a/src/plugins/cloud-foundry/api/hcf/SpaceQuotaDefinitions.js b/src/plugins/cloud-foundry/api/hcf/SpaceQuotaDefinitions.js index f67f6377c0..79c9c20011 100644 --- a/src/plugins/cloud-foundry/api/hcf/SpaceQuotaDefinitions.js +++ b/src/plugins/cloud-foundry/api/hcf/SpaceQuotaDefinitions.js @@ -34,7 +34,8 @@ config.method = 'PUT'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -51,7 +52,8 @@ config.data = value; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -67,7 +69,8 @@ config.method = 'DELETE'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -83,7 +86,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -99,7 +103,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -115,7 +120,8 @@ config.method = 'DELETE'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -131,7 +137,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -148,7 +155,8 @@ config.data = value; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); } diff --git a/src/plugins/cloud-foundry/api/hcf/Spaces.js b/src/plugins/cloud-foundry/api/hcf/Spaces.js index 088ad3ed45..c88877b6ae 100644 --- a/src/plugins/cloud-foundry/api/hcf/Spaces.js +++ b/src/plugins/cloud-foundry/api/hcf/Spaces.js @@ -34,7 +34,8 @@ config.method = 'PUT'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -46,12 +47,13 @@ AssociateAuditorWithSpaceByUsername: function (guid, value, params, httpConfigOptions) { var config = {}; config.params = params; - config.url = '/pp/v1/proxyv2/spaces/' + guid + '/auditors'; + config.url = '/pp/v1/proxy/v2/spaces/' + guid + '/auditors'; config.method = 'PUT'; config.data = value; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -67,7 +69,8 @@ config.method = 'PUT'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -79,12 +82,13 @@ AssociateDeveloperWithSpaceByUsername: function (guid, value, params, httpConfigOptions) { var config = {}; config.params = params; - config.url = '/pp/v1/proxyv2/spaces/' + guid + '/developers'; + config.url = '/pp/v1/proxy/v2/spaces/' + guid + '/developers'; config.method = 'PUT'; config.data = value; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -100,7 +104,8 @@ config.method = 'PUT'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -112,12 +117,13 @@ AssociateManagerWithSpaceByUsername: function (guid, value, params, httpConfigOptions) { var config = {}; config.params = params; - config.url = '/pp/v1/proxyv2/spaces/' + guid + '/managers'; + config.url = '/pp/v1/proxy/v2/spaces/' + guid + '/managers'; config.method = 'PUT'; config.data = value; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -133,7 +139,8 @@ config.method = 'PUT'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -150,7 +157,8 @@ config.data = value; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -166,7 +174,8 @@ config.method = 'DELETE'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -182,7 +191,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -198,7 +208,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -214,7 +225,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -230,7 +242,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -246,7 +259,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -262,7 +276,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -278,7 +293,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -294,7 +310,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -310,7 +327,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -326,7 +344,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -342,7 +361,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -358,7 +378,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -374,7 +395,8 @@ config.method = 'DELETE'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -386,12 +408,13 @@ RemoveAuditorWithSpaceByUsername: function (guid, value, params, httpConfigOptions) { var config = {}; config.params = params; - config.url = '/pp/v1/proxyv2/spaces/' + guid + '/auditors'; + config.url = '/pp/v1/proxy/v2/spaces/' + guid + '/auditors'; config.method = 'DELETE'; config.data = value; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -407,7 +430,8 @@ config.method = 'DELETE'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -419,12 +443,13 @@ RemoveDeveloperWithSpaceByUsername: function (guid, value, params, httpConfigOptions) { var config = {}; config.params = params; - config.url = '/pp/v1/proxyv2/spaces/' + guid + '/developers'; + config.url = '/pp/v1/proxy/v2/spaces/' + guid + '/developers'; config.method = 'DELETE'; config.data = value; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -440,7 +465,8 @@ config.method = 'DELETE'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -452,12 +478,13 @@ RemoveManagerWithSpaceByUsername: function (guid, value, params, httpConfigOptions) { var config = {}; config.params = params; - config.url = '/pp/v1/proxyv2/spaces/' + guid + '/managers'; + config.url = '/pp/v1/proxy/v2/spaces/' + guid + '/managers'; config.method = 'DELETE'; config.data = value; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -473,7 +500,8 @@ config.method = 'DELETE'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -489,7 +517,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -505,7 +534,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -522,7 +552,8 @@ config.data = value; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); } diff --git a/src/plugins/cloud-foundry/api/hcf/Stacks.js b/src/plugins/cloud-foundry/api/hcf/Stacks.js index 171f172950..3c07cb0025 100644 --- a/src/plugins/cloud-foundry/api/hcf/Stacks.js +++ b/src/plugins/cloud-foundry/api/hcf/Stacks.js @@ -35,7 +35,8 @@ config.data = value; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -51,7 +52,8 @@ config.method = 'DELETE'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -67,7 +69,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -83,7 +86,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); } diff --git a/src/plugins/cloud-foundry/api/hcf/UserProvidedServiceInstances.js b/src/plugins/cloud-foundry/api/hcf/UserProvidedServiceInstances.js index ccf5428141..5759d86b40 100644 --- a/src/plugins/cloud-foundry/api/hcf/UserProvidedServiceInstances.js +++ b/src/plugins/cloud-foundry/api/hcf/UserProvidedServiceInstances.js @@ -34,7 +34,8 @@ config.method = 'PUT'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -51,7 +52,8 @@ config.data = value; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -67,7 +69,8 @@ config.method = 'DELETE'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -83,7 +86,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -99,7 +103,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -115,7 +120,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -131,7 +137,8 @@ config.method = 'DELETE'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -147,7 +154,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -164,7 +172,8 @@ config.data = value; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); } diff --git a/src/plugins/cloud-foundry/api/hcf/Users.js b/src/plugins/cloud-foundry/api/hcf/Users.js index 0574916bec..d30d06b6d4 100644 --- a/src/plugins/cloud-foundry/api/hcf/Users.js +++ b/src/plugins/cloud-foundry/api/hcf/Users.js @@ -34,7 +34,8 @@ config.method = 'PUT'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -50,7 +51,8 @@ config.method = 'PUT'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -66,7 +68,8 @@ config.method = 'PUT'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -82,7 +85,8 @@ config.method = 'PUT'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -98,7 +102,8 @@ config.method = 'PUT'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -114,7 +119,8 @@ config.method = 'PUT'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -130,7 +136,8 @@ config.method = 'PUT'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -147,7 +154,8 @@ config.data = value; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -163,7 +171,8 @@ config.method = 'DELETE'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -179,7 +188,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -195,7 +205,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -211,7 +222,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -227,7 +239,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -243,7 +256,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -259,7 +273,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -275,7 +290,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -291,7 +307,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -307,7 +324,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -323,7 +341,8 @@ config.method = 'DELETE'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -339,7 +358,8 @@ config.method = 'DELETE'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -355,7 +375,8 @@ config.method = 'DELETE'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -371,7 +392,8 @@ config.method = 'DELETE'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -387,7 +409,8 @@ config.method = 'DELETE'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -403,7 +426,8 @@ config.method = 'DELETE'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -419,7 +443,8 @@ config.method = 'DELETE'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -435,7 +460,8 @@ config.method = 'GET'; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); }, @@ -452,7 +478,8 @@ config.data = value; for (var option in httpConfigOptions) { - config[option] = httpConfigOptions[option] + if (!httpConfigOptions.hasOwnProperty(option)) { continue; } + config[option] = httpConfigOptions[option]; } return this.$http(config); } diff --git a/src/plugins/cloud-foundry/cloud-foundry.module.js b/src/plugins/cloud-foundry/cloud-foundry.module.js index c5bf5292ff..f3935e4046 100644 --- a/src/plugins/cloud-foundry/cloud-foundry.module.js +++ b/src/plugins/cloud-foundry/cloud-foundry.module.js @@ -43,12 +43,6 @@ // Only redirect from the login page: preserve ui-context when reloading/refreshing in nested views if (this.$location.path() === '') { this.eventService.$emit(this.eventService.events.REDIRECT, 'cf.applications.list.gallery-view'); - } else if (this.$state.current.name !== '') { - // If $location.path() is not empty and the state is set, ui-router won't reload for us - // We reload manually to trigger any $stateChangeSuccess logic - - // N.B we only reach this after pasting a deep URL in a new tab from a non-loggedIn state - this.$state.reload(); } } }, @@ -58,7 +52,7 @@ registerNavigation: function () { var menu = this.modelManager.retrieve('app.model.navigation').menu; - menu.addMenuItem('cf.applications', 'cf.applications.list.gallery-view', gettext('Applications'), null, null, 0); + menu.addMenuItem('cf.applications', 'cf.applications.list.gallery-view', gettext('Applications'), 0); } }); diff --git a/src/plugins/cloud-foundry/model/organization/organization.model.js b/src/plugins/cloud-foundry/model/organization/organization.model.js index c537504b81..1d5047e1a5 100644 --- a/src/plugins/cloud-foundry/model/organization/organization.model.js +++ b/src/plugins/cloud-foundry/model/organization/organization.model.js @@ -11,65 +11,216 @@ registerOrgModel.$inject = [ 'app.model.modelManager', - 'app.api.apiManager' + 'app.api.apiManager', + 'app.utils.utilsService', + '$q', + '$log' ]; - function registerOrgModel(modelManager, apiManager) { - modelManager.register('cloud-foundry.model.organization', new Organization(apiManager)); + function registerOrgModel(modelManager, apiManager, utils, $q, $log) { + modelManager.register('cloud-foundry.model.organization', + new Organization(modelManager, apiManager, utils, $q, $log)); } /** * @memberof cloud-foundry.model * @name Organization - * @param {app.api.apiManager} apiManager - the API manager - * @property {app.api.apiManager} apiManager - the API manager + * @param {object} modelManager - the model manager + * @param {object} apiManager - the API manager + * @property {object} apiManager - the API manager + * @param {object} utils - the utils service + * @property {object} utils - the utils service + * @param {object} stackatoInfoModel - the stackatoInfoModel model + * @property {object} stackatoInfoModel - the stackatoInfoModel model + * @param {object} $q - angular $q service + * @property {object} $q - angular $q service + * @param {object} $log - angular $log service + * @property {object} $log - angular $log service * @class */ - function Organization(apiManager) { + function Organization(modelManager, apiManager, utils, $q, $log) { this.apiManager = apiManager; + this.$q = $q; + this.$log = $log; + this.utils = utils; + this.stackatoInfoModel = modelManager.retrieve('app.model.stackatoInfo'); + this.organizations = {}; + + var passThroughHeader = { + 'x-cnap-passthrough': 'true' + }; + + this.makeHttpConfig = function (cnsiGuid) { + var headers = {'x-cnap-cnsi-list': cnsiGuid}; + angular.extend(headers, passThroughHeader); + return { + headers: headers + }; + }; } angular.extend(Organization.prototype, { - /** - * @function listAllOrganizations - * @memberof cloud-foundry.model.organization - * @description lists all organizations - * @param {string} cnsiGuid - The GUID of the cloud-foundry server. - * @param {object} params - optional parameters - * @returns {promise} A resolved/rejected promise - * @public - */ + /** + * @function listAllOrganizations + * @memberof cloud-foundry.model.organization + * @description lists all organizations + * @param {string} cnsiGuid - The GUID of the cloud-foundry server. + * @param {object} params - optional parameters + * @returns {promise} A resolved/rejected promise + * @public + */ listAllOrganizations: function (cnsiGuid, params) { - var httpConfig = { - headers: { 'x-cnap-cnsi-list': cnsiGuid } - }; return this.apiManager.retrieve('cloud-foundry.api.Organizations') - .ListAllOrganizations(params, httpConfig) + .ListAllOrganizations(params, this.makeHttpConfig(cnsiGuid)) .then(function (response) { - return response.data[cnsiGuid].resources; + return response.data.resources; }); }, - /** - * @function listAllSpacesForOrganization - * @memberof cloud-foundry.model.organization - * @description lists all spaces for organization - * @param {string} cnsiGuid - The GUID of the cloud-foundry server. - * @param {string} orgGuid - organization id - * @param {object} params - optional parameters - * @returns {promise} A resolved/rejected promise - * @public - */ + /** + * @function listAllSpacesForOrganization + * @memberof cloud-foundry.model.organization + * @description lists all spaces for organization + * @param {string} cnsiGuid - The GUID of the cloud-foundry server. + * @param {string} orgGuid - organization id + * @param {object} params - optional parameters + * @returns {promise} A resolved/rejected promise + * @public + */ listAllSpacesForOrganization: function (cnsiGuid, orgGuid, params) { - var httpConfig = { - headers: { 'x-cnap-cnsi-list': cnsiGuid } - }; return this.apiManager.retrieve('cloud-foundry.api.Organizations') - .ListAllSpacesForOrganization(orgGuid, params, httpConfig) + .ListAllSpacesForOrganization(orgGuid, params, this.makeHttpConfig(cnsiGuid)) .then(function (response) { - return response.data[cnsiGuid].resources; + return response.data.resources; + }); + }, + + initOrganizationCache: function (cnsiGuid, orgGuid) { + this.organizations[cnsiGuid] = this.organizations[cnsiGuid] || {}; + this.organizations[cnsiGuid][orgGuid] = this.organizations[cnsiGuid][orgGuid] || {details: {}, roles: {}}; + }, + + cacheOrganizationDetails: function (cnsiGuid, orgGuid, details) { + this.initOrganizationCache(cnsiGuid, orgGuid); + this.organizations[cnsiGuid][orgGuid].details = details; + }, + + cacheOrganizationUsersRoles: function (cnsiGuid, orgGuid, roles) { + var that = this; + this.initOrganizationCache(cnsiGuid, orgGuid); + _.forEach(roles, function (user) { + that.organizations[cnsiGuid][orgGuid].roles[user.metadata.guid] = user.entity.organization_roles; + }); + }, + + /** + * @function getOrganizationDetails + * @memberof cloud-foundry.model.organization + * @description gather all sorts of details about an organization + * @param {string} cnsiGuid - The GUID of the cloud-foundry server + * @param {string} org - organization entry as returned by listAllOrganizations() + * @param {object} params - optional parameters + * @returns {promise} A promise which will be resolved with the organizations's details + * */ + getOrganizationDetails: function (cnsiGuid, org, params) { + var that = this; + var httpConfig = this.makeHttpConfig(cnsiGuid); + var orgGuid = org.metadata.guid; + var orgQuotaGuid = org.entity.quota_definition_guid; + var createdDate = moment(org.metadata.created_at, "YYYY-MM-DDTHH:mm:ssZ"); + + var spaceApi = that.apiManager.retrieve('cloud-foundry.api.Spaces'); + var orgsApi = that.apiManager.retrieve('cloud-foundry.api.Organizations'); + var orgsQuotaApi = that.apiManager.retrieve('cloud-foundry.api.OrganizationQuotaDefinitions'); + + var usedMemP = orgsApi.RetrievingOrganizationMemoryUsage(orgGuid, params, httpConfig); + var instancesP = orgsApi.RetrievingOrganizationInstanceUsage(orgGuid, params, httpConfig); + var quotaP = orgsQuotaApi.RetrieveOrganizationQuotaDefinition(orgQuotaGuid, params, httpConfig); + + var rolesP = orgsApi.RetrievingRolesOfAllUsersInOrganization(orgGuid, params, httpConfig); + var stackatoInfoP = that.stackatoInfoModel.getStackatoInfo(); + + var orgRolesP = that.$q.all({roles: rolesP, stackatoInfo: stackatoInfoP}).then(function (values) { + var i, userGuid, myRoles; + + // TODO: there may be many pages of Users! + that.cacheOrganizationUsersRoles(cnsiGuid, orgGuid, values.roles.data.resources); + + // Find our user's GUID + userGuid = values.stackatoInfo.endpoints.hcf[cnsiGuid].user.guid; + + // Find my user's roles + for (i = 0; i < values.roles.data.resources.length; i++) { + var roles = values.roles.data.resources[i]; + if (roles.metadata.guid === userGuid) { + myRoles = roles.entity.organization_roles; + break; + } + } + if (!myRoles) { + throw new Error('Failed to find my roles in this organization'); + } + return myRoles; + }); + + var appCountsP = this.apiManager.retrieve('cloud-foundry.api.Organizations') + .ListAllSpacesForOrganization(orgGuid, params, httpConfig).then(function (res) { + var spaces = res.data.resources; + var promises = []; + _.forEach(spaces, function (space) { + var promise = spaceApi.ListAllAppsForSpace(space.metadata.guid, params, httpConfig).then(function (res2) { + return res2.data.resources.length; + }).catch(function (error) { + that.$log.error('Failed to ListAllAppsForSpace', error); + throw error; + }); + promises.push(promise); + }); + return that.$q.all(promises).then(function (appCounts) { + var total = 0; + _.forEach(appCounts, function (count) { + total += count; + }); + return total; + }); + }).catch(function (error) { + that.$log.error('Failed to ListAllSpacesForOrganization', error); + throw error; }); + + return this.$q.all({ + memory: usedMemP, + quota: quotaP, + instances: instancesP, + apps: appCountsP, + roles: orgRolesP + }).then(function (vals) { + var details = {}; + + details.guid = orgGuid; + + // Set created date for sorting + details.created_at = createdDate.unix(); + + // Set memory utilisation + details.memUsed = vals.memory.data.memory_usage_in_mb; + details.memQuota = vals.quota.data.entity.memory_limit; + + details.instances = vals.instances.data.instance_usage; + details.instancesQuota = vals.quota.data.entity.app_instance_limit; + + // Set total apps count + details.totalApps = vals.apps; + + details.name = org.entity.name; + + details.roles = vals.roles; + + that.cacheOrganizationDetails(cnsiGuid, orgGuid, details); + return details; + }); } + }); })(); diff --git a/src/plugins/cloud-foundry/view/applications/application/application.scss b/src/plugins/cloud-foundry/view/applications/application/application.scss index 747973725d..40dada2ab7 100644 --- a/src/plugins/cloud-foundry/view/applications/application/application.scss +++ b/src/plugins/cloud-foundry/view/applications/application/application.scss @@ -10,6 +10,7 @@ .btn { font-size: $font-size-large; + text-transform: none; height: auto; padding: $hpe-unit-space/2 $hpe-unit-space; diff --git a/src/plugins/cloud-foundry/view/applications/application/log-stream/log-stream.module.js b/src/plugins/cloud-foundry/view/applications/application/log-stream/log-stream.module.js index dc23b9508d..3305ecd0da 100644 --- a/src/plugins/cloud-foundry/view/applications/application/log-stream/log-stream.module.js +++ b/src/plugins/cloud-foundry/view/applications/application/log-stream/log-stream.module.js @@ -60,10 +60,10 @@ var colour; switch (messageObj.source_type) { case 'APP': - colour = 'green'; + colour = 'red'; break; default: - colour = 'red'; + colour = 'yellow'; } var messageSource = coloredLog('[' + messageObj.source_type + '.' + messageObj.source_instance + ']', colour);