Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion client/cat3/main.html
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@
<script src="src/partials/sections/dashboard/bots/controller/audittrailCtrl.js"></script>
<script src="src/partials/sections/dashboard/bots/controller/botLogsCtrl.js"></script>
<script src="src/partials/sections/dashboard/bots/controller/botInfoCtrl.js"></script>
<script src="src/partials/sections/dashboard/bots/controller/botScheduleCtrl.js"></script>
<script src="src/partials/sections/dashboard/bots/controller/libraryCtrl.js"></script>
<script src="src/partials/sections/dashboard/bots/controller/editParamsCtrl.js"></script>
<script src="src/partials/sections/dashboard/design/aDesignCtrl.js"></script>
Expand Down
4 changes: 4 additions & 0 deletions client/cat3/src/clientRoutes.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ function routeConfig($stateProvider, $urlRouterProvider, $httpProvider, modulePe
url: "/workzone",
templateUrl: "src/partials/sections/dashboard/workzone/workzone.html",
controller: "workzoneCtrl",
params:{filterView:{workzone:true}},
onEnter: function () {
},
onExit: function () {
Expand All @@ -57,6 +58,7 @@ function routeConfig($stateProvider, $urlRouterProvider, $httpProvider, modulePe
url: "/design",
templateUrl: "src/partials/sections/dashboard/design/design.html",
controller: "designCtrl as desCtrl",
params:{filterView:{design:true}},
resolve: {
auth: ["$q", function ($q) {
var deferred = $q.defer();
Expand All @@ -74,6 +76,7 @@ function routeConfig($stateProvider, $urlRouterProvider, $httpProvider, modulePe
url: "/analytics/",
templateUrl: "src/partials/sections/dashboard/analytics/analytics.html",
controller: "analyticsCtrl as analytic",
params:{filterView:{analytics:true}},
resolve: {
auth: ["$q", function ($q) {
var deferred = $q.defer();
Expand All @@ -92,6 +95,7 @@ function routeConfig($stateProvider, $urlRouterProvider, $httpProvider, modulePe
url: "/bots",
templateUrl: "src/partials/sections/dashboard/bots/bots.html",
controller: "botsCtrl as bts",
params:{filterView:{bots:true}},
resolve: {
auth: ["$q", function ($q) {
var deferred = $q.defer();
Expand Down
3 changes: 3 additions & 0 deletions client/cat3/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,9 @@ angularApp.controller('HeadNavigatorCtrl', ['$scope', '$rootScope', '$http', '$l
$rootScope.analyticsBool = _permSet.analyticsBool;
$rootScope.serviceBool = _permSet.serviceBool;
});
$scope.$watch(function() {
$rootScope.moduleSelection = $state.params;
});
$rootScope.$emit('SET_HEADER', $rootScope.appDetails);
$scope.showLogoutConfirmationSection = false;
$scope.logoutConfirmation = function () {
Expand Down
4 changes: 4 additions & 0 deletions client/cat3/src/partials/globals/header/header.scss
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@
.cursor {
cursor:pointer;
}

.header-selected-item {
color: #40BAF1;
}

.header-logo-image {
height: 40px;
Expand Down
8 changes: 4 additions & 4 deletions client/cat3/src/partials/globals/header/headerDashboard.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@
<li>
<div id="workzone" class="headNavigItem" ng-if="workZoneBool" ui-sref='dashboard.workzone' ui-sref-active='activeSection'>
<!--<a href="../../../../#ajax/Dev.html">-->
<i class="fa fa-credit-card"></i> WORKZONE
<i class="fa fa-credit-card white" ng-class="{'header-selected-item':moduleSelection.filterView.workzone}"></i> WORKZONE
<!--</a>-->
</div>
</li>
<li>
<div id="design" class="headNavigItem" ng-if="designBool" ui-sref='dashboard.design' ui-sref-active='activeSection'>
<i class="fa fa-puzzle-piece white"></i> DESIGN
<i class="fa fa-puzzle-piece white" ng-class="{'header-selected-item':moduleSelection.filterView.design}"></i> DESIGN
</a>
</div>
</li>
Expand All @@ -35,12 +35,12 @@
</li>
<li>
<div id="analytics" class="headNavigItem" ng-if="analyticsBool" ui-sref='dashboard.analytics' ui-sref-active='activeSection'>
<i class="fa fa-area-chart white"></i> ANALYTICS
<i class="fa fa-area-chart white" ng-class="{'header-selected-item':moduleSelection.filterView.analytics}"></i> ANALYTICS
</div>
</li>
<li>
<div id="service" class="headNavigItem" ng-if="serviceBool" ui-sref='dashboard.bots' ui-sref-active='activeSection'>
<i class="fa fa-delicious white"></i> BOTS
<i class="fa fa-delicious white" ng-class="{'header-selected-item':moduleSelection.filterView.bots}"></i> BOTS
</div>
</li>
<li class="header-right">
Expand Down
8 changes: 5 additions & 3 deletions client/cat3/src/partials/sections/dashboard/bots/botsCtrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
url: "/library",
templateUrl: "src/partials/sections/dashboard/bots/view/library.html",
controller: "libraryCtrl as libr",
params:{filterView:{library:true}},
parameters:{filterView:{library:true}},
resolve: {
auth: ["$q", function ($q) {
var deferred = $q.defer();
Expand All @@ -31,7 +31,7 @@
url: "/audittrail",
templateUrl: "src/partials/sections/dashboard/bots/view/audittrail.html",
controller: "audittrailCtrl as audit",
params:{filterView:{audittrail:true}},
parameters:{filterView:{audittrail:true}},
resolve: {
auth: ["$q", function ($q) {
var deferred = $q.defer();
Expand All @@ -49,6 +49,8 @@
}])
.controller('botsCtrl',['$scope', '$rootScope', '$state', function ($scope, $rootScope, $state) {
$state.go('dashboard.bots.library');
$rootScope.stateItems = $state.params;
$scope.$watch(function() {
$rootScope.stateItems = $state.current.name;
});
}]);
})(angular);
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
angular.module('dashboard.bots')
.controller('audittrailCtrl',['$scope', '$rootScope', '$state', 'genericServices', 'confirmbox', 'workzoneServices', 'toastr', 'workzoneUIUtils', '$modal',
function ($scope, $rootScope, $state, genSevs, confirmbox, workzoneServices, toastr, workzoneUIUtils, $modal) {
var treeNames = ['Bots','Audit Trail'];
var treeNames = ['BOTs','Audit Trail'];
$rootScope.$emit('treeNameUpdate', treeNames);
var audit=this;
audit.gridOptions={
Expand All @@ -30,7 +30,7 @@
'<img src="images/orchestration/jenkins.png" ng-show="row.entity.auditTrailConfig.executionType==\'jenkins\'" alt="row.entity.taskType" title="Jenkins" class="task-type-img" />'+
'<img src="images/orchestration/script.jpg" ng-show="row.entity.auditTrailConfig.executionType==\'script\'" alt="row.entity.auditTrailConfig.executionType" title="Script" class="task-type-img" />'+
'<img src="images/devops-roles/devopsRole1.png" ng-show="row.entity.action==\'BOTs Blueprint Execution\'" alt="row.entity.botType" title="Blueprint" class="task-type-img" />',cellTooltip: true},
{ name: 'BOT Name',displayName: 'BOT Name',field:'auditTrailConfig.name'},
{ name: 'BOT Name',displayName: 'BOT Name',field:'auditTrailConfig.name',cellTooltip: true},
{ name: 'Status',field:'status',
cellTemplate:'<img class="bot-status-icon" src="images/instance-states/aws-started.png" ng-show="row.entity.status === \'success\'" title="{{row.entity.status}}">' +
'<img class="bot-status-icon" src="images/instance-states/aws-stopped.png" ng-show="row.entity.status === \'failed\'" title="{{row.entity.status}}">' +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"use strict";
angular.module('dashboard.bots')
.controller('libraryCtrl',['$scope', '$rootScope', '$state', 'genericServices', 'confirmbox', 'toastr', 'workzoneUIUtils', '$modal', function ($scope, $rootScope, $state, genSevs, confirmbox, toastr, workzoneUIUtils, $modal) {
var treeNames = ['Bots','Library'];
var treeNames = ['BOTs','Library'];
$rootScope.$emit('treeNameUpdate', treeNames);
var lib=this;
$scope.totalBotsSelected = true;
Expand All @@ -25,16 +25,18 @@
'<img src="images/orchestration/jenkins.png" ng-show="row.entity.taskType==\'jenkins\'" alt="row.entity.taskType" title="Jenkins" class="task-type-img" />'+
'<img src="images/orchestration/script.jpg" ng-show="row.entity.taskType==\'script\'" alt="row.entity.taskType" title="Script" class="task-type-img" />'+
'<img src="images/devops-roles/devopsRole1.png" ng-show="row.entity.blueprintType" alt="row.entity.botType" title="Blueprint" class="task-type-img" />',cellTooltip: true},
{ name: 'BOT Type',displayName: 'BOT Type',field:'botType'},
{ name: 'BOT Name',displayName: 'BOT Name',field:'name'},
{ name: 'Category',field:'botCategory'},
{ name: 'description',field:'shortDesc'},
{ name: 'BOT Type',displayName: 'BOT Type',field:'botType',cellTooltip: true},
{ name: 'BOT Name',displayName: 'BOT Name',field:'name',cellTooltip: true},
{ name: 'Category',field:'botCategory',cellTooltip: true},
{ name: 'description',field:'shortDesc',cellTooltip: true},
{ name: 'Total Runs',field:'executionCount'},
{ name: 'BOT History',displayName: 'BOT History',cellTemplate:'<span ng-show="row.entity.blueprintType">NA</span>'+
'<span class="btn cat-btn-update control-panel-button" title="History" ng-show="row.entity.taskType" ng-click="grid.appScope.botLogs(row.entity);"><i class="fa fa-header white"></i></span>'},
{ name: 'BOT Info',displayName: 'BOT Info',cellTemplate:
'<span class="btn cat-btn-update control-panel-button" title="Info" ng-click="grid.appScope.botInfo(row.entity);"><i class="fa fa-info white"></i></span>'},
{ name: 'BOT Action',displayName: 'BOT Action',cellTemplate:'<span class="btn cat-btn-update control-panel-button" title="Execute" ng-click="grid.appScope.launchInstance(row.entity);"><i class="fa fa-play white"></i></span>' +
{ name: 'BOT Action',displayName: 'BOT Action',cellTemplate:
'<span class="btn cat-btn-update control-panel-button" title="Schedule" ng-click="grid.appScope.botSchedule(row.entity);"><i class="fa fa-calendar white"></i></span>' +
'<span class="btn cat-btn-update control-panel-button" title="Execute" ng-click="grid.appScope.launchInstance(row.entity);"><i class="fa fa-play white"></i></span>' +
'<span class="btn btn-danger control-panel-button" title="Delete Task" ng-show="row.entity.taskType" ng-click="grid.appScope.deleteBotTask(row.entity);"><i class="fa fa-trash-o white"></i></span>' +
'<span class="btn btn-danger control-panel-button" title="Delete Blueprint" ng-show="row.entity.blueprintType" ng-click="grid.appScope.deleteBotBP(row.entity);"><i class="fa fa-trash-o white"></i></span>'
}
Expand Down Expand Up @@ -72,6 +74,46 @@
console.log('Modal Dismissed at ' + new Date());
});
};
$scope.botSchedule = function() {
$modal.open({
templateUrl: 'src/partials/sections/dashboard/bots/view/botSchedule.html',
controller: 'botScheduleCtrl',
backdrop: 'static',
keyboard: false,
resolve: {
items: function () {
return {
chefJenkScriptTaskObj:$scope.chefJenkScriptTaskObj,
type:$scope.type
}
}
}
}).result.then(function (chefEventDetails) {
$scope.isEventAvailable = true;
$scope.chefJenkScriptTaskObj = chefEventDetails;
var startTimeMinute,startTimeHour,dayOfWeek,selectedDayOfTheMonth,selectedMonth;
startTimeMinute = $scope.chefJenkScriptTaskObj.startTimeMinute;
startTimeHour = $scope.chefJenkScriptTaskObj.startTime;
dayOfWeek = $scope.chefJenkScriptTaskObj.dayOfWeek;
selectedDayOfTheMonth = $scope.chefJenkScriptTaskObj.selectedDayOfTheMonth;
selectedMonth = $scope.chefJenkScriptTaskObj.monthOfYear;
$scope.type = 'edit';
$scope._isEventSelected = true;

$scope.repeatPattern = 'Repeat Every -' + $scope.chefJenkScriptTaskObj.repeats;
$scope.cronDetails = {
cronStartOn : $scope.chefJenkScriptTaskObj.cronStart,
cronEndOn : $scope.chefJenkScriptTaskObj.cronEnd,
cronRepeatEvery : $scope.chefJenkScriptTaskObj.repeatBy,
cronFrequency: $scope.chefJenkScriptTaskObj.repeats,
cronTime: typeof startTimeHour !=='undefined'? startTimeHour : new Date().getHours() + ':' + typeof startTimeMinute !=='undefined'? startTimeMinute:new Date().getMinutes(),
cronDays: $scope.chefJenkScriptTaskObj.dayOfWeek,
cronMonth: $scope.chefJenkScriptTaskObj.monthOfYear
}
}, function () {
console.log('Dismiss time is ' + new Date());
});
};
$scope.deleteBotTask = function(task) {
var modalOptions = {
closeButtonText: 'Cancel',
Expand Down Expand Up @@ -215,5 +257,92 @@
$scope.cancel= function() {
$modalInstance.dismiss('cancel');
};
}]).controller('botScheduleCtrl',['$scope', '$rootScope', 'genericServices', 'workzoneServices', 'toastr', '$modalInstance', 'items', '$timeout', function ($scope, $rootScope, genSevs, workzoneServices, toastr, $modalInstance, items, $timeout) {
console.log(items);
$scope.defaultSelection = function() {
$scope.repeatsType = 'Minutes';//default selection.
$scope.schedulerStartOn=moment(new Date()).format('MM/DD/YYYY');
$scope.schedulerEndOn=moment(new Date()).format('MM/DD/YYYY');
};
if(items.type !== 'new'){
if(items.chefJenkScriptTaskObj !==undefined){
if(items.chefJenkScriptTaskObj.cronStartOn && items.chefJenkScriptTaskObj.cronEndOn) {
var newStartOn = parseInt(items.chefJenkScriptTaskObj.cronStartOn);
var newDate = new Date(newStartOn).toLocaleDateString();
var datearray = newDate.split("/");
var newdate = datearray[1] + '/' + datearray[0] + '/' + datearray[2];
$scope.schedulerStartOn = newdate;
var newEndOn = parseInt(items.chefJenkScriptTaskObj.cronEndOn);
var newEndData = new Date(newEndOn).toLocaleDateString();
var datearrayNew = newEndData.split("/");
var newdateEnd = datearrayNew[1] + '/' + datearrayNew[0] + '/' + datearrayNew[2];
$scope.schedulerEndOn = newdateEnd;
} else {
$scope.schedulerStartOn = items.chefJenkScriptTaskObj.cronStart;
$scope.schedulerEndOn = items.chefJenkScriptTaskObj.cronEnd;
}

$scope.repeatBy = items.chefJenkScriptTaskObj.repeatBy || items.chefJenkScriptTaskObj.cronRepeatEvery.toString();
$scope.repeatsType = items.chefJenkScriptTaskObj.repeats || items.chefJenkScriptTaskObj.cronFrequency;
$scope.timeEventType = items.chefJenkScriptTaskObj.startTime;
$scope.timeEventMinute = items.chefJenkScriptTaskObj.startTimeMinute;
$scope.weekOfTheDay = items.chefJenkScriptTaskObj.dayOfWeek;
$scope.currentDate = items.chefJenkScriptTaskObj.startDate;
$scope.selectedDayOfTheMonth = items.chefJenkScriptTaskObj.selectedDayOfTheMonth;
$scope.selectedMonth = items.chefJenkScriptTaskObj.monthOfYear;
} else {
$scope.defaultSelection();
}
} else {
$scope.defaultSelection();
}

$scope.dateChange= function () {
var startDate = Date.parse($scope.schedulerStartOn);
var endDate = Date.parse($scope.schedulerEndOn);
if(startDate > endDate){
$scope.validDateRange=true;
} else {
$scope.validDateRange=false;
}

};

$scope.repeatCount = function(max, step) {
step = step || 1;
var input = [];
for (var i = 1; i <= max; i += step) {
input.push(i);
}
return input;
};
$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,
repeatBy: $scope.repeatBy,
cronStart: $scope.schedulerStartOn,
cronEnd: $scope.schedulerEndOn,
startTime: $scope.timeEventType,
startTimeMinute: $scope.timeEventMinute,
dayOfWeek: $scope.weekOfTheDay,
selectedDayOfTheMonth: $scope.selectedDayOfTheMonth,
monthOfYear: $scope.selectedMonth
};
$modalInstance.close($scope.eventParams);
};

$scope.cancel = function() {
$modalInstance.dismiss('cancel');
};
}]);
})(angular);
17 changes: 14 additions & 3 deletions client/cat3/src/partials/sections/dashboard/bots/view/botInfo.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,26 +22,37 @@ <h4 class="modal-title">
<input class="form-control" disabled="disabled" ng-model="botInfo.name">
</td>
</tr>
<tr>
<tr ng-show="botInfo.taskType">
<td class="td-padding">Task Type:</td>
<td>
<input disabled="disabled" class="form-control" ng-model="botInfo.taskType">
</td>
</tr>
<tr ng-show="botInfo.blueprintType">
<td class="td-padding">Blueprint Type</td>
<td ng-switch on="botInfo.templateType">
<input disabled="disabled" class="form-control" value="SoftwareStack" ng-switch-when="chef">
<input disabled="disabled" class="form-control" value="OSImage" ng-switch-when="ami">
<input disabled="disabled" class="form-control" value="CloudFormation" ng-switch-when="cft">
<input disabled="disabled" class="form-control" value="Docker" ng-switch-when="docker">
<input disabled="disabled" class="form-control" value="ArmTemplate"ng-switch-when="arm">
<input disabled="disabled" class="form-control" value="NA" ng-switch-default>
</td>
</tr>
<tr>
<td class="td-padding">Bot Type</td>
<td>
<input disabled="disabled" class="form-control" ng-model="botInfo.botType">
</td>
</tr>
<tr>
<td class="td-padding">Category</td>
<td class="td-padding">BOT Category</td>
<td>
<input disabled="disabled" class="form-control" ng-model="botInfo.botCategory">
</td>
</tr>
<tr>
<td class="td-padding">Description</td>
<td class="td-padding">BOT Description</td>
<td>
<input disabled="disabled" class="form-control" ng-model="botInfo.shortDesc">
</td>
Expand Down
Loading