\ No newline at end of file
diff --git a/client/cat3/src/partials/sections/dashboard/design/designCtrl.js b/client/cat3/src/partials/sections/dashboard/design/designCtrl.js
index f945a8de4..0d04bee96 100644
--- a/client/cat3/src/partials/sections/dashboard/design/designCtrl.js
+++ b/client/cat3/src/partials/sections/dashboard/design/designCtrl.js
@@ -1,7 +1,84 @@
(function (angular) {
"use strict";
- angular.module('dashboard.design', [])
- .controller('designCtrl',['$scope', function ($scope) {
- $scope.Text = 'Design page';
+ angular.module('dashboard.design', []).config(['$stateProvider', '$urlRouterProvider', '$httpProvider', 'modulePermissionProvider', function($stateProvider, $urlRouterProvider, $httpProvider, modulePermissionProvider) {
+ var modulePerms = modulePermissionProvider.$get();
+ $stateProvider.state('dashboard.design.list', {
+ url: "/:provider/list",
+ templateUrl: "src/partials/sections/dashboard/design/view/designListView.html",
+ controller: "blueprintListCtrl as bpList",
+ params:{templateObj:null},
+ resolve: {
+ auth: ["$q", function ($q) {
+ var deferred = $q.defer();
+ // instead, go to a different page
+ if (modulePerms.analyticsBool()) {
+ // everything is fine, proceed
+ deferred.resolve();
+ } else {
+ deferred.reject({redirectTo: 'dashboard'});
+ }
+ return deferred.promise;
+ }]
+ }
+ }).state('dashboard.design.add', {
+ url: "/:provider/new",
+ templateUrl: "src/partials/sections/dashboard/design/view/blueprintCreate.html",
+ controller: "blueprintCreateCtrl as bpAdd",
+ params:{templateObj:null},
+ resolve: {
+ auth: ["$q", function ($q) {
+ var deferred = $q.defer();
+ // instead, go to a different page
+ if (modulePerms.analyticsBool()) {
+ // everything is fine, proceed
+ deferred.resolve();
+ } else {
+ deferred.reject({redirectTo: 'dashboard'});
+ }
+ return deferred.promise;
+ }]
+ }
+ })
+ }]).filter('inArray',['$filter', function($filter){
+ return function(list, arrayFilter, element){
+ if(arrayFilter){
+ return $filter("filter")(list, function(listItem){
+ return arrayFilter.indexOf(listItem[element]) === -1;
+ });
+ }
+ };
+ }])
+ .controller('designCtrl',['$scope','$state','genericServices', function ($scope,$state,genericServices) {
+ var design= this;
+ design.providersList= function () {
+ var params = {
+ url: 'src/partials/sections/dashboard/design/data/providers.json'
+ };
+ genericServices.promiseGet(params).then(function (data){
+ design.providersMenu=data;
+ design.tempType(data);
+ // $state.go('dashboard.designSubView',{subItem:data[0].name,view:'list'});
+ });
+
+ };
+ design.tempType=function (providers) {
+ var params = {
+ url: '/d4dMasters/readmasterjsonnew/16'
+ };
+ genericServices.promiseGet(params).then(function (template){
+ design.templateTypes=template;
+
+ //var treeNames=['DESIGN', $state.params.subItem,template[0].templateName,'list'];
+ //$rootScope.$emit('treeNameUpdate', treeNames);
+ //$state.go('dashboard.designSubView',{subItem:providers[0].name,view:'list',templateObj:template[0]});
+
+ });
+ // get organigetion
+ genericServices.getTreeNew().then(function (orgs) {
+ design.organObject=orgs;
+ });
+ };
+ design.providersList();
+ return design;
}]);
})(angular);
\ No newline at end of file
diff --git a/client/cat3/src/partials/sections/dashboard/design/services/blueprintCreateServices.js b/client/cat3/src/partials/sections/dashboard/design/services/blueprintCreateServices.js
new file mode 100644
index 000000000..739ccca0f
--- /dev/null
+++ b/client/cat3/src/partials/sections/dashboard/design/services/blueprintCreateServices.js
@@ -0,0 +1,267 @@
+(function (angular) {
+ "use strict";
+ angular.module('design.bpCreate',[])
+ .service('blueprintCreateService',['$rootScope','$http','$q','toastr', 'designServices', function ($rootScope,$http,$q,toastr,designServices) {
+ var blueprintServices = this;
+ //for getting the list of templates.
+ blueprintServices.getTemplates = function () {
+ var params = {
+ url: '/d4dMasters/readmasterjsonnew/17',
+ inlineLoader:true
+ };
+ return designServices.promiseGet(params);
+ };
+ //services listed for aws blueprints save and update.
+ blueprintServices.getImages = function () {
+ var params = {
+ url: '/vmimages',
+ inlineLoader:true
+ };
+ return designServices.promiseGet(params);
+ };
+ //list of operatig systems supported.
+ blueprintServices.getOperatingSytems = function () {
+ var params = {
+ url: '/aws/ec2/amiids',
+ inlineLoader:true
+ };
+ return designServices.promiseGet(params);
+ };
+ //listing down the aws providers.
+ blueprintServices.getAWSProviders = function () {
+ var params = {
+ url: '/aws/providers',
+ inlineLoader:true
+ };
+ return designServices.promiseGet(params);
+ };
+ /*getting the aws provider with respect to ID that can be used to list down the vmimage.
+ (gives region, key pair as well)*/
+ blueprintServices.getAWSProviderWithId = function (providerId) {
+ var params = {
+ url: '/aws/providers/' + providerId,
+ inlineLoader:true
+ };
+ return designServices.promiseGet(params);
+ };
+ //listing down the images created on the basis on aws providers.
+ blueprintServices.getImageLists = function (providerId) {
+ var params = {
+ url: '/vmimages/providers/' + providerId,
+ inlineLoader:true
+ };
+ return designServices.promiseGet(params);
+ };
+ //listing down the images created on the basis on aws providers.
+ blueprintServices.getRegionLists = function () {
+ var params = {
+ url: '/vmimages/regions/list',
+ inlineLoader:true
+ };
+ return designServices.promiseGet(params);
+ };
+ //listing down the instance type based upon the image selected.
+ blueprintServices.getInstanceType = function () {
+ var params = {
+ url: '/vmimages/instancesizes/all/list',
+ inlineLoader:true
+ };
+ return designServices.promiseGet(params);
+ };
+ //listing down the vpcs for aws providers.
+ blueprintServices.postVpcs = function (providerId,region) {
+ var params = {
+ url: '/aws/providers/describe/vpcs',
+ inlineLoader:true,
+ data: {
+ "providerId": providerId,
+ "region": region
+ }
+ };
+ return designServices.promisePost(params);
+ };
+ //listing down the subnets based upon the VPC ID.(set the instance count to 10 from Ctrl)
+ blueprintServices.postSubnets = function (vpcId,providerId,region) {
+ var params = {
+ url: '/aws/providers/vpc/'+ vpcId +'/subnets',
+ inlineLoader:true,
+ data: {
+ "providerId": providerId,
+ "region": region
+ }
+ };
+ return designServices.promisePost(params);
+ };
+ //listing down the security groups based upon the VPC ID.
+ blueprintServices.postSecurityGroups = function (vpcId,providerId,region) {
+ var params = {
+ url: '/aws/providers/vpc/'+ vpcId +'/securitygroups',
+ inlineLoader:true,
+ data: {
+ "providerId": providerId,
+ "region": region
+ }
+ };
+ return designServices.promisePost(params);
+ };
+ //listing down the subnets based upon the VPC ID.(set the instance count to 10 from Ctrl)
+ blueprintServices.getOrgBuProj = function () {
+ var params = {
+ url: '/organizations/getTreeNew'
+ };
+ return designServices.promiseGet(params);
+ };
+ //listing down the nexus server details associated to a project(on enabling checkbox, get GroupId)
+ blueprintServices.getNexusServerList = function () {
+ var params = {
+ url: '/d4dMasters/readmasterjsonnew/26',
+ inlineLoader:true
+ };
+ return designServices.promiseGet(params);
+ };
+ //listing down the docker details associate to a project(on enabling checkbox)
+ blueprintServices.getDockerList = function () {
+ var params = {
+ url: '/d4dMasters/readmasterjsonnew/18',
+ inlineLoader:true
+ };
+ return designServices.promiseGet(params);
+ };
+ //listing down the repos for nexus and docker based upon project and projectId(RepoName & group)
+ blueprintServices.getRepoList = function (projectId) {
+ var params = {
+ url: '/d4dMasters/project/' + projectId,
+ inlineLoader:true
+ };
+ return designServices.promiseGet(params);
+ };
+ //listing down the repo url related to the repository selected based upon nexusId
+ blueprintServices.getRepoUrl = function (nexusId) {
+ var params = {
+ url: '/nexus/'+ nexusId +'/repositories',
+ inlineLoader:true
+ };
+ return designServices.promiseGet(params);
+ };
+ //listing down the artifacts based upon nexusId,repo selected & the group.
+ blueprintServices.getArtifacts = function (nexusId, repoName, groupId) {
+ var params = {
+ url: '/nexus/' + nexusId + '/repositories/' + repoName + '/group/' + groupId + '/artifact',
+ inlineLoader:true
+ };
+ return designServices.promiseGet(params);
+ };
+ //listing down the versions based upon the nexuId, repo selected, group and artifact selected.
+ blueprintServices.getVersions = function (nexusId, repoName, groupId, artifactId) {
+ var params = {
+ url: '/nexus/' + nexusId + '/repositories/' + repoName + '/group/' + groupId + '/artifact/' + artifactId + '/versions',
+ inlineLoader:true
+ };
+ return designServices.promiseGet(params);
+ };
+ //list down the chefServer.
+ blueprintServices.getChefServer = function () {
+ var params = {
+ url: '/d4dMasters/readmasterjsonnew/10',
+ inlineLoader:true
+ };
+ return designServices.promiseGet(params);
+ };
+ //get the cft file details.
+ blueprintServices.getCFTParams = function (cftTemplateFileName) {
+ var params = {
+ url: '/d4dMasters/cftTemplate?templateFile=' + cftTemplateFileName,
+ inlineLoader:true
+ };
+ return designServices.promiseGet(params);
+ };
+ //save api for creating a blueprint
+ blueprintServices.postBlueprintSave = function (orgId,bgId,projectId,blueprintData) {
+ var params = {
+ url: '/organizations/' + orgId + '/businessgroups/' + bgId + '/projects/' + projectId + '/blueprints',
+ data: blueprintData
+ };
+ return designServices.promisePost(params);
+ };
+
+ //services listed for azure blueprints save and update.
+
+ //listing down the azure providers
+ blueprintServices.getAzureProviders = function() {
+ var params = {
+ url: '/azure/providers',
+ inlineLoader:true
+ };
+ return designServices.promiseGet(params);
+ };
+ //listing down azure locations
+ blueprintServices.getAzureLocations = function (azureProviderId) {
+ var params = {
+ //displayName
+ url: '/azure/' + azureProviderId + '/locations',
+ inlineLoader:true
+ };
+ return designServices.promiseGet(params);
+ };
+ //listing down the azure networks(VPC)
+ blueprintServices.getAzureVPC = function (azureProviderId) {
+ var params = {
+ url: '/azure/'+ azureProviderId +'/networks',
+ inlineLoader:true
+ };
+ return designServices.promiseGet(params);
+ };
+
+ //services listed for openstack blueprints save and update.
+ //listing down openstack providers
+ blueprintServices.getOpenStackProviders = function() {
+ var params = {
+ url: '/openstack/providers',
+ inlineLoader:true
+ };
+ return designServices.promiseGet(params);
+ };
+ //listing down the openstack flavors related to provider
+ blueprintServices.getProviderFlavors = function(providerId) {
+ var params = {
+ url: '/openstack/' + providerId + '/flavors',
+ inlineLoader:true
+ };
+ return designServices.promiseGet(params);
+ };
+ //listing down the openstack networks related to provider
+ blueprintServices.getProviderNetwork = function(providerId) {
+ var params = {
+ url: '/openstack/' + providerId + '/networks',
+ inlineLoader:true
+ };
+ return designServices.promiseGet(params);
+ };
+ //listing down the security groups related to provider
+ blueprintServices.getProviderSecurityGroup = function(providerId) {
+ var params = {
+ url: '/openstack/' + providerId + '/securityGroups',
+ inlineLoader:true
+ };
+ return designServices.promiseGet(params);
+ };
+
+ //services listed for vmware blueprints save and update.
+ //listing down vmware providers.
+ blueprintServices.getVmWareProviders = function() {
+ var params = {
+ url: '/vmware/providers',
+ inlineLoader:true
+ };
+ return designServices.promiseGet(params);
+ };
+ //listing down dataStore related to Provider.
+ blueprintServices.getProviderDataStore = function(providerId) {
+ var params = {
+ url: '/vmware/' + providerId + '/datastores',
+ inlineLoader:true
+ };
+ return designServices.promiseGet(params);
+ };
+ }]);
+})(angular);
\ No newline at end of file
diff --git a/client/cat3/src/partials/sections/dashboard/design/services/blueprintListServices.js b/client/cat3/src/partials/sections/dashboard/design/services/blueprintListServices.js
new file mode 100644
index 000000000..3e484a3f4
--- /dev/null
+++ b/client/cat3/src/partials/sections/dashboard/design/services/blueprintListServices.js
@@ -0,0 +1,108 @@
+(function (angular) {
+ "use strict";
+ angular.module('design.BpList',[])
+ .service('blueprintService',['$rootScope','$http','$q','toastr','$state','$modal','confirmbox','designServices',function ($rootScope,$http,$q,toastr,$state,$modal,confirmbox,designServices) {
+ var bpServ={};
+ bpServ.createList = function(bpType){
+ var organObjectId=[];
+ ///organObjectId.envOptions=$rootScope.organObject[$rootScope.organNewEnt.org].environments;
+ if($rootScope.organObject){
+ var tempType=(bpType) ? bpType :$state.params.templateObj.templatetype;
+ var pagination =(bpType) ? false :true;
+ organObjectId.org =$rootScope.organObject[$rootScope.organNewEnt.org].rowid;
+ organObjectId.buss=$rootScope.organObject[$rootScope.organNewEnt.org].businessGroups[$rootScope.organNewEnt.buss].rowid;
+ organObjectId.proj=$rootScope.organObject[$rootScope.organNewEnt.org].businessGroups[$rootScope.organNewEnt.buss].projects[$rootScope.organNewEnt.proj].rowid;
+ var params = {
+ url: '/organizations/'+organObjectId.org+'/businessgroups/'+organObjectId.buss+'/projects/'+organObjectId.proj+'/blueprintList?pagination='+pagination+'&templateType='+tempType+'&providerType='+angular.lowercase($state.params.subItem)
+ };
+ return designServices.promiseGet(params);
+ }
+ };
+ bpServ.launchBp = function (id) {
+ $modal.open({
+ animate: true,
+ templateUrl: "src/partials/sections/dashboard/design/view/popups/blueprintLaunch.html",
+ controller: "bpLaunchInstanceCtrl as lanIns",
+ backdrop: 'static',
+ keyboard: false,
+ resolve: {
+ bpItem: function() {
+ return {
+ id:id,
+ organObject:$rootScope.organObject
+ };
+ }
+ }
+ }).result.then(function(env) {
+ var params = {
+ url: '/blueprint-frames/',
+ data:{
+ "blueprintId": id,
+ "environmentId": env
+ }
+ };
+ designServices.promisePost(params).then(function () {
+ toastr.success('Successfully launched.');
+ });
+ });
+ };
+ bpServ.copyBp = function (ids) {
+ $modal.open({
+ animate: true,
+ templateUrl: "src/partials/sections/dashboard/design/view/popups/blueprintCopy.html",
+ controller: "bpCopyCtrl as bpCopy",
+ backdrop: 'static',
+ keyboard: false,
+ resolve: {
+ bpItem: function() {
+ return {
+ ids:ids,
+ organObject:$rootScope.organObject
+ };
+ }
+ }
+ }).result.then(function(orgDetails) {
+ var params = {
+ url: '/blueprints/copy/',
+ data:{
+ "orgid": $rootScope.organObject[orgDetails.copyOrg].rowid,
+ "buid": $rootScope.organObject[orgDetails.copyOrg].businessGroups[orgDetails.copyBuss].rowid,
+ "projid": $rootScope.organObject[orgDetails.copyOrg].businessGroups[orgDetails.copyBuss].projects[orgDetails.copyProj].rowid,
+ "blueprints":ids
+ }
+ };
+ designServices.promisePost(params).then(function () {
+ toastr.success('Successfully copied.');
+ });
+ });
+ };
+ bpServ.deleteBp = function (ids) {
+ var modalOptions = {
+ closeButtonText: 'Cancel',
+ actionButtonText: 'Delete',
+ actionButtonStyle: 'cat-btn-delete',
+ headerText: 'Delete Blueprint',
+ bodyText: 'Are you sure you would like to remove the selected blueprints ?'
+ };
+ confirmbox.showModal({}, modalOptions).then(function() {
+ var bPIds=[];
+ if(angular.isArray(ids)){
+ bPIds=ids;
+ } else {
+ bPIds.push(ids);
+ }
+ var params = {
+ url: '/blueprints',
+ data:{blueprints:bPIds}
+ };
+ return designServices.promiseDelete(params).then(function(){
+ toastr.success('Successfully deleted');
+ angular.each(ids,function (val) {
+ angular.element('#'+val).hide();
+ });
+ });
+ });
+ };
+ return bpServ;
+ }]);
+})(angular);
\ No newline at end of file
diff --git a/client/cat3/src/partials/sections/dashboard/design/view/blueprintCreate.html b/client/cat3/src/partials/sections/dashboard/design/view/blueprintCreate.html
new file mode 100644
index 000000000..d6eea0036
--- /dev/null
+++ b/client/cat3/src/partials/sections/dashboard/design/view/blueprintCreate.html
@@ -0,0 +1,490 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/client/cat3/src/partials/sections/dashboard/design/view/createComposite.html b/client/cat3/src/partials/sections/dashboard/design/view/createComposite.html
new file mode 100644
index 000000000..214400814
--- /dev/null
+++ b/client/cat3/src/partials/sections/dashboard/design/view/createComposite.html
@@ -0,0 +1,164 @@
+
+
+
+
+ Composite Blueprint:
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/client/cat3/src/partials/sections/dashboard/design/view/designListView.html b/client/cat3/src/partials/sections/dashboard/design/view/designListView.html
new file mode 100644
index 000000000..39301e1d7
--- /dev/null
+++ b/client/cat3/src/partials/sections/dashboard/design/view/designListView.html
@@ -0,0 +1,75 @@
+
\ No newline at end of file
diff --git a/client/cat3/src/partials/sections/dashboard/design/view/filterSidebar.html b/client/cat3/src/partials/sections/dashboard/design/view/filterSidebar.html
new file mode 100644
index 000000000..ae93a094e
--- /dev/null
+++ b/client/cat3/src/partials/sections/dashboard/design/view/filterSidebar.html
@@ -0,0 +1,24 @@
+
+
+
\ No newline at end of file
diff --git a/client/cat3/src/partials/sections/dashboard/design/view/popups/blueprintCopy.html b/client/cat3/src/partials/sections/dashboard/design/view/popups/blueprintCopy.html
new file mode 100644
index 000000000..23820ad36
--- /dev/null
+++ b/client/cat3/src/partials/sections/dashboard/design/view/popups/blueprintCopy.html
@@ -0,0 +1,40 @@
+
+
+
+
Select target
+
+
+
+
+
diff --git a/client/cat3/src/partials/sections/dashboard/design/view/popups/blueprintLaunch.html b/client/cat3/src/partials/sections/dashboard/design/view/popups/blueprintLaunch.html
new file mode 100644
index 000000000..cda51b860
--- /dev/null
+++ b/client/cat3/src/partials/sections/dashboard/design/view/popups/blueprintLaunch.html
@@ -0,0 +1,40 @@
+