From 8f53558faf13fbfa86f2d0ed10fb6fd23e692696 Mon Sep 17 00:00:00 2001 From: Divakar Konakalla Date: Tue, 18 Oct 2016 13:24:43 +0530 Subject: [PATCH 1/7] Added tag server check, added dropdown to select a server to tag. --- client/cat3/src/factory/workzoneServices.js | 4 +- .../blueprint/popups/blueprintLaunchCtrl.js | 3 +- .../popups/blueprintLaunchParams.html | 59 +++++++++++++------ .../popups/blueprintLaunchParamsCtrl.js | 12 +++- .../instance/popups/InstanceImportByIpCtrl.js | 14 ++++- .../instance/popups/instanceImportByIp.html | 20 +++++-- .../htmls/private/ajax/Settings/chefSync.html | 44 ++++++++++++-- 7 files changed, 123 insertions(+), 33 deletions(-) diff --git a/client/cat3/src/factory/workzoneServices.js b/client/cat3/src/factory/workzoneServices.js index c3bca326a..598ee2bbc 100644 --- a/client/cat3/src/factory/workzoneServices.js +++ b/client/cat3/src/factory/workzoneServices.js @@ -99,9 +99,9 @@ var url = '/blueprints/' + blueprintID; return $http.delete(fullUrl(url), Auth.getHeaderObject()); }, - launchBlueprint: function (blueprintID, version, envId, stackName,domainName) { + launchBlueprint: function (blueprintID, version, envId, stackName,domainName, tagServer) { var url = '/blueprints/' + blueprintID + '/launch?version=' + version + - '&envId=' + envId + '&stackName=' + stackName + '&domainName=' + domainName; + '&envId=' + envId + '&stackName=' + stackName + '&domainName=' + domainName + '&tagServer=' + tagServer; return $http.get(fullUrl(url), Auth.getHeaderObject()); }, getBlueprintById: function(blueprintId) { diff --git a/client/cat3/src/partials/sections/dashboard/workzone/blueprint/popups/blueprintLaunchCtrl.js b/client/cat3/src/partials/sections/dashboard/workzone/blueprint/popups/blueprintLaunchCtrl.js index 6527ef150..505484c33 100644 --- a/client/cat3/src/partials/sections/dashboard/workzone/blueprint/popups/blueprintLaunchCtrl.js +++ b/client/cat3/src/partials/sections/dashboard/workzone/blueprint/popups/blueprintLaunchCtrl.js @@ -9,6 +9,7 @@ "use strict"; angular.module('workzone.blueprint') .controller('blueprintLaunchCtrl', ['$scope', '$rootScope', '$modalInstance', 'bpItem', 'workzoneServices', 'workzoneEnvironment', 'instanceLogs', function($scope, $rootScope, $modalInstance, bpItem, workzoneServices, workzoneEnvironment, instanceLogs) { + console.log(bpItem); $scope.isBPLogsLoading = true; $scope.isNewInstanceLogsPromise = false; var helper = { @@ -79,7 +80,7 @@ versionOptional = versionsList[versionsList.length-1].ver; } var selectedVersionBpId = bpItem.bp.selectedVersionBpId; - workzoneServices.launchBlueprint(selectedVersionBpId, versionOptional, envParams.env, bpItem.stackName,bpItem.domainName).then(function(bpLaunchResponse) { + workzoneServices.launchBlueprint(selectedVersionBpId, versionOptional, envParams.env, bpItem.stackName,bpItem.domainName,bpItem.tagServer).then(function(bpLaunchResponse) { $scope.isBPLogsLoading = false; var launchingInstance; if(bpLaunchResponse.data.id && bpLaunchResponse.data.id.length>0){ diff --git a/client/cat3/src/partials/sections/dashboard/workzone/blueprint/popups/blueprintLaunchParams.html b/client/cat3/src/partials/sections/dashboard/workzone/blueprint/popups/blueprintLaunchParams.html index 1e9c339da..9f7775c77 100644 --- a/client/cat3/src/partials/sections/dashboard/workzone/blueprint/popups/blueprintLaunchParams.html +++ b/client/cat3/src/partials/sections/dashboard/workzone/blueprint/popups/blueprintLaunchParams.html @@ -9,27 +9,48 @@
Add Application URL -
- - -
+
+ + +
+
+ +
+ +
+
diff --git a/client/htmls/private/ajax/Settings/chefSync.html b/client/htmls/private/ajax/Settings/chefSync.html index 10236f3b7..35d07e690 100755 --- a/client/htmls/private/ajax/Settings/chefSync.html +++ b/client/htmls/private/ajax/Settings/chefSync.html @@ -232,9 +232,24 @@ -
+
+
- + +
+
+ + +
+ + + +
+
  • +
    + SERVICE +
    +
  • +
  • + +
  • @@ -46,18 +58,26 @@ {{appDetails.cn | uppercase}} [{{appDetails.roleId}}]
    - - -
    - +
  • From 04c83d4862449945196f9655e2e59828c11d7c74 Mon Sep 17 00:00:00 2001 From: Divakar Konakalla Date: Tue, 18 Oct 2016 21:41:42 +0530 Subject: [PATCH 5/7] UI changes. --- client/cat3/src/partials/globals/header/headerDashboard.html | 5 ----- 1 file changed, 5 deletions(-) diff --git a/client/cat3/src/partials/globals/header/headerDashboard.html b/client/cat3/src/partials/globals/header/headerDashboard.html index fecd8808b..12f3720b7 100644 --- a/client/cat3/src/partials/globals/header/headerDashboard.html +++ b/client/cat3/src/partials/globals/header/headerDashboard.html @@ -39,11 +39,6 @@ ANALYTICS -
  • -
    - SERVICE -
    -
  • From a078c20433d8c4a0ffef3e0fde2f5c8bc70fe342 Mon Sep 17 00:00:00 2001 From: VIJAYKUMARNINGANURE Date: Wed, 19 Oct 2016 15:26:36 +0530 Subject: [PATCH 6/7] Implemnetd the Bot type lists and Tagging server list --- client/cat3/src/factory/workzoneServices.js | 4 +++ .../orchestration/popups/newTaskCtrl.js | 34 +++++++++++------- client/htmls/private/js/dev/awsProduction.js | 1 + server/app/model/blueprint/blueprint.js | 20 ++++++++++- server/app/model/classes/tasks/tasks.js | 17 +++++++++ server/app/routes/v1.0/routes.js | 3 ++ server/app/routes/v1.0/routes_blueprints.js | 31 ++++++++++------ server/app/routes/v1.0/routes_config_data.js | 36 +++++++++++++++++++ server/app/routes/v1.0/routes_d4dMasters.js | 7 ---- .../app/routes/v1.0/routes_organizations.js | 2 ++ server/app/routes/v1.0/routes_tasks.js | 22 ++++++++++++ server/install.js | 1 + 12 files changed, 148 insertions(+), 30 deletions(-) create mode 100644 server/app/routes/v1.0/routes_config_data.js diff --git a/client/cat3/src/factory/workzoneServices.js b/client/cat3/src/factory/workzoneServices.js index c3bca326a..5c4f01bcb 100644 --- a/client/cat3/src/factory/workzoneServices.js +++ b/client/cat3/src/factory/workzoneServices.js @@ -527,6 +527,10 @@ getUnassignedInstances:function (providerId) { var url ='/providers/'+providerId+'/unassigned-instances'; return $http.get(fullUrl(url),Auth.getHeaderObject()); + }, + getBotTypeList:function () { + var url ='/config-data/bot-type'; + return $http.get(fullUrl(url),Auth.getHeaderObject()); } }; return serviceInterface; diff --git a/client/cat3/src/partials/sections/dashboard/workzone/orchestration/popups/newTaskCtrl.js b/client/cat3/src/partials/sections/dashboard/workzone/orchestration/popups/newTaskCtrl.js index 2c1b5ddec..88d673ae0 100644 --- a/client/cat3/src/partials/sections/dashboard/workzone/orchestration/popups/newTaskCtrl.js +++ b/client/cat3/src/partials/sections/dashboard/workzone/orchestration/popups/newTaskCtrl.js @@ -176,6 +176,11 @@ var idx = $scope.jenkinsParamsList.indexOf(params); $scope.jenkinsParamsList.splice(idx,1); }, + botTypeList : function() { + workzoneServices.getBotTypeList().then(function (response) { + $scope.botTypeList = response; + }); + }, removeScriptParams: function (scriptObject,params) { var idx = $scope.scriptParamsObj[scriptObject].indexOf(params); $scope.scriptParamsObj[scriptObject].splice(idx,1); @@ -253,18 +258,23 @@ }, ok: function () { //these values are common across all task types - var taskJSON = { - taskType: $scope.taskType, - name: $scope.name, - botType: $scope.botType, - shortDesc: $scope.shortDesc, - description: $scope.description - }; + var taskJSON={} if($scope.checkBotType){ - taskJSON.botType = $scope.botType; - taskJSON.shortDesc= $scope.shortDesc; + taskJSON = { + taskType: $scope.taskType, + name: $scope.name, + description: $scope.description, + botType:$scope.botType, + shortDesc:$scope.shortDesc, + serviceDeliveryCheck:$scope.checkBotType + }; $scope.taskSaving = true; }else{ + taskJSON = { + taskType: $scope.taskType, + name: $scope.name, + description: $scope.description + }; $scope.taskSaving = true; } //checking for name of the task @@ -580,12 +590,12 @@ $scope.description = items.description; $scope.taskType = items.taskType; $scope.name = items.name; - if(items.shortDesc && (items.shortDesc !== '' || items.shortDesc !== null)){ + if(items.serviceDeliveryCheck && items.serviceDeliveryCheck === true){ $scope.checkBotStatus = true; $scope.checkBotType = true; + $scope.botType = items.botType; + $scope.shortDesc = items.shortDesc; } - $scope.botType = items.botType; - $scope.shortDesc = items.shortDesc; //properties specific to jenkins if (items.taskType === "jenkins") { $scope.jobUrl = items.taskConfig.jobURL; diff --git a/client/htmls/private/js/dev/awsProduction.js b/client/htmls/private/js/dev/awsProduction.js index a3df1df9e..9105be6ae 100644 --- a/client/htmls/private/js/dev/awsProduction.js +++ b/client/htmls/private/js/dev/awsProduction.js @@ -1558,6 +1558,7 @@ var saveblueprint = function(tempType) { if ($('#serviceDeliveryCheck').prop("checked")) { reqBody.botType = $('#botType').val(); reqBody.shortDesc = $('#shortDesc').val(); + reqBody.serviceDeliveryCheck = true; } var imageIdentifier = $('#imageId').val(); var imageId = $('#imageId').find('option:selected').attr('_id'); diff --git a/server/app/model/blueprint/blueprint.js b/server/app/model/blueprint/blueprint.js index f894cd8c2..bb068a25f 100755 --- a/server/app/model/blueprint/blueprint.js +++ b/server/app/model/blueprint/blueprint.js @@ -161,6 +161,10 @@ var BlueprintSchema = new Schema({ }, botType: { type: String + }, + serviceDeliveryCheck: { + type: Boolean, + default:false } }); @@ -442,7 +446,8 @@ BlueprintSchema.statics.createNew = function(blueprintData, callback) { parentId: blueprintData.id, domainNameCheck: blueprintData.domainNameCheck, shortDesc:blueprintData.shortDesc, - botType:blueprintData.botType + botType:blueprintData.botType, + serviceDeliveryCheck:blueprintData.serviceDeliveryCheck }; var blueprint = new Blueprints(blueprintObj); logger.debug(blueprint); @@ -974,6 +979,19 @@ BlueprintSchema.statics.getBlueprintsByOrgBgProject = function(jsonData, callbac }; + +BlueprintSchema.statics.getBlueprintsServiceDeliveryCheck = function(serviceDeliveryCheck, callback) { + this.find({serviceDeliveryCheck:serviceDeliveryCheck}, function(err, blueprints) { + if (err) { + callback(err, null); + return; + } + callback(null, blueprints); + return; + }); + +}; + BlueprintSchema.statics.getBlueprintsByOrgBgProjectProvider = function(jsonData, callback) { var queryObj = { orgId: jsonData.orgId, diff --git a/server/app/model/classes/tasks/tasks.js b/server/app/model/classes/tasks/tasks.js index 829c08d20..85ded6e7b 100755 --- a/server/app/model/classes/tasks/tasks.js +++ b/server/app/model/classes/tasks/tasks.js @@ -91,6 +91,10 @@ var taskSchema = new Schema({ description: { type: String }, + serviceDeliveryCheck: { + type: Boolean, + default:false + }, jobResultURLPattern: { type: [String] }, @@ -565,6 +569,18 @@ taskSchema.statics.getScriptTypeTask = function(callback){ }); }; +taskSchema.statics.getTasksServiceDeliveryCheck = function(serviceDeliveryCheck, callback) { + this.find({serviceDeliveryCheck:serviceDeliveryCheck}, function(err, tasks) { + if (err) { + callback(err, null); + return; + } + callback(null, tasks); + return; + }); +}; + + taskSchema.statics.getTaskById = function(taskId, callback) { this.find({ "_id": new ObjectId(taskId) @@ -680,6 +696,7 @@ taskSchema.statics.updateTaskById = function(taskId, taskData, callback) { taskType: taskData.taskType, shortDesc: taskData.shortDesc, botType: taskData.botType, + serviceDeliveryCheck:taskData.serviceDeliveryCheck, description: taskData.description, jobResultURLPattern: taskData.jobResultURL, blueprintIds: taskData.blueprintIds diff --git a/server/app/routes/v1.0/routes.js b/server/app/routes/v1.0/routes.js index ee2f00cd0..7b8bf7057 100755 --- a/server/app/routes/v1.0/routes.js +++ b/server/app/routes/v1.0/routes.js @@ -73,6 +73,7 @@ var auditTrail = require('./routes_audit_trails'); var scripts = require('./routes_scripts'); var fileUpload = require('./routes_fileUpload'); var settingWizard = require('./routes_setting_wizard'); +var configData = require('./routes_config_data'); /* * @TODO * Change app to router in internal routes files @@ -181,6 +182,8 @@ module.exports.setRoutes = function(app) { settingWizard.setRoutes(app, sessionVerificationFunc); + configData.setRoutes(app, sessionVerificationFunc); + app.get('/', function(req, res) { res.redirect('/cat3'); diff --git a/server/app/routes/v1.0/routes_blueprints.js b/server/app/routes/v1.0/routes_blueprints.js index 4a28cd542..ef193cb6d 100755 --- a/server/app/routes/v1.0/routes_blueprints.js +++ b/server/app/routes/v1.0/routes_blueprints.js @@ -55,6 +55,25 @@ var blueprintService = require('_pr/services/blueprintService.js'); module.exports.setRoutes = function(app, sessionVerificationFunc) { app.all('/blueprints/*', sessionVerificationFunc); + app.get('/blueprints/serviceDelivery', function(req, res) { + var serviceDeliveryCheck = false; + if(req.query.serviceDeliveryCheck && + (req.query.serviceDeliveryCheck === 'true' || req.query.serviceDeliveryCheck === true)) { + serviceDeliveryCheck = true; + } + + Blueprints.getBlueprintsServiceDeliveryCheck(serviceDeliveryCheck, function(err, blueprints) { + if (err) { + res.status(500).send({ + code: 500, + errMessage: "Blueprints fetch failed." + }); + return; + } + res.status(200).send(blueprints); + }); + }); + // This post() Not in use app.post('/blueprints', function(req, res) { logger.debug("Enter post() for /blueprints"); @@ -527,10 +546,7 @@ module.exports.setRoutes = function(app, sessionVerificationFunc) { var orgId = req.params.orgId; var bgId = req.params.bgId; var projectId = req.params.projectId; - var serviceDeliveryCheck = false; - if(req.query.serviceDeliveryCheck){ - serviceDeliveryCheck = req.query.serviceDeliveryCheck; - } + if (!orgId || !bgId || !projectId) { res.status(400).send("Either orgId or bgId or projectId missing."); return; @@ -541,11 +557,6 @@ module.exports.setRoutes = function(app, sessionVerificationFunc) { jsonData['bgId'] = bgId; jsonData['projectId'] = projectId; - if(serviceDeliveryCheck === 'true' || serviceDeliveryCheck === true){ - jsonData['botType'] = {$ne:null}; - jsonData['shortDesc'] = {$ne:null}; - } - Blueprints.getBlueprintsByOrgBgProject(jsonData, function(err, blueprints) { if (err) { res.status(500).send({ @@ -557,4 +568,4 @@ module.exports.setRoutes = function(app, sessionVerificationFunc) { res.status(200).send(blueprints); }); }); -}; \ No newline at end of file +}; diff --git a/server/app/routes/v1.0/routes_config_data.js b/server/app/routes/v1.0/routes_config_data.js new file mode 100644 index 000000000..8c09d31b1 --- /dev/null +++ b/server/app/routes/v1.0/routes_config_data.js @@ -0,0 +1,36 @@ +/* + Copyright [2016] [Relevance Lab] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + */ + +var appConfig = require('_pr/config'); +var logger = require('_pr/logger')(module); + + +module.exports.setRoutes = function(app, sessionVerification) { + + app.all('/config-data/*', sessionVerification); + + // Tagging Server List + app.get('/config-data/tagging-server', function(req, res) { + var serverList = appConfig.taggingServerList; + res.send(serverList); + }); + + // Bot Type List + app.get('/config-data/bot-type', function(req, res) { + var botTypeList = appConfig.botTypeList; + res.send(botTypeList); + }); +} \ No newline at end of file diff --git a/server/app/routes/v1.0/routes_d4dMasters.js b/server/app/routes/v1.0/routes_d4dMasters.js index 6a28e0fb6..c31e50ef2 100755 --- a/server/app/routes/v1.0/routes_d4dMasters.js +++ b/server/app/routes/v1.0/routes_d4dMasters.js @@ -4019,11 +4019,4 @@ module.exports.setRoutes = function(app, sessionVerification) { } }); }); - - // Tagging Server List - app.get('/d4dMasters/taggingServerList', function(req, res) { - var serverList = appConfig.taggingServerList; - res.send(serverList); - }); - } \ No newline at end of file diff --git a/server/app/routes/v1.0/routes_organizations.js b/server/app/routes/v1.0/routes_organizations.js index 8a1f32f80..9492bd8a5 100755 --- a/server/app/routes/v1.0/routes_organizations.js +++ b/server/app/routes/v1.0/routes_organizations.js @@ -681,6 +681,7 @@ module.exports.setRoutes = function(app, sessionVerification) { var blueprintId = req.body.blueprintData.blueprintId; var shortDesc = req.body.blueprintData.shortDesc; var botType = req.body.blueprintData.botType; + var serviceDeliveryCheck = req.body.blueprintData.serviceDeliveryCheck; if(req.body.blueprintData.domainNameCheck === 'true'){ domainNameCheck = true; } @@ -729,6 +730,7 @@ module.exports.setRoutes = function(app, sessionVerification) { docker: docker, shortDesc:shortDesc, botType:botType, + serviceDeliveryCheck:serviceDeliveryCheck, domainNameCheck:domainNameCheck }; //adding bluerpintID if present (edit mode) diff --git a/server/app/routes/v1.0/routes_tasks.js b/server/app/routes/v1.0/routes_tasks.js index bb1eab464..ed43ab567 100755 --- a/server/app/routes/v1.0/routes_tasks.js +++ b/server/app/routes/v1.0/routes_tasks.js @@ -38,6 +38,24 @@ var fileIo = require('_pr/lib/utils/fileio'); module.exports.setRoutes = function(app, sessionVerification) { app.all('/tasks/*', sessionVerification); + app.get('/tasks/serviceDelivery', function(req, res) { + var serviceDeliveryCheck = false; + if(req.query.serviceDeliveryCheck && + (req.query.serviceDeliveryCheck === 'true' || req.query.serviceDeliveryCheck === true)) { + serviceDeliveryCheck = true; + } + Tasks.getTasksServiceDeliveryCheck(serviceDeliveryCheck, function(err, tasks) { + if (err) { + res.status(500).send({ + code: 500, + errMessage: "Task fetch failed." + }); + return; + } + res.status(200).send(tasks); + }); + }); + app.get('/tasks/history/list/all', function(req, res) { logger.debug("------------------ ",JSON.stringify(TaskHistory)); TaskHistory.listHistory(function(err, tHistories) { @@ -574,6 +592,8 @@ module.exports.setRoutes = function(app, sessionVerification) { }); }); + + }; function encryptedParam(paramDetails,existingParams,callback){ @@ -612,3 +632,5 @@ function encryptedParam(paramDetails,existingParams,callback){ })(paramDetails[i]); } } + + diff --git a/server/install.js b/server/install.js index 446fc3e16..3096afe21 100755 --- a/server/install.js +++ b/server/install.js @@ -129,6 +129,7 @@ function getDefaultsConfig() { } }, taggingServerList: ['Sensu Server','LDAP Server','AD Server'], + botTypeList: ['Task','Check','Learning', 'Composite','Built with other'], aws: { pemFileLocation: __dirname + '/app/config/', s3BucketDownloadFileLocation: currentDirectory + '/catdata/catalyst/temp/', From 9f484276821bb846e5295a63065336bb7ffc43f5 Mon Sep 17 00:00:00 2001 From: hrushikesh07 Date: Wed, 19 Oct 2016 18:05:17 +0530 Subject: [PATCH 7/7] New base and pages for bots --- client/cat3/Gruntfile.js | 2 +- client/cat3/main.html | 3 +- client/cat3/src/clientRoutes.js | 8 ++-- client/cat3/src/partials/global.scss | 2 + .../sections/dashboard/bots/bots.html | 14 +++++++ .../{service/service.scss => bots/bots.scss} | 0 .../sections/dashboard/bots/botsCtrl.js | 29 ++++++++++++++ .../dashboard/bots/controller/libraryCtrl.js | 38 ++++++++++++++++++ .../view/botsTreeMenu.html} | 40 +++++-------------- .../sections/dashboard/bots/view/library.html | 2 + .../sections/dashboard/dashboardCtrl.js | 2 +- .../sections/dashboard/service/service.html | 13 ------ .../sections/dashboard/service/service.js | 7 ---- client/htmls/private/index.html | 25 +++++++++++- 14 files changed, 128 insertions(+), 57 deletions(-) create mode 100644 client/cat3/src/partials/sections/dashboard/bots/bots.html rename client/cat3/src/partials/sections/dashboard/{service/service.scss => bots/bots.scss} (100%) create mode 100644 client/cat3/src/partials/sections/dashboard/bots/botsCtrl.js create mode 100644 client/cat3/src/partials/sections/dashboard/bots/controller/libraryCtrl.js rename client/cat3/src/partials/sections/dashboard/{service/view/serviceTreeMenu.html => bots/view/botsTreeMenu.html} (50%) create mode 100644 client/cat3/src/partials/sections/dashboard/bots/view/library.html delete mode 100644 client/cat3/src/partials/sections/dashboard/service/service.html delete mode 100644 client/cat3/src/partials/sections/dashboard/service/service.js diff --git a/client/cat3/Gruntfile.js b/client/cat3/Gruntfile.js index 8028c9b59..06a759423 100644 --- a/client/cat3/Gruntfile.js +++ b/client/cat3/Gruntfile.js @@ -89,7 +89,7 @@ module.exports = function(grunt) { {'catalyst/partials/sections/dashboard/workzone/orchestration/orchestration.css':'src/partials/sections/dashboard/workzone/orchestration/orchestration.scss'}, {'catalyst/partials/sections/dashboard/workzone/application/application.css':'src/partials/sections/dashboard/workzone/application/application.scss'}, {'catalyst/partials/sections/dashboard/analytics/analytics.css':'src/partials/sections/dashboard/analytics/analytics.scss'}, - {'catalyst/partials/sections/dashboard/service/service.css':'src/partials/sections/dashboard/service/service.scss'}, + {'catalyst/partials/sections/dashboard/bots/bots.css':'src/partials/sections/dashboard/bots/bots.scss'}, {'catalyst/partials/sections/dashboard/setting/setting.css':'src/partials/sections/dashboard/setting/setting.scss'} ] } diff --git a/client/cat3/main.html b/client/cat3/main.html index 928f4c73a..476a55985 100644 --- a/client/cat3/main.html +++ b/client/cat3/main.html @@ -102,7 +102,8 @@ - + + diff --git a/client/cat3/src/clientRoutes.js b/client/cat3/src/clientRoutes.js index 9d2e187d3..d9a6198b2 100644 --- a/client/cat3/src/clientRoutes.js +++ b/client/cat3/src/clientRoutes.js @@ -88,10 +88,10 @@ function routeConfig($stateProvider, $urlRouterProvider, $httpProvider, modulePe }] } - }).state('dashboard.service', { - url: "/service/", - templateUrl: "src/partials/sections/dashboard/service/service.html", - controller: "serviceCtrl", + }).state('dashboard.bots', { + url: "/bots", + templateUrl: "src/partials/sections/dashboard/bots/bots.html", + controller: "botsCtrl as bts", resolve: { auth: ["$q", function ($q) { var deferred = $q.defer(); diff --git a/client/cat3/src/partials/global.scss b/client/cat3/src/partials/global.scss index 7a29b39c0..d5b0a1221 100644 --- a/client/cat3/src/partials/global.scss +++ b/client/cat3/src/partials/global.scss @@ -112,6 +112,7 @@ $imagePath : "../../../../../../cat3/images"; z-index: 10; transition: all .4s ease 0s; left: -254px; + height: 100%; &.show-left-tree { left: 0px; @@ -121,6 +122,7 @@ $imagePath : "../../../../../../cat3/images"; background: linear-gradient(to right, #2c3638 99%, #2c3638 100%); color: #fff; overflow-y: auto; + height: 100%; } div[data-angular-treeview] { diff --git a/client/cat3/src/partials/sections/dashboard/bots/bots.html b/client/cat3/src/partials/sections/dashboard/bots/bots.html new file mode 100644 index 000000000..f2dec4d06 --- /dev/null +++ b/client/cat3/src/partials/sections/dashboard/bots/bots.html @@ -0,0 +1,14 @@ + + +
    +
    +
    +
    + + +
    +
    +
    +
    +
    +
    \ No newline at end of file diff --git a/client/cat3/src/partials/sections/dashboard/service/service.scss b/client/cat3/src/partials/sections/dashboard/bots/bots.scss similarity index 100% rename from client/cat3/src/partials/sections/dashboard/service/service.scss rename to client/cat3/src/partials/sections/dashboard/bots/bots.scss diff --git a/client/cat3/src/partials/sections/dashboard/bots/botsCtrl.js b/client/cat3/src/partials/sections/dashboard/bots/botsCtrl.js new file mode 100644 index 000000000..fb1542003 --- /dev/null +++ b/client/cat3/src/partials/sections/dashboard/bots/botsCtrl.js @@ -0,0 +1,29 @@ +(function (angular) { + "use strict"; + angular.module('dashboard.bots', ['library.bots']).config(['$stateProvider', '$urlRouterProvider', '$httpProvider', 'modulePermissionProvider', function($stateProvider, $urlRouterProvider, $httpProvider, modulePermissionProvider) { + var modulePerms = modulePermissionProvider.$get(); + $stateProvider.state('dashboard.bots.library', { + url: "/library", + templateUrl: "src/partials/sections/dashboard/bots/view/library.html", + controller: "libraryCtrl as libr", + 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; + }] + } + }) + }]) + .controller('botsCtrl',['$scope', '$rootScope','$state', function ($scope, $rootScope,$state) { + var treeNames = ['Bots']; + $rootScope.$emit('treeNameUpdate', treeNames); + $state.go('dashboard.bots.library'); + }]); +})(angular); \ No newline at end of file diff --git a/client/cat3/src/partials/sections/dashboard/bots/controller/libraryCtrl.js b/client/cat3/src/partials/sections/dashboard/bots/controller/libraryCtrl.js new file mode 100644 index 000000000..e28d40b6d --- /dev/null +++ b/client/cat3/src/partials/sections/dashboard/bots/controller/libraryCtrl.js @@ -0,0 +1,38 @@ +(function (angular) { + "use strict"; + angular.module('library.bots', []) + .controller('libraryCtrl',['$scope', '$rootScope','$state','genericServices', function ($scope, $rootScope,$state,genSevs) { + var treeNames = ['Bots','Library']; + $rootScope.$emit('treeNameUpdate', treeNames); + var lib=this; + lib.gridOptions={ + gridOption:{ + paginationPageSizes: [25, 50, 75], + paginationPageSize: 25, + enableColumnMenus:false, + multiSelect :false, + }, + columnDefs: [ + { name: 'type'}, + { name: 'name'}, + { name: 'description'}, + { name: 'run Bot' }, + { name: 'history' }, + { name: 'last run'}, + { name: 'bot Action'} + ], + data:[{},{}] + }; + + lib.int =function(){ + var param={ + url:'/config-data/bot-type' + }; + genSevs.promiseGet(param).then(function (result) { + + }); + }; + lib.int(); + + }]); +})(angular); \ No newline at end of file diff --git a/client/cat3/src/partials/sections/dashboard/service/view/serviceTreeMenu.html b/client/cat3/src/partials/sections/dashboard/bots/view/botsTreeMenu.html similarity index 50% rename from client/cat3/src/partials/sections/dashboard/service/view/serviceTreeMenu.html rename to client/cat3/src/partials/sections/dashboard/bots/view/botsTreeMenu.html index 3d1f51af9..b796404bd 100644 --- a/client/cat3/src/partials/sections/dashboard/service/view/serviceTreeMenu.html +++ b/client/cat3/src/partials/sections/dashboard/bots/view/botsTreeMenu.html @@ -1,7 +1,7 @@ -
    +
    - - - diff --git a/client/cat3/src/partials/sections/dashboard/bots/view/library.html b/client/cat3/src/partials/sections/dashboard/bots/view/library.html new file mode 100644 index 000000000..32fc54891 --- /dev/null +++ b/client/cat3/src/partials/sections/dashboard/bots/view/library.html @@ -0,0 +1,2 @@ +
    +
    \ No newline at end of file diff --git a/client/cat3/src/partials/sections/dashboard/dashboardCtrl.js b/client/cat3/src/partials/sections/dashboard/dashboardCtrl.js index bca69a726..972322e1a 100644 --- a/client/cat3/src/partials/sections/dashboard/dashboardCtrl.js +++ b/client/cat3/src/partials/sections/dashboard/dashboardCtrl.js @@ -8,7 +8,7 @@ 'dashboard.track', 'dashboard.settings', 'dashboard.design', - 'dashboard.service', + 'dashboard.bots', 'apis.workzone','dashboard.genericServices']) .controller('dashboardCtrl', ['$rootScope', '$scope', '$http', 'uac', '$location', '$state', function ($rootScope, $scope, $http, uac, $location, $state) { $rootScope.isBreadCrumbAvailable = true; diff --git a/client/cat3/src/partials/sections/dashboard/service/service.html b/client/cat3/src/partials/sections/dashboard/service/service.html deleted file mode 100644 index 31e898ca6..000000000 --- a/client/cat3/src/partials/sections/dashboard/service/service.html +++ /dev/null @@ -1,13 +0,0 @@ - - -
    -
    -
    -
    - -
    -
    - -
    -
    -
    \ No newline at end of file diff --git a/client/cat3/src/partials/sections/dashboard/service/service.js b/client/cat3/src/partials/sections/dashboard/service/service.js deleted file mode 100644 index 929e302a1..000000000 --- a/client/cat3/src/partials/sections/dashboard/service/service.js +++ /dev/null @@ -1,7 +0,0 @@ -(function (angular) { - "use strict"; - angular.module('dashboard.service', ['ngTouch', 'ui.grid']) - .controller('serviceCtrl',['$scope', '$rootScope', 'uiGridOptionsClient', 'uiGridConstants', 'workzoneServices', function ($scope, $rootScope, uiGridOptionsClient, uiGridConstants, workzoneServices) { - - }]); -})(angular); \ No newline at end of file diff --git a/client/htmls/private/index.html b/client/htmls/private/index.html index 6844429b9..c6ef0f064 100644 --- a/client/htmls/private/index.html +++ b/client/htmls/private/index.html @@ -53,6 +53,13 @@   ANALYTICS
  • + + + @@ -799,7 +806,23 @@