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 @@ -47,7 +47,7 @@
</div>
<div class="col-lg-12 col-md-12 form-group" ng-if="stateItems.filterView.provi || analytic.ViewproviFilter">
<label for="">Provider</label>
<select class="form-control select2 select2-hidden-accessible" id="selectProvider" ng-model="organNewEnt.provider" required>
<select class="form-control select2 select2-hidden-accessible" id="selectProvider" ng-change="ProviderChange(organNewEnt.provider);" ng-model="organNewEnt.provider" required>
<option value=''>Select</option>
<option ng-repeat="provider in providers" value="{{providers.indexOf(provider)}}">{{provider.providerName}}</option>
</select>
Expand Down Expand Up @@ -88,6 +88,7 @@
<li class="list-group-item cursor" ng-repeat="resource in resourceList | filter:searchText.name | filter:{platformId: filters.platformId}" ng-class="{'selected':selectedResources.indexOf(resource._id)>-1}" ng-click="toggleResourceSelection(resource._id,resource.platformId);">{{resource.platformId}}</li>
</ul>
</div>
<span ng-if="!selectedResources.length >0 "><input type="hidden" ng-model="selectedResourcesLen" ng-value="selectedResources.length" required></span>
<span class="error red" ng-if="selectedResources.length === 10">
Maximum 10 resources allowed.
</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,12 +196,13 @@
};

