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
39 changes: 28 additions & 11 deletions client/cat3/src/partials/sections/dashboard/bots/bots.scss
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,12 @@
height: 50px;
}

#botLibraryPage {
#botLibraryPage, #botAuditTrailPage {
.page-name {
font-size: 18px;
margin: 5px 0 5px 10px;
}

.borderTop {
border-top: 1px dashed #ddd;
}

.btn-xs {
padding: 1px 5px;
font-size: 12px;
Expand All @@ -39,23 +35,44 @@
margin: 2px 10px 0 0;
}

.borderTop {
border-top: 1px dashed #ddd;
}
}

#botLibraryPage {
.summary-container {
width: 100%;
}

.selected {
border: 2px solid #000;
height: 94px !important;
margin-top: 13px !important;
height: 92px !important;
margin-top: 14px !important;
}

.selected-blue {
color: #00c0ef !important;
border: 1px solid #00c0ef !important;
}

.selected-green {
color: #00a65a !important;
border: 1px solid #00a65a !important;
}

.selected-red {
color: #dd4b39 !important;
border: 1px solid #dd4b39 !important;
}

.info-box {
display: block;
min-height: 90px;
background: #ecf0f5;
background: #fff;
width: 100%;
box-shadow: 0 1px 1px rgba(0,0,0,0.1);
margin: 15px 0;
border: 1px solid #ccc;
}

.info-box-content {
Expand Down Expand Up @@ -84,8 +101,8 @@
.info-box-icon {
display: block;
float: left;
height: 90px;
width: 90px;
height: 88px;
width: 88px;
text-align: center;
font-size: 45px;
line-height: 90px;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
],
data:[]
};
var gridBottomSpace = 5;
var gridBottomSpace = 40;
$scope.gridHeight = workzoneUIUtils.makeTabScrollable('botAuditTrailPage') - gridBottomSpace;

$scope.botAuditTrailLogs=function(hist) {
Expand All @@ -68,6 +68,10 @@
});
};

$scope.RefreshBotsAuditTrail = function() {
audit.init();
};

