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
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@
}
}
var param={
inlineLoader:true,
url:'/bots/' + items.botId + '/execute',
data: reqBody
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,13 @@
$scope.paginationParams.sortBy = 'createdOn';
$scope.paginationParams.sortOrder = 'desc';
$scope.botLibrarySearch = '';
$scope.showLoadMore = false;
$scope.showRecords = false;

$scope.showLoadRecord = function() {
$scope.showLoadMore = false;
$scope.showRecords = false;
};

$scope.showLoadRecord();

$scope.initGrids = function(){
$scope.botLibGridOptions={};
$scope.botLibGridOptions.columnDefs= [
Expand Down Expand Up @@ -127,17 +131,18 @@

$scope.botsDetails = function(result) {
$scope.botLibGridOptions.data = [];
$scope.showLoadRecord();
$scope.botLibGridOptions.totalItems = result.metaData.totalRecords;
$scope.botLibGridOptions.data = result.bots;
if(result.metaData.totalRecords >= 18) {
$scope.showLoadMore = true;
$scope.showRecords = true;
}
if(result.metaData.totalRecords == $scope.botLibGridOptions.data.length) {
$scope.showLoadMore = false;
$scope.showRecords = false;
$scope.showLoadRecord();
}
$scope.statusBar = "Showing " + ($scope.botLibGridOptions.data.length === 0 ? "0" : "1") + " to " + $filter('number')($scope.botLibGridOptions.data.length) + " of " + $filter('number')(result.metaData.totalRecords) + " entries";
$scope.isBotLibraryPageLoading = false;
};

$scope.clearSearchString = function() {
Expand All @@ -147,10 +152,12 @@
$scope.botLibraryGridView = function() {
lib.gridOptions=[];
var param={
inlineLoader:true,
url:'/bots?page=' + $scope.paginationParams.page +'&pageSize=' + $scope.paginationParams.pageSize +'&sortBy=' + $scope.paginationParams.sortBy +'&sortOrder=' + $scope.paginationParams.sortOrder
};
genSevs.promiseGet(param).then(function (result) {
$timeout(function() {
$scope.showLoadRecord();
$scope.botLibGridOptions.totalItems = result.metaData.totalRecords;
if(result.metaData.totalRecords >= 18) {
$scope.showLoadMore = true;
Expand All @@ -168,9 +175,9 @@
$scope.botLibGridOptions.data = result.bots;
}
$scope.statusBar = "Showing " + ($scope.botLibGridOptions.data.length === 0 ? "0" : "1") + " to " + $filter('number')($scope.botLibGridOptions.data.length) + " of " + $filter('number')(result.metaData.totalRecords) + " entries";
$scope.isBotLibraryPageLoading = false;
//$scope.filterBy();
}, 100);
$scope.isBotLibraryPageLoading = false;
}, function(error) {
$scope.isBotLibraryPageLoading = false;
toastr.error(error);
Expand Down Expand Up @@ -222,14 +229,12 @@
};
}
genSevs.promiseGet(param).then(function (result) {
$timeout(function() {
$scope.botsDetails(result);
if($scope.isCardViewActive){
for(var i=0;i<result.bots.length;i++){
$scope.imageForCard(result.bots[i]);
}
$scope.botsDetails(result);
if($scope.isCardViewActive){
for(var i=0;i<result.bots.length;i++){
$scope.imageForCard(result.bots[i]);
}
}, 100);
}
$scope.isBotLibraryPageLoading = false;
}, function(error) {
$scope.isBotLibraryPageLoading = false;
Expand Down Expand Up @@ -304,6 +309,8 @@
};*/

$scope.setCardView = function() {
$scope.isBotLibraryPageLoading = true;
$scope.showLoadRecord();
$scope.botLibGridOptions.data = [];
$scope.isCardViewActive = true;
$scope.botsCardViewSelection = "bots-tab-active";
Expand Down Expand Up @@ -401,6 +408,7 @@
};
confirmbox.showModal({}, modalOptions).then(function() {
var param={
inlineLoader:true,
url:'/bots/' + bot.botId
};
genSevs.promiseDelete(param).then(function (response) {
Expand All @@ -417,6 +425,8 @@
};
$rootScope.$on('BOTS_LIBRARY_REFRESH', function() {
lib.summary();
$scope.showLoadRecord();
$scope.isBotLibraryPageLoading = true;
$scope.botLibGridOptions.data = [];
if($scope.botLibrarySearch){
$scope.searchBotNameCategory();
Expand Down Expand Up @@ -451,6 +461,7 @@
};
$scope.showAllBots = function() {
$scope.clearSearchString();
$scope.isBotLibraryPageLoading = true;
$scope.botLibGridOptions.data = [];
$scope.totalBotsSelected = true;
$scope.runningBotsselected = false;
Expand All @@ -468,17 +479,16 @@
$scope.scheduledBotsSelected = false;
lib.gridOptions.data=[];
var param={
inlineLoader:true,
url:'/bots?actionStatus=running&page=' + $scope.paginationParams.page +'&pageSize=' + $scope.paginationParams.pageSize +'&sortBy=' + $scope.paginationParams.sortBy +'&sortOrder=' + $scope.paginationParams.sortOrder
};
genSevs.promiseGet(param).then(function (result) {
$timeout(function() {
$scope.botsDetails(result);
if($scope.isCardViewActive){
for(var i=0;i<result.bots.length;i++){
$scope.imageForCard(result.bots[i]);
}
$scope.botsDetails(result);
if($scope.isCardViewActive){
for(var i=0;i<result.bots.length;i++){
$scope.imageForCard(result.bots[i]);
}
}, 100);
}
});
};
$scope.showFailedBots = function() {
Expand All @@ -490,17 +500,16 @@
$scope.scheduledBotsSelected = false;
lib.gridOptions.data=[];
var param={
inlineLoader:true,
url:'/bots?actionStatus=failed&page=' + $scope.paginationParams.page +'&pageSize=' + $scope.paginationParams.pageSize +'&sortBy=' + $scope.paginationParams.sortBy +'&sortOrder=' + $scope.paginationParams.sortOrder
};
genSevs.promiseGet(param).then(function (result) {
$timeout(function() {
$scope.botsDetails(result);
if($scope.isCardViewActive){
for(var i=0;i<result.bots.length;i++){
$scope.imageForCard(result.bots[i]);
}
$scope.botsDetails(result);
if($scope.isCardViewActive){
for(var i=0;i<result.bots.length;i++){
$scope.imageForCard(result.bots[i]);
}
}, 100);
}
});
};
$scope.showScheduledBots = function() {
Expand All @@ -512,23 +521,22 @@
$scope.scheduledBotsSelected = true;
lib.gridOptions.data=[];
var param={
inlineLoader:true,
url:'/bots?filterBy=isBotScheduled:true&page=' + $scope.paginationParams.page +'&pageSize=' + $scope.paginationParams.pageSize +'&sortBy=' + $scope.paginationParams.sortBy +'&sortOrder=' + $scope.paginationParams.sortOrder
};
genSevs.promiseGet(param).then(function (result) {
console.log(result);
$timeout(function() {
$scope.botsDetails(result);
if($scope.isCardViewActive){
for(var i=0;i<result.bots.length;i++){
$scope.imageForCard(result.bots[i]);
}
$scope.botsDetails(result);
if($scope.isCardViewActive){
for(var i=0;i<result.bots.length;i++){
$scope.imageForCard(result.bots[i]);
}
}, 100);
}
});
};
lib.summary = function() {
$scope.botSummary=[];
var param={
inlineLoader:true,
url:'/audit-trail/bots-summary'
};
genSevs.promiseGet(param).then(function (response) {
Expand Down Expand Up @@ -575,6 +583,7 @@
$scope.runJob = function () {
$scope.isJobRunExecuting = true;
var param={
inlineLoader:true,
url:'/bots/' + items.botId + '/execute'
};
genSevs.promisePost(param).then(function (response) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@
<!--cards section ends here-->

<!--table section start here-->
<div class="alert alert-info text-center" ng-if="!botLibGridOptions.data.length > 0">
<div class="alert alert-info text-center" ng-if="!botLibGridOptions.data.length > 0 && !isBotLibraryPageLoading">
No data Available
</div>
<div id="grid1" ng-show="!isCardViewActive" ng-if="botLibGridOptions.data.length >0 && !isBotLibraryPageLoading" ui-grid="botLibGridOptions" ui-grid-pagination ui-grid-auto-resize class="grid" style="height: {{gridHeight}}px"></div>
Expand Down