$scope.getAllRegionsList();
$scope.fnProviderChange = function() {
$scope.ProviderChange = function(val) {
$scope.filter.regionId = '';
$scope.filter.vpcId = '';
$scope.regions = [];
if ($scope.filter.providerId && $scope.filter.providerId !== '') {
$scope.getProviderRegions();
$scope.filter.providerId=$rootScope.providers[val]._id;
if ($scope.filter.providerId) {
$scope.getResourse($rootScope.organNewEnt.instanceType);
}
};
$scope.getResourse = function(instType) {
Expand All @@ -211,6 +212,7 @@
workzoneServices.getManagedInstances($scope.filter.providerId).then(function(response) {
if(response.data && response.data.managedInstances && response.data.managedInstances.length >0){
$scope.resourceList = response.data.managedInstances;
$scope.toggleResourceSelection($scope.resourceList[0]._id,$scope.resourceList[0].platformId);
} else{
$scope.resourceList=[];
}
Expand All @@ -222,6 +224,7 @@
workzoneServices.getAssignedInstances($scope.filter.providerId).then(function(response) {
if(response.data && response.data.unmanagedInstances.length >0){
$scope.resourceList = response.data.unmanagedInstances;
$scope.toggleResourceSelection($scope.resourceList[0]._id,$scope.resourceList[0].platformId);
} else{
$scope.resourceList = [];
}
Expand All @@ -234,7 +237,7 @@
workzoneServices.getUnassignedInstances($scope.filter.providerId).then(function(response) {
if(response.data && response.data.data && response.data.data.length >0){
$scope.resourceList = response.data.data;
$scope.selectedResources.push(response.data.data[0]._id);
$scope.toggleResourceSelection(response.data.data[0]._id,response.data.data[0].platformId);
$rootScope.filterNewEnt.resources=$scope.selectedResources;
$rootScope.filterNewEnt.platformId[response.data.data[0]._id]=response.data.data[0].platformId;
} else {
Expand All @@ -252,7 +255,7 @@
var idx = $scope.selectedResources.indexOf(resourceId);
if(idx > -1) {
$scope.selectedResources.splice(idx, 1);

} else {
if($scope.selectedResources.length === 10){
console.log($scope.selectedResources.length);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@
}
.btnFoot{
float: right;
width: 51%;
width: 57%;
}
.form-control{
height: 29px;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@
genSevs.promiseGet(param).then(function (result) {
capaCtr.chartData=result;
$rootScope.splitUpCapacities=[];
if(result.splitUpCapacities) {
if(result.splitUpCapacities && Object.keys(result.splitUpCapacities).length >0) {
angular.forEach(result.splitUpCapacities, function (val, key) {
var a=key.replace(/([A-Z])/g, ' $1').replace(/^./, function(str) {
return str.toUpperCase();
Expand Down Expand Up @@ -152,12 +152,19 @@
// create bar
//if(viewType === 'ProviderView'){
capaCtr.capaGridOptions.data = result.splitUpCapacities[viewType];
angular.forEach(result.splitUpCapacities[viewType], function (value) {
if(result.splitUpCapacities && Object.keys(result.splitUpCapacities).length >0 ) {
angular.forEach(result.splitUpCapacities[viewType], function (value) {
capaCtr.pieChat.data.push({
key: value.name,
value: value.capacity.totalCapacity
});
});
} else{
capaCtr.pieChat.data.push({
key: value.name,
value: value.capacity.totalCapacity
key: result.entity.name,
value: result.capacity.totalCapacity
});
});
}
if(result.capacity && result.capacity.AWS && result.capacity.AWS.services) {
capaCtr.serviceCapacity = result.capacity.AWS.services;
angular.forEach(result.capacity.AWS.services, function (valueChild, keyChild) {
Expand All @@ -166,20 +173,35 @@
name: keyChild,
field: 'capacity.AWS.services.' + keyChild
});
angular.forEach(result.splitUpCapacities[viewType], function (valBar) {
if(result.splitUpCapacities && Object.keys(result.splitUpCapacities).length >0 ) {
angular.forEach(result.splitUpCapacities[viewType], function (valBar) {
var chVal = '';
if (valBar.capacity.AWS.services[keyChild]) {
chVal = valBar.capacity.AWS.services[keyChild];
} else {
chVal = 0;
}
va.push(
{
"label": valBar.name,
"value": chVal
}
);
});
} else {
var chVal = '';
if (valBar.capacity.AWS.services[keyChild]) {
chVal = valBar.capacity.AWS.services[keyChild];
if (result.capacity.AWS.services[keyChild]) {
chVal =result.capacity.AWS.services[keyChild];
} else {
chVal = 0;
}
va.push(
{
"label": valBar.name,
"label": result.entity.name,
"value": chVal
}
);
});
}
capaCtr.barChat.data.push({
"key": keyChild,
"values": va
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,15 +146,17 @@
costObj.barChat.data = [];
// create bar
//if(viewType === 'ProviderView'){
costObj.costGridOptions.data = result.splitUpCosts[viewType];

if(result.splitUpCosts && Object.keys(result.splitUpCosts).length >0 ) {
costObj.costGridOptions.data = result.splitUpCosts[viewType];
angular.forEach(result.splitUpCosts[viewType], function (value) {
costObj.pieChat.data.push({
key: value.name,
value: value.cost.totalCost
});
});
} else {
costObj.costGridOptions.data = result;
costObj.pieChat.data.push({
key: result.entity.name,
value: result.cost.totalCost
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,19 +114,20 @@
};
disResrc.gridOptionInstances.data = [];
if($rootScope.organNewEnt.instanceType === 'Managed') {
$scope.colArray=['platformId','privateIpAddress','os','state'];
disResrc.gridOptionInstances.enableRowHeaderSelection= false;
$scope.colArray=['platformId','privateIpAddress','instanceState','region'];
disResrc.gridOptionInstances.columnDefs=[
{name: 'InstanceId', field: 'platformId',enableCellEditOnFocus: false,
{name: 'InstanceId', field: 'platformId',enableCellEditOnFocus: false, cellTooltip: true,
enableCellEdit: false,enableFiltering: true},
{name: 'os', enableFiltering: true,displayName: 'OS', enableCellEdit: false,enableCellEditOnFocus: false},
{name: 'os', enableFiltering: true,displayName: 'os', field:'hardware.os',enableCellEdit: false,enableCellEditOnFocus: false},
{name: 'privateIpAddress',enableFiltering: true, displayName: 'IP Address',enableCellEditOnFocus: false,
enableCellEdit: false},
{name: 'state',enableFiltering: true, displayName: 'Status',enableCellEditOnFocus: false,
{name: 'instanceState',enableFiltering: true, displayName: 'Status',enableCellEditOnFocus: false,
enableCellEdit: false},
{
name: 'Region',enableFiltering: true,
displayName: 'Region',
field: 'providerData.region_name',
field: 'region',
cellTooltip: true,enableCellEditOnFocus: false,
enableCellEdit: false
},
Expand Down Expand Up @@ -155,7 +156,7 @@
} else if($rootScope.organNewEnt.instanceType === 'Assigned'){
$scope.colArray=['platformId','privateIpAddress','os','state'];
disResrc.gridOptionInstances.columnDefs=[
{name: 'InstanceId', field: 'platformId',enableCellEditOnFocus: false,
{name: 'InstanceId', field: 'platformId',enableCellEditOnFocus: false, cellTooltip: true,
enableCellEdit: false,enableFiltering: true},
{name: 'os', enableFiltering: true,displayName: 'OS', enableCellEdit: false, type: 'number',enableCellEditOnFocus: false},
{name: 'privateIpAddress',enableFiltering: true, displayName: 'IP Address',enableCellEditOnFocus: false,
Expand Down Expand Up @@ -192,9 +193,10 @@
];
$scope.instanceType= 'unmanagedInstances';
} else if($rootScope.organNewEnt.instanceType === 'Unassigned'){
disResrc.gridOptionInstances.enableRowHeaderSelection= false;
$scope.colArray=['platformId','privateIpAddress','os','state'];
disResrc.gridOptionInstances.columnDefs= [
{name: 'InstanceId', field: 'platformId',enableCellEditOnFocus: false,
{name: 'InstanceId', field: 'platformId',enableCellEditOnFocus: false, cellTooltip: true,
enableCellEdit: false},
{name: 'os', displayName: 'OS', enableCellEdit: false, type: 'number',enableCellEditOnFocus: false},
{name: 'privateIpAddress', displayName: 'IP Address',enableCellEditOnFocus: false,
Expand Down Expand Up @@ -256,6 +258,7 @@
var param = {
inlineLoader:true,
url: '/providers/' + fltrObj.provider.id + '/' + $scope.instanceType
// url:'src/partials/sections/dashboard/analytics/data/ins.json'
};
genSevs.promiseGet(param).then(function (instResult) {
if($rootScope.organNewEnt.instanceType === 'Managed') {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,14 @@
};
genSevs.promiseGet(param).then(function (tagResult) {
$scope.newEnt.project.tagName='';
$scope.newEnt.project.tagValues=[];
$scope.newEnt.businessGroup.tagValues=[];
$scope.newEnt.businessGroup.tagName='';
$scope.newEnt.environment.tagName='';
disTgMap.getTagValues('','businessGroup');
disTgMap.getTagValues('','environment');
disTgMap.getTagValues('','project');
$scope.newEnt.environment.tagName=''
$scope.newEnt.environment.tagValues=[];;
disTgMap.getTagValues(false,'businessGroup');
disTgMap.getTagValues(false,'environment');
disTgMap.getTagValues(false,'project');

angular.forEach(tagResult, function (val, key) {
$scope.newEnt[key].tagName = val.tagName;
Expand All @@ -45,6 +48,9 @@
});
}
};
disTgMap.reset =function () {
disTgMap.getTagMapping();
};
disTgMap.getAllTags =function () {
//$scope.newEnt.providerId = fltrObj.provider.id;
$scope.isLoadingTag = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,11 @@
</span>
<loading size="large" name="instLoader" type="block"></loading>


<input ng-if="!instLoader && disResrc.gridOptionInstances.data.length > 0" ng-model='disResrc.filterValue' class="form-control with250" ng-change="filterInst()" placeholder="Search" />

<div ng-if="!instLoader && disResrc.gridOptionInstances.data.length > 0" ui-grid="disResrc.gridOptionInstances" ui-grid-pagination ui-grid-selection ui-grid-edit ui-grid-cellNav class="grid margintop15"></div>

<div ng-if="!instLoader && disResrc.gridOptionInstances.data.length === 0" class="alert alert-info text-center margintop15"> No Data Found!</div>
</accordion-group>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,9 @@

<div class="col-lg-12 col-md-12 col-sm-12 saveBtn" >
<div class="btnFoot">
<button type="button" class="btn cat-btn-update" ng-click="disTgMap.reset()" >
<i class="fa fa-repeat white"></i> Reset
</button>
<button type="button" class="btn cat-btn-update" ng-disabled="mapTag.$invalid" ng-click="disTgMap.save()" >
<i class="fa fa-check white"></i> Save
</button>
Expand Down