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
2 changes: 1 addition & 1 deletion client/htmls/private/ajax/Settings/CreateProviders.html
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ <h4 class="widget-margin" style="color: black;"><span id="spnprovider"></span></
<span>
<img data-toggle="popover" data-html="true" data-placement="left" title="AWS Planned Cost for a Month." src="img/help.png"/>
</span>
<input name="plannedCost" id="plannedCost" class="form-control" type="text" cdata="catalyst" cat-validation="required" placeholder="Enter the Planned Cost">
<input name="plannedCost" id="plannedCost" class="form-control" type="text" cdata="catalyst" placeholder="Enter the Planned Cost">
</div>
</div>
<div class="row">
Expand Down
28 changes: 10 additions & 18 deletions client/htmls/private/ajax/Settings/providerSync.html
Original file line number Diff line number Diff line change
Expand Up @@ -1115,12 +1115,12 @@ <h4 class="modal-title">Importing Instances</h4>
var tagsProjSelectedVal = $projecttagsList.val();
var tagsenvSelectedVal = $envtagsList.val();
var tagsbgSelectedVal = $bgtagsList.val();

if((tagsbgSelectedVal == tagsProjSelectedVal) && (tagsbgSelectedVal == tagsenvSelectedVal)){
if((tagsbgSelectedVal === tagsProjSelectedVal)
|| (tagsbgSelectedVal === tagsenvSelectedVal)
|| (tagsProjSelectedVal === tagsenvSelectedVal)){
bootbox.alert("Tag name cannot be same to create catalyst entity mapping");
return;
return false;
}

//Creating the data to Post for Save tags.
var tagsData = [{
"catalystEntityType": catalystEntityBgName,
Expand Down Expand Up @@ -1695,13 +1695,9 @@ <h4 class="modal-title">Importing Instances</h4>
"columns": [
{"data": "platformId","orderable" : true },
{"data": "os","orderable" : false },
{"data": "ip","orderable" : true,
"render": function(data, type, full){
if(data !== null){
return data;
}else{
return full.privateIpAddress;
}
{"data": "","orderable" : true,
"render":function(data, type, full, meta) {
return full.ip !== null ? full.ip:full.privateIpAddress;
}
},
{"data": "","orderable" : true,
Expand Down Expand Up @@ -1868,13 +1864,9 @@ <h4 class="modal-title">Importing Instances</h4>
"columns": [
{"data": "platformId","orderable" : true },
{"data": "os","orderable" : false },
{"data": "ip","orderable" : true,
"render": function(data, type, full){
if(data !== null){
return data;
}else{
return full.privateIpAddress;
}
{"data": "","orderable" : true,
"render":function(data, type, full, meta) {
return full.ip !== null ? full.ip:full.privateIpAddress;
}
},
{"data": "state","orderable" : true },
Expand Down
16 changes: 6 additions & 10 deletions client/htmls/public/js/awsCapacity.js
Original file line number Diff line number Diff line change
Expand Up @@ -300,12 +300,12 @@ $(document).ready(function() {
}
},
{
"data": "ip",
"data": "",
"orderable": true,
"render": function(data, type, full) {
if (data !== null) {
if(full.ip && full.ip !== null){
return data;
} else {
}else{
return full.privateIpAddress;
}
}
Expand Down Expand Up @@ -373,14 +373,10 @@ $(document).ready(function() {
"data": "os",
"orderable": false
}, {
"data": "ip",
"data": "",
"orderable": true,
"render": function(data, type, full) {
if (data !== null) {
return data;
} else {
return full.privateIpAddress;
}
"render":function(data, type, full, meta) {
return full.ip !== null ? full.ip:full.privateIpAddress;
}
}, {
"data": "state",
Expand Down
17 changes: 6 additions & 11 deletions server/app/model/classes/instance/instance.js
Original file line number Diff line number Diff line change
Expand Up @@ -2118,23 +2118,18 @@ var InstancesDao = function() {

this.updateInstanceStatus = function(instanceId, instance, callback) {
var updateObj = {};
updateObj['instanceState'] = instance.state;
updateObj['subnetId']= instance.subnetId;
updateObj['instanceIP'] = instance.ip;
updateObj['vpcId'] = instance.vpcId;
updateObj['privateIpAddress'] = instance.privateIpAddress;
updateObj['tags'] = instance.tags;
if(instance.status && instance.status === 'shutting-down'){
updateObj['instanceState'] = instance.status;
updateObj['isDeleted'] = false;
}else if (instance.state === 'terminated') {
updateObj['instanceState'] = instance.state;
updateObj['subnetId']= instance.subnetId;
updateObj['vpcId'] = instance.vpcId;
updateObj['privateIpAddress'] = instance.privateIpAddress;
updateObj['isDeleted'] = true;
updateObj['tags'] = instance.tags;
}else {
updateObj['instanceState'] = instance.state;
updateObj['subnetId']= instance.subnetId;
updateObj['vpcId'] = instance.vpcId;
updateObj['privateIpAddress'] = instance.privateIpAddress;
updateObj['isDeleted'] = false;
updateObj['tags'] = instance.tags;
}
Instances.update({
"_id": ObjectId(instanceId)
Expand Down
16 changes: 6 additions & 10 deletions server/app/model/unassigned-instances/unassigned-instances.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,20 +186,16 @@ UnassignedInstancesSchema.statics.updateInstance = function updateInstance(param

UnassignedInstancesSchema.statics.updateInstanceStatus = function updateInstanceStatus(instanceId,instance,callback) {
var updateObj={};
updateObj['state'] = instance.state;
updateObj['subnetId']= instance.subnetId;
updateObj['ip'] = instance.ip;
updateObj['vpcId'] = instance.vpcId;
updateObj['privateIpAddress'] = instance.privateIpAddress;
updateObj['tags'] = instance.tags;
if(instance.state === 'terminated'){
updateObj['state'] = instance.state;
updateObj['subnetId']= instance.subnetId;
updateObj['vpcId'] = instance.vpcId;
updateObj['privateIpAddress'] = instance.privateIpAddress;
updateObj['isDeleted'] = true;
updateObj['tags'] = instance.tags;
}else{
updateObj['state'] = instance.state;
updateObj['subnetId']= instance.subnetId;
updateObj['vpcId'] = instance.vpcId;
updateObj['privateIpAddress'] = instance.privateIpAddress;
updateObj['isDeleted'] = false;
updateObj['tags'] = instance.tags;
}
UnassignedInstances.update({
"_id": ObjectId(instanceId)
Expand Down
18 changes: 7 additions & 11 deletions server/app/model/unmanaged-instance/unmanaged-instance.js
Original file line number Diff line number Diff line change
Expand Up @@ -291,20 +291,16 @@ UnmanagedInstanceSchema.statics.getInstancesByProviderIdOrgIdAndPlatformId = fun

UnmanagedInstanceSchema.statics.updateInstanceStatus = function updateInstanceStatus(instanceId,instance,callback) {
var updateObj={};
updateObj['state'] = instance.state;
updateObj['subnetId']= instance.subnetId;
updateObj['ip'] = instance.ip;
updateObj['vpcId'] = instance.vpcId;
updateObj['privateIpAddress'] = instance.privateIpAddress;
updateObj['tags'] = instance.tags;
if(instance.state === 'terminated'){
updateObj['state'] = instance.state;
updateObj['subnetId']= instance.subnetId;
updateObj['vpcId'] = instance.vpcId;
updateObj['privateIpAddress'] = instance.privateIpAddress;
updateObj['isDeleted'] = true;
updateObj['tags'] = instance.tags;
}else{
updateObj['state'] = instance.state;
updateObj['subnetId']= instance.subnetId;
updateObj['vpcId'] = instance.vpcId;
updateObj['privateIpAddress'] = instance.privateIpAddress;
updateObj['isDeleted'] = false;
updateObj['tags'] = instance.tags;
updateObj['isDeleted'] = false;
}
UnmanagedInstance.update({
"_id": ObjectId(instanceId)
Expand Down