From 5b25219eeaf86181d34778e264967029e2d51979 Mon Sep 17 00:00:00 2001 From: srikanthv02 Date: Sun, 27 Nov 2016 22:22:14 +0530 Subject: [PATCH 01/29] Changes for task scheduler --- client/cat3/main.html | 1 + .../src/factory/chefDataFormatterService.js | 13 ++ client/cat3/src/partials/global.scss | 4 + .../workzone/orchestration/orchestration.scss | 18 +- .../orchestration/orchestrationCtrl.js | 3 +- .../orchestration/popups/addChefJobEvent.html | 114 +++++++++ .../popups/addChefJobEventCtrl.js | 84 +++++++ .../orchestration/popups/newTask.html | 51 +++- .../orchestration/popups/newTaskCtrl.js | 219 ++++++++++++++++-- 9 files changed, 485 insertions(+), 22 deletions(-) create mode 100644 client/cat3/src/partials/sections/dashboard/workzone/orchestration/popups/addChefJobEvent.html create mode 100644 client/cat3/src/partials/sections/dashboard/workzone/orchestration/popups/addChefJobEventCtrl.js diff --git a/client/cat3/main.html b/client/cat3/main.html index 747bfcd47..9a6e8ec83 100644 --- a/client/cat3/main.html +++ b/client/cat3/main.html @@ -175,6 +175,7 @@ + diff --git a/client/cat3/src/factory/chefDataFormatterService.js b/client/cat3/src/factory/chefDataFormatterService.js index a95acf332..ac4874db4 100644 --- a/client/cat3/src/factory/chefDataFormatterService.js +++ b/client/cat3/src/factory/chefDataFormatterService.js @@ -101,6 +101,19 @@ } return list; }, + formatInstanceList: function (obj) { + var list = []; + for (var i = 0; i < obj.length; i++) { + if (obj[i].instanceState === "running" || obj[i].instanceState === "pending" || obj[i].instanceState === "unknown") { + list.push({ + className: 'chef', + value: obj[i].name, + data: obj[i]._id + }); + } + } + return list; + }, formatRunListFromComponent: function (nodesList) { var reqBody = { cookbooks: [], diff --git a/client/cat3/src/partials/global.scss b/client/cat3/src/partials/global.scss index a511abba0..1af66c7c5 100644 --- a/client/cat3/src/partials/global.scss +++ b/client/cat3/src/partials/global.scss @@ -724,6 +724,10 @@ accordion .panel-heading { margin-top: 15px; } +.margintop10 { + margin-top: 10px; +} + .marginleft15 { margin-left: 15px; } diff --git a/client/cat3/src/partials/sections/dashboard/workzone/orchestration/orchestration.scss b/client/cat3/src/partials/sections/dashboard/workzone/orchestration/orchestration.scss index 5d6abad7e..731e25fcf 100644 --- a/client/cat3/src/partials/sections/dashboard/workzone/orchestration/orchestration.scss +++ b/client/cat3/src/partials/sections/dashboard/workzone/orchestration/orchestration.scss @@ -66,6 +66,12 @@ $imagePath : "../../../../../../images"; padding-right: 0px; } } + + .my-modal-popup { + .modal-lg { + width:1056px; + } + } } #orchestrationPage { @@ -187,7 +193,17 @@ $imagePath : "../../../../../../images"; .select-nodes { border: 1px solid #dddddd; list-style: none outside none; - height: 235px; + height: 150px; + overflow-y: auto; + margin-top: 5px; + margin-bottom: 10px; + padding: 5px; + } + + .select-nodeInstance { + border: 1px solid #dddddd; + list-style: none outside none; + height: 350px; overflow-y: auto; margin-top: 5px; margin-bottom: 10px; diff --git a/client/cat3/src/partials/sections/dashboard/workzone/orchestration/orchestrationCtrl.js b/client/cat3/src/partials/sections/dashboard/workzone/orchestration/orchestrationCtrl.js index 387ff5c6f..2a8119fad 100644 --- a/client/cat3/src/partials/sections/dashboard/workzone/orchestration/orchestrationCtrl.js +++ b/client/cat3/src/partials/sections/dashboard/workzone/orchestration/orchestrationCtrl.js @@ -275,7 +275,8 @@ controller: 'newTaskCtrl', backdrop: 'static', keyboard: false, - size: 'lg', + size:'lg', + windowClass: 'my-modal-popup', resolve: { items: function() { return type; diff --git a/client/cat3/src/partials/sections/dashboard/workzone/orchestration/popups/addChefJobEvent.html b/client/cat3/src/partials/sections/dashboard/workzone/orchestration/popups/addChefJobEvent.html new file mode 100644 index 000000000..3e240b4ca --- /dev/null +++ b/client/cat3/src/partials/sections/dashboard/workzone/orchestration/popups/addChefJobEvent.html @@ -0,0 +1,114 @@ +
+
+ + + + + +
+
diff --git a/client/cat3/src/partials/sections/dashboard/workzone/orchestration/popups/addChefJobEventCtrl.js b/client/cat3/src/partials/sections/dashboard/workzone/orchestration/popups/addChefJobEventCtrl.js new file mode 100644 index 000000000..21a7599c6 --- /dev/null +++ b/client/cat3/src/partials/sections/dashboard/workzone/orchestration/popups/addChefJobEventCtrl.js @@ -0,0 +1,84 @@ +/* Copyright (C) Relevance Lab Private Limited- All Rights Reserved + * Unauthorized copying of this file, via any medium is strictly prohibited + * Proprietary and confidential + * Written by Relevance UI Team, + * Aug 2015 + */ + +(function(angular){ + "use strict"; + angular.module('workzone.orchestration') + .controller('addChefJobEventCtrl',['$scope', '$modalInstance', 'items' ,'toastr',function($scope, $modalInstance , items , toastr){ + if(items.type !== 'new'){ + $scope.repeatsType = items.chefTaskObj.repeats; + $scope.timeEventMinute = items.chefTaskObj.startTimeMinute; + $scope.timeEventType = items.chefTaskObj.startTime; + $scope.weekOfTheDay = items.chefTaskObj.dayOfWeek; + $scope.currentDate = items.chefTaskObj.startDate; + $scope.selectedDayOfTheMonth = items.chefTaskObj.selectedDayOfTheMonth; + $scope.selectedMonth = items.chefTaskObj.monthOfYear; + } else { + $scope.repeatsType = 'Hourly';//default selection. + } + $scope.repeatEveryCount = function(max, step) { + step = step || 1; + var input = []; + for (var i = 1; i <= max; i += step) { + input.push(i); + } + return input; + }; + $scope.timeCount = function(max, step) { + step = step || 1; + var input = []; + for (var i = 0; i <= max; i += step) { + input.push(i); + } + return input; + }; + $scope.timeCountMinutes = function(max, step) { + step = step || 1; + var input = []; + for (var i = 0; i <= max; i += step) { + input.push(i); + } + return input; + }; + $scope.dayOfTheMonth = function(max, step) { + step = step || 1; + var input = []; + for (var i = 1; i <= max; i += step) { + input.push(i); + } + return input; + }; + $scope.currentDate = new Date(); + $scope.currentEndDate = new Date(); + $scope.isDaySelected = { + flag:true + } + + $scope.daysOfWeek = [ 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat' ] + ; + + $scope.monthOfYear = [ 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec' ] + ; + $scope.cancel = function() { + $modalInstance.dismiss('cancel'); + }; + $scope.ok=function(){ + $scope.eventParams = { + repeats: $scope.repeatsType, + startTime: $scope.timeEventType, + startTimeMinute: $scope.timeEventMinute, + dayOfWeek: $scope.weekOfTheDay, + startDate: $scope.currentDate, + selectedDayOfTheMonth: $scope.selectedDayOfTheMonth, + monthOfYear: $scope.selectedMonth + }; + $modalInstance.close($scope.eventParams); + }; + } + ]); +})(angular); + diff --git a/client/cat3/src/partials/sections/dashboard/workzone/orchestration/popups/newTask.html b/client/cat3/src/partials/sections/dashboard/workzone/orchestration/popups/newTask.html index 92a85d5a5..352a077e8 100644 --- a/client/cat3/src/partials/sections/dashboard/workzone/orchestration/popups/newTask.html +++ b/client/cat3/src/partials/sections/dashboard/workzone/orchestration/popups/newTask.html @@ -126,6 +126,21 @@
Job Details
+ +
+ + + +
+ + +
+
+ + +
+
+