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 @@ -125,7 +125,7 @@
<button type="button" class="btn btn-sm btn-primary cat-btn-update" ng-class=" {'active':filterNewEnt.period === 'month'}" ng-click="applyFilter(true,'month')">MONTH</button>
<!--<button type="button" class="btn btn-sm btn-primary cat-btn-update" disabled="disabled" ng-class=" {'active':filterNewEnt.period === 'year'}" ng-click="applyFilter(true,'year')">YEAR</button>-->
<!--<input class="form-control " ng-model="filterNewEnt.StartDate" style="display: table-cell;width: 120px" readonly />-->
<input id="date-select" class="form-control " ng-click="showPick=true" ng-model="filterNewEnt.date" style="display: table-cell;width: 120px" placeholder="From Date" ng-change="applyFilter(true,filterNewEnt.period);" title="End Date" />
<input id="date-select" class="form-control " ng-click="showPick=true" ng-model="filterNewEnt.date" style="display:inherit;width: 120px" placeholder="From Date" ng-change="applyFilter(true,filterNewEnt.period);" title="End Date" />
<div class="weekPick" ng-show="showPick">
<span ng-show="filterNewEnt.period === 'day'"> <label for="" >Select Date</label>
<input class="form-control marginbottom10" id="date-cost" ng-model="filterNewEnt.endDate.day" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,8 @@
$rootScope.$emit('HEADER_NAV_CHANGE', 'ANALYTICS');
$scope.selectedResources = [];
analytic.viewByFilter='orgView';
$scope.$watch(function() { return analytic.viewByFilter}, function(newVal) {
$scope.$watch(function() {
return analytic.viewByFilter}, function(newVal) {
if(newVal === 'ProviderView'){
$rootScope.viewType='ProviderView';
if($state.params && $state.params.filterView){
Expand All @@ -152,7 +153,7 @@
$scope.getProviders(orgs[0].rowid);
});
if (!$rootScope.stateParams.view) {
$state.go('dashboard.analytics.cost');
$state.go('dashboard.analytics.capacityReport');
}
analytic.tabShow=function(chat,report){
analytic.tabShowChat=chat;
Expand Down Expand Up @@ -287,7 +288,7 @@
$rootScope.filterNewEnt.resources=$scope.selectedResources;
};
if (!$rootScope.stateParams.view && $rootScope.organObject) {
$state.go('dashboard.analytics.cost');
$state.go('dashboard.analytics.capacityReport');
}
}]);
})(angular);
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
month:months[new Date().getMonth()],
day:moment(new Date()).format('YYYY-MM-DD')
};
$rootScope.filterNewEnt.date= $rootScope.filterNewEnt.endDate.month+' '+ $rootScope.filterNewEnt.endDate.year;
$rootScope.filterNewEnt.date= moment($rootScope.filterNewEnt.endDate.month+' 01 '+ $rootScope.filterNewEnt.endDate.year).format('YYYY-MM-DD');
},
applyFilter : function(filterApp,period){
$rootScope.filterNewEnt.date= $rootScope.filterNewEnt.endDate.month+' '+ $rootScope.filterNewEnt.endDate.year;
$rootScope.filterNewEnt.date= moment($rootScope.filterNewEnt.endDate.month+' 01 '+ $rootScope.filterNewEnt.endDate.year).format('YYYY-MM-DD');
if($rootScope.organObject) {
var obj = $rootScope.organObject,
or = $rootScope.organNewEnt.org,
Expand All @@ -36,7 +36,7 @@
console.log(moment(dt).add(wk, 'days').format('YYYY-MM-DD'));
$rootScope.filterNewEnt.date=moment(dt).add(wk, 'days').format('YYYY-MM-DD');
} else {
$rootScope.filterNewEnt.date= $rootScope.filterNewEnt.endDate.month+' '+ $rootScope.filterNewEnt.endDate.year;
$rootScope.filterNewEnt.date=moment( $rootScope.filterNewEnt.endDate.month+' 01 '+ $rootScope.filterNewEnt.endDate.year).format('YYYY-MM-DD');
}
$rootScope.filterNewEnt.period = period;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
});
};
$scope.chefConfig=function (id) {
var promise = genSevs.editRunlist(id);
genSevs.editRunlist(id);
};
capRept.createList = function () {
capRept.filterValue='';
Expand All @@ -106,8 +106,8 @@
capRept.listGrid[value].data=[];
capRept.listGrid[value].paginationPageSizes= [25, 50, 100];
capRept.listGrid[value].paginationPageSize=25;
$scope.colArray=['platformId','state','orgName','privateIpAddress','os'];
if(capRept.serviceType === 'EC2') {
$scope.colArray=['platformId','state','privateIpAddress','os'];
if(capRept.serviceType === 'EC2') {
capRept.listGrid[value].columnDefs = [
{name: 'Instance Id', field: 'platformId', cellTooltip: true},
{name: 'os', enableFiltering: true, displayName: 'OS', field: 'os', cellTooltip: true},
Expand All @@ -118,7 +118,6 @@
field: 'region',
cellTooltip: true
},
{name: 'orgName', displayName: 'Org Name', field: 'orgName', cellTooltip: true},
{
name: 'cost',
displayName: 'Cost',
Expand All @@ -134,7 +133,7 @@
];
}
if(capRept.serviceType === 'RDS') {
$scope.colArray=['platformId','state','orgName','dbEngine']
$scope.colArray=['platformId','state','dbEngine'];
capRept.listGrid[value].columnDefs = [
{name: 'Instance', field: 'platformId', cellTooltip: true},
{name: 'dbEngine', enableFiltering: true, displayName: 'Engine', field: 'dbEngine', cellTooltip: true},
Expand All @@ -144,7 +143,6 @@
field: 'region',
cellTooltip: true
},
{name: 'orgName', displayName: 'Org Name', field: 'orgName', cellTooltip: true},
{
name: 'cost',
displayName: 'Cost',
Expand All @@ -165,7 +163,7 @@
{name: 'bucketName', field: 'bucketName', cellTooltip: true},
{name: 'bucketOwnerName', field: 'bucketOwnerName', cellTooltip: true},
{name: 'bucketSize', field: 'bucketSize', displayName:'Bucket Size (MB)', cellTooltip: true},
{name: 'orgName', field: 'orgName', cellTooltip: true},

{name: 'cost', displayName: 'Cost',cellTemplate: '<span ng-bind-html="grid.appScope.aggregateInstanceCost(row.entity.cost)"></span>'},
{name: 'Action', cellTooltip: true,cellTemplate:"<span class='cursor' title='Usage' style='font-size: 14px;' ng-click='grid.appScope.openChart(row.entity)'><i class=\"fa fa-line-chart\"></i></span> "}
];
Expand All @@ -177,12 +175,16 @@

if(capRept.serviceType === 'EC2' && fltrObj && fltrObj.provider && fltrObj.provider.id) {
if($rootScope.organNewEnt.instanceType === 'Managed') {
$scope.colArray.push('bgName');
capRept.listGrid[value].columnDefs.splice(6,0,{name: 'bgName', displayName: 'Bg Name', field: 'bgName', cellTooltip: true});
$scope.colArray.push('bgName','projectName','environmentName');
capRept.listGrid[value].columnDefs.splice(5,0,{name: 'bgName', displayName: 'Bg Name', field: 'bgName', cellTooltip: true});
capRept.listGrid[value].columnDefs.splice(6,0,{name: 'projectName', displayName: 'Project Name', field: 'projectName', cellTooltip: true});
capRept.listGrid[value].columnDefs.splice(7,0,{name: 'environmentName', displayName: 'Env Name', field: 'environmentName', cellTooltip: true}); $scope.instanceType= 'managedInstances';
$scope.instanceType= 'managedInstances';
} else if($rootScope.organNewEnt.instanceType === 'Assigned'){
$scope.colArray.push('bgName');
capRept.listGrid[value].columnDefs.splice(6,0,{name: 'bgName', displayName: 'Bg Name', field: 'bgName', cellTooltip: true});
$scope.colArray.push('bgName','projectName','environmentName');
capRept.listGrid[value].columnDefs.splice(5,0,{name: 'bgName', displayName: 'Bg Name', field: 'bgName', cellTooltip: true});
capRept.listGrid[value].columnDefs.splice(6,0,{name: 'projectName', displayName: 'Project Name', field: 'projectName', cellTooltip: true});
capRept.listGrid[value].columnDefs.splice(7,0,{name: 'environmentName', displayName: 'Env Name', field: 'environmentName', cellTooltip: true}); $scope.instanceType= 'managedInstances';
$scope.instanceType= 'unmanagedInstances';
} else if($rootScope.organNewEnt.instanceType === 'Unassigned'){
$scope.instanceType= 'unassigned-instances';
Expand Down Expand Up @@ -222,12 +224,12 @@
}
});
} else if(fltrObj && fltrObj.provider && fltrObj.provider.id){
var param = {
var paramResources= {
inlineLoader:true,
url: '/resources?filterBy=providerDetails.id:'+fltrObj.provider.id+',resourceType:'+capRept.serviceType+',category:'+$rootScope.organNewEnt.instanceType.toLowerCase()
// url:'src/partials/sections/dashboard/analytics/data/ins.json'
};
genSevs.promiseGet(param).then(function (instResult) {
genSevs.promiseGet(paramResources).then(function (instResult) {
/////
capRept.listGrid[value].data = instResult.data;
if(capRept.serviceType === 'RDS'){
Expand Down Expand Up @@ -265,7 +267,7 @@

//}
};
$scope.$watch('capRept.serviceType',function (newValue, oldValue) {
$scope.$watch('capRept.serviceType',function () {
capRept.createList();
});
$scope.aggregateInstanceCost=function (cost) {
Expand Down Expand Up @@ -363,11 +365,11 @@
var $yesterday = new Date($today);
$yesterday.setDate($today.getDate() - 1);
if(fltObj && fltObj.resources && fltObj.resources.length >0) {
var $today = new Date();
var $yesterday = new Date($today);
$yesterday.setDate($today.getDate() - 1);
var $todayA = new Date();
var $yesterdayA = new Date($todayA);
$yesterday.setDate($todayA.getDate() - 1);
var param = {
url: '/analytics/trend/usage?resource=' + items._id + '&fromTimeStamp=' + $yesterday + '&toTimeStamp=' + $today + '&interval=3600'
url: '/analytics/trend/usage?resource=' + items._id + '&fromTimeStamp=' + $yesterdayA + '&toTimeStamp=' + $todayA + '&interval=3600'
//url:'src/partials/sections/dashboard/analytics/data/usage.json'
};
genSevs.promiseGet(param).then(function (result) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@
}

// param.url='src/partials/sections/dashboard/analytics/data/cost.json';
console.log(fltObj.date);
param.url='/analytics/cost/aggregate?parentEntityId='+fltObj.org.id+'&entityId='+entityId+'&toTimeStamp='+new Date(fltObj.date)+'&period='+fltObj.period;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,21 +37,21 @@
});
});
// Bu
var param = {
var paramProviders = {
url: '/providers/' + fltrObj.provider.id + '/tag-mappings/businessGroup'
};
genSevs.promiseGet(param).then(function (instResult) {
genSevs.promiseGet(paramProviders).then(function (instResult) {
$scope.TagName.bgTag=instResult.tagName+'-bu';
$scope.TagName.bgFild='tags.'+instResult.tagName;
angular.forEach(instResult.tagValues,function(val){
$scope.TagName.bg.push({id:val,name:val});
});
});
// project
var param = {
var paramP = {
url: '/providers/' + fltrObj.provider.id + '/tag-mappings/project'
};
genSevs.promiseGet(param).then(function (instResult) {
genSevs.promiseGet(paramP).then(function (instResult) {
$scope.TagName.projectTag=instResult.tagName+'-pr';
$scope.TagName.projFild='tags.'+instResult.tagName;
angular.forEach(instResult.tagValues,function(val){
Expand Down Expand Up @@ -311,7 +311,7 @@
}, 1000);
}
};
disResrc.importInstance =function ($event) {
disResrc.importInstance =function () {
var modalInstance = $modal.open({
animation: true,
templateUrl: 'src/partials/sections/dashboard/analytics/view/instanceManage.html',
Expand Down Expand Up @@ -344,7 +344,7 @@
var treeNames = ['Cloud Management','Discovery','Resources'];
$rootScope.$emit('treeNameUpdate', treeNames);
var fltrObj=$rootScope.filterNewEnt;
$rootScope.applyFilter =function(filterApp,period){
$rootScope.applyFilter =function(){
analyticsServices.applyFilter(true,null);
disResrc.init();
};
Expand Down Expand Up @@ -457,7 +457,7 @@
};
}
}
}).result.then(function(response) {
}).result.then(function() {
}, function() {
console.log("Dismiss at " + new Date());
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
} else {
if (data.statusList && data.statusList.length) {
$scope.progressValue = data.statusList.length;
for (var i = 0; i < data.statusList.length; i++) {
$scope.statusMessage = data.statusList[i].status.message;
for (var ii = 0; ii < data.statusList.length; ii++) {
$scope.statusMessage = data.statusList[ii].status.message;
$scope.isInstanceImporting = false;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
toastr.success('Successfully updated.','Update');
});
};
$rootScope.applyFilter =function(filterApp,period){
$rootScope.applyFilter =function(){
analyticsServices.applyFilter(true,null);
disTgMap.getTagMapping();
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,24 +82,25 @@
<span class="cursor" ng-click="isTreeOpen = !isTreeOpen"><i class="fa fa-area-chart white"></i> ANALYTICS </span>
<div ng-class="{'show-providers':isTreeOpen === true}" data-ng-hide="node.collapsed" data-tree-id="relevancelab" data-analytics-tree-model="node.nodes" data-node-id="rowid" data-node-label="text" data-node-children="nodes">
<ul class="tree-ul">
<li class="pointer-cursor" ui-sref="dashboard.analytics.cost" ui-sref-active='activeSection'>
<li class="pointer-cursor" ui-sref="dashboard.analytics.capacityReport" ui-sref-active='activeSection' >
<div class="liContents">
<div class="liContents-wrapper">
<i class="icon fa fa-money label-spacing"></i>
<span>Cost</span>
<!--<i class="caret-spacing fa fa-caret-left pull-right"></i>-->
<i class="icon fa fa-pie-chart label-spacing"></i>
<span>Capacity</span>

</div>
</div>
</li>
<li class="pointer-cursor" ui-sref="dashboard.analytics.capacityReport" ui-sref-active='activeSection' >
<li class="pointer-cursor" ui-sref="dashboard.analytics.cost" ui-sref-active='activeSection'>
<div class="liContents">
<div class="liContents-wrapper">
<i class="icon fa fa-pie-chart label-spacing"></i>
<span>Capacity</span>

<i class="icon fa fa-money label-spacing"></i>
<span>Cost</span>
<!--<i class="caret-spacing fa fa-caret-left pull-right"></i>-->
</div>
</div>
</li>

<li ui-sref="dashboard.analytics.usage" class="pointer-cursor" ui-sref-active='activeSection' >
<div class="liContents">
<div class="liContents-wrapper">
Expand Down