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
6 changes: 6 additions & 0 deletions client/cat3/src/partials/global.scss
Original file line number Diff line number Diff line change
Expand Up @@ -1163,4 +1163,10 @@ option.script {
}
.loading-body{
opacity: 0.4;
}
#bots .control-panel-button {
border-radius: 11px;
padding: 2px 5px;
width: 25px;
height: 25px;
}
2 changes: 1 addition & 1 deletion client/cat3/src/partials/sections/dashboard/bots/bots.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</div>


<div class="panelRight">
<div class="panelRight" id="bots">
<div id='rightPanel' class='container-fluid'>
<div ui-view></div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,37 @@
multiSelect :false,
},
columnDefs: [
{ name: 'type'},
{ name: 'name'},
{ name: 'description'},
{ name: 'type',field:'botType'},
{ name: 'name',field:'name'},
{ name: 'description',field:'shortDesc'},
{ name: 'run Bot' },
{ name: 'history' },
{ name: 'last run'},
{ name: 'bot Action'}
{ name: 'bot Action',cellTemplate:'<span class="btn cat-btn-update control-panel-button" title="Launch" ng-click="grid.appScope.launchInstance(row.rowEntity);"><i class="fa fa-location-arrow white"></i></span>'}
],
data:[{},{}]
data:[]
};
$scope.launchInstance = function(lunch){
if(lunch.botType === 'Task'){
genSevs.executeTask(lunch);

} else if(lunch.botType === 'blueprint') {
genSevs.lunchBlueprint(lunch);
}
};
lib.int =function(){
lib.gridOptions.data=[];
var param={
url:'/config-data/bot-type'
url:'/blueprints/serviceDelivery'
};
genSevs.promiseGet(param).then(function (result) {

angular.extend(lib.gridOptions.data,result);
});
var param2={
url:'/tasks/serviceDelivery'
};
genSevs.promiseGet(param2).then(function (resultTask) {
angular.extend(lib.gridOptions.data,resultTask);
});
};
lib.int();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
<br />
<div id="grid1" ui-grid="libr.gridOptions" ui-grid-pagination class="grid"></div>
<div id="grid1" ng-if="libr.gridOptions.data.length > 0" ui-grid="libr.gridOptions" ui-grid-pagination class="grid"></div>
<div class="alert alert-info text-center" ng-if="!libr.gridOptions.data.length > 0">
No data Available
</div>
125 changes: 125 additions & 0 deletions client/cat3/src/partials/sections/dashboard/genericServices.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,24 @@
}

};
genericServices.log=function(id,historyId,taskType) {
$modal.open({
animation: true,
templateUrl: 'src/partials/sections/dashboard/workzone/orchestration/popups/orchestrationLog.html',
controller: 'orchestrationLogCtrl as orchLogCtrl',
backdrop: 'static',
keyboard: false,
resolve: {
items: function() {
return {
taskId: id,
historyId: historyId,
taskType: taskType
};
}
}
});
};
genericServices.removeBlueprint= function(blueprintObj, bpType) {
var modalOptions = {
closeButtonText: 'Cancel',
Expand Down Expand Up @@ -130,6 +148,113 @@
});
}
};

genericServices.executeTask =function(task) {
if (task.taskConfig.parameterized && task.taskConfig.parameterized.length) {
$modal.open({
animation: true,
templateUrl: 'src/partials/sections/dashboard/workzone/orchestration/popups/runParamConfig.html',
controller: 'runParamConfigCtrl',
backdrop: 'static',
keyboard: false,
resolve: {
items: function() {
return angular.extend([], task.taskConfig.parameterized);
}
}
}).result.then(function(selectedItems) {
var choiceParam = {};
var p = selectedItems;
for (var i = 0; i < p.length; i++) {
choiceParam[p[i].name] = p[i].defaultValue[0];
}
workSvs.runTask(task._id, {
"choiceParam": choiceParam
}).then(function(response) {
helper.orchestrationLogModal(task._id, response.data.historyId, task.taskType);
$rootScope.$emit('WZ_ORCHESTRATION_REFRESH_CURRENT');
});
}, function() {
console.log("Dismiss at " + new Date());
});
} else {
$modal.open({
animation: true,
templateUrl: 'src/partials/sections/dashboard/workzone/orchestration/popups/confirmJobRun.html',
controller: 'confirmJobRunCtrl',
backdrop: 'static',
keyboard: false,
resolve: {
items: function() {
return task._id;
}
}
}).result.then(function(response) {
genericServices.log(task._id,response.historyId,task.taskType);
if(response.blueprintMessage){
$rootScope.$emit('WZ_INSTANCES_SHOW_LATEST');
}
$rootScope.$emit('WZ_ORCHESTRATION_REFRESH_CURRENT');
}, function() {
$rootScope.$emit('WZ_ORCHESTRATION_REFRESH_CURRENT');
});
}
}
genericServices.lunchBlueprint=function(blueprintObj) {
$modal.open({
animate: true,
templateUrl: "src/partials/sections/dashboard/workzone/blueprint/popups/blueprintLaunchParams.html",
controller: "blueprintLaunchParamsCtrl",
backdrop : 'static',
keyboard: false,
resolve: {
items: function() {
return blueprintObj;
}
}
})
.result.then(function(bpObj) {
if (bpObj.bp.blueprintType === "docker") {
$modal.open({
animate: true,
templateUrl: "src/partials/sections/dashboard/workzone/blueprint/popups/dockerLaunchParams.html",
controller: "dockerLaunchParamsCtrl",
backdrop: 'static',
keyboard: false,
size: 'lg',
resolve: {
items: function() {
return bpObj.bp;
}
}
}).result.then(function() {
console.log('The modal close is not getting invoked currently. Goes to cancel handler');
}, function() {
console.log('Cancel Handler getting invoked');
});
}else{
$modal.open({
animate: true,
templateUrl: "src/partials/sections/dashboard/workzone/blueprint/popups/blueprintLaunch.html",
controller: "blueprintLaunchCtrl",
backdrop: 'static',
keyboard: false,
resolve: {
bpItem: function() {
return bpObj;
}
}
})
.result.then(function(selectedItem) {
$scope.selected = selectedItem;
}, function() {

});
}
}, function() {

});
};
/*genericServices.editRunlist = function(chefRunlist, chefAttribute) {
$modal.open({
templateUrl: 'src/partials/sections/dashboard/workzone/orchestration/popups/orchestrationUpdateChefRunlist.html',
Expand Down