audit.init =function(){
audit.gridOptions.data=[];
var param={
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,10 @@
}
};
$scope.instanceChange =function(){
$scope.isBotLogsLoading = true;
$scope.botLogs=[];
var param={
inlineLoader: true,
url:'/audit-trail/' + $scope.selectedInstance.actionLogId + '/logs'
};
genSevs.promiseGet(param).then(function (response) {
Expand Down Expand Up @@ -65,14 +67,15 @@
});
if($scope.taskType === 'jenkins') {
var param={
inlineLoader: true,
url:'/jenkins/' + $scope.jenkinsActionLogId + '/jobs/testmail/builds/' + $scope.jenkinsBuildNumber + '/output'
};
genSevs.promiseGet(param).then(function (response) {
if (response.data) {
$scope.jenkinsLogs = helper.formatLogs(response.data.output);
if (response) {
$scope.jenkinsLogs = helper.formatLogs(response.output);
$scope.isBotLogsLoading = false;
} else {
$scope.jenkinsLogs = helper.formatLogs(response.output);
$scope.jenkinsLogs = helper.formatLogs(response.data.output);
$scope.isBotLogsLoading = false;
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
{ name: 'Category',field:'botCategory'},
{ name: 'description',field:'shortDesc'},
{ 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>'},
'<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 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>' +
'<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 @@ -95,12 +95,14 @@
});
};
$rootScope.$on('BOTS_LIBRARY_REFRESH', function() {
lib.summary();
lib.init();
});
$scope.RefreshBotsLibrary = function() {
$scope.totalBotsSelected = true;
$scope.runningBotsselected = false;
$scope.failedBotsselected = false;
lib.summary();
lib.init();
};
$scope.showBotsRunning = function() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
<link rel='stylesheet' href='catalyst/partials/sections/dashboard/bots/bots.css'>

<div id="botAuditTrailPage">
<div class="page-name">
BOTs Audit Trail&nbsp;
<button type="button" title="Refresh" class="btn btn-xs btn-primary pull-right refresh-btn" ng-click="RefreshBotsAuditTrail();">
<i class="fa fa-refresh" style="color: #fff"></i>
</button>
</div>
<div class="borderTop"></div>

<div id="grid1" ng-if="audit.gridOptions.data.length > 0" ui-grid="audit.gridOptions" ui-grid-pagination class="grid" style="height: {{gridHeight}}px"></div>
<div class="alert alert-info text-center" ng-if="!audit.gridOptions.data.length > 0">
No data Available
Expand Down
46 changes: 24 additions & 22 deletions client/cat3/src/partials/sections/dashboard/bots/view/botLogs.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,30 +7,32 @@ <h4 class="modal-title">
</div>

<div class="modal-body">
<div class="logsArea">
<loading size="large" name="isBotLogsLoading" align="center" type="block"></loading>
<div ng-show="!isBotLogsLoading">
<div ng-show="taskType !== 'jenkins'">
<div id="selectInstanceFromDropdown">
<label class="col-md-3 col-sm-3 col-xs-4 text-padding control-label margintop8">Select Instance<sup class="red">*</sup>
</label>
<span class="col-md-4 col-sm-4 col-xs-8 no-padding">
<select class="form-control" ng-model="selectedInstance" ng-change="instanceChange()" ng-options="chefInstance as chefInstance.uiNodeName for chefInstance in nodeIdsWithActionLog">
</select>
</span>
</div>
<div class="rowSpacing col-lg-12 col-sm-12 {{log.err ? 'logErrorMsg':'logMsg'}}" ng-repeat="log in botLogs">
<span class="timeStamp"> {{log.timestamp | timestampToLocaleTime}} </span>
<span class="logInfo"> {{log.log}} </span>
</div>
</div>
<div ng-show="taskType === 'jenkins'">
<div class="rowSpacing col-lg-12 col-sm-12">
<p ng-bind-html="jenkinsLogs"></p>
</div>
<fieldset>
<div class="logsArea">
<loading size="large" name="isBotLogsLoading" align="center" type="block"></loading>
<div ng-show="!isBotLogsLoading">
<div ng-show="taskType !== 'jenkins'">
<div id="selectInstanceFromDropdown">
<label class="col-md-3 col-sm-3 col-xs-4 text-padding control-label margintop8">Select Instance<sup class="red">*</sup>
</label>
<span class="col-md-4 col-sm-4 col-xs-8 no-padding">
<select class="form-control" ng-model="selectedInstance" ng-change="instanceChange()" ng-options="chefInstance as chefInstance.uiNodeName for chefInstance in nodeIdsWithActionLog">
</select>
</span>
</div>
<div class="rowSpacing col-lg-12 col-sm-12 {{log.err ? 'logErrorMsg':'logMsg'}}" ng-repeat="log in botLogs">
<span class="timeStamp"> {{log.timestamp | timestampToLocaleTime}} </span>
<span class="logInfo"> {{log.log}} </span>
</div>
</div>
<div ng-show="taskType === 'jenkins'">
<div class="rowSpacing col-lg-12 col-sm-12">
<p ng-bind-html="jenkinsLogs"></p>
</div>
</div>
</div>
</div>
</div>
</fieldset>
</div>

<div class="modal-footer">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
<div class="container summary-container">
<div class="panel-group text-center">
<div class="col-md-3 col-sm-6 col-xs-12">
<div class="info-box cursor" ng-click="RefreshBotsLibrary()" ng-class="{'selected':totalBotsSelected === true}">
<div class="info-box cursor" ng-click="RefreshBotsLibrary()" ng-class="{'selected-blue':totalBotsSelected}">
<span class="info-box-icon bg-aqua">
<i class="fa fa-th" style="color: #ecf0f5"></i>
<i class="fa fa-list-ol" style="color: #fff"></i>
</span>
<div class="info-box-content">
<span class="info-box-text">Total Number of BOTs</span>
Expand All @@ -22,9 +22,9 @@
</div>
</div>
<div class="col-md-3 col-sm-6 col-xs-12">
<div class="info-box cursor" ng-click="showBotsRunning()" ng-class="{'selected':runningBotsselected === true}">
<div class="info-box cursor" ng-click="showBotsRunning()" ng-class="{'selected-green':runningBotsselected}">
<span class="info-box-icon bg-green">
<i class="fa fa-laptop" style="color: #ecf0f5"></i>
<i class="fa fa-cogs" style="color: #fff"></i>
</span>
<div class="info-box-content">
<span class="info-box-text">Number of BOTs running</span>
Expand All @@ -35,7 +35,7 @@
<div class="col-md-3 col-sm-6 col-xs-12">
<div class="info-box">
<span class="info-box-icon bg-yellow">
<i class="fa fa-cube" style="color: #ecf0f5"></i>
<i class="fa fa-save" style="color: #fff"></i>
</span>
<div class="info-box-content">
<span class="info-box-text">Total Time saved</span>
Expand All @@ -44,9 +44,9 @@
</div>
</div>
<div class="col-md-3 col-sm-6 col-xs-12">
<div class="info-box cursor" ng-click="showFailedBots()" ng-class="{'selected':failedBotsselected === true}">
<div class="info-box cursor" ng-click="showFailedBots()" ng-class="{'selected-red':failedBotsselected}">
<span class="info-box-icon bg-red">
<i class="fa fa-external-link" style="color: #ecf0f5"></i>
<i class="fa fa-remove" style="color: #fff"></i>
</span>
<div class="info-box-content">
<span class="info-box-text">Number of failed runs</span>
Expand Down