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/CreateOrg.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ <h4 class="widget-margin" style="color:black;">Create Organization</h4>
<div class="col-lg-6 col-md-6">
<label for="name">Planned Cost:</label>
<span>
<img data-toggle="popover" data-html="true" data-placement="left" title="AWS Planned Cost for a Month." src="img/help.png"/>
<img data-toggle="popover" data-html="true" data-placement="left" title="Planned Cost for a Month." src="img/help.png"/>
</span>
<input name="ctl00$MainContent$plannedCost" value="" id="plannedCost" class="form-control" type="text" cdata="catalyst" maxlength="35">
<span data-val-controltovalidate="plannedCost" id="MainContent_Req_plannedCost" data-val="true" data-val-evaluationfunction="RequiredFieldValidatorEvaluateIsValid" data-val-initialvalue="" style="visibility:hidden;">Required</span>
Expand Down
34 changes: 31 additions & 3 deletions client/htmls/private/ajax/Settings/providerSync.html
Original file line number Diff line number Diff line change
Expand Up @@ -780,7 +780,19 @@ <h4 class="modal-title">Importing Instances</h4>
"columns": [
{"data": "platformId","orderable" : true },
{"data": "hardware.os","orderable" : false },
{"data": "instanceIP","orderable" : true },
{"data": "instanceIP","orderable" : true,
"render":function(data, type, full, meta) {
if(full.instanceIP === null){
if(full.privateIpAddress === null){
return '-';
}else{
return full.privateIpAddress;
}
}else{
return full.instanceIP;
}
}
},
{"data": "","orderable" : true,
"render":function(data, type, full, meta) {
return full.region?full.region:full.providerData?full.providerData.region:'-';
Expand Down Expand Up @@ -1697,7 +1709,15 @@ <h4 class="modal-title">Importing Instances</h4>
{"data": "os","orderable" : false },
{"data": "","orderable" : true,
"render":function(data, type, full, meta) {
return full.ip !== null ? full.ip:full.privateIpAddress;
if(full.ip === null){
if(full.privateIpAddress === null){
return '-';
}else{
return full.privateIpAddress;
}
}else{
return full.ip;
}
}
},
{"data": "","orderable" : true,
Expand Down Expand Up @@ -1866,7 +1886,15 @@ <h4 class="modal-title">Importing Instances</h4>
{"data": "os","orderable" : false },
{"data": "","orderable" : true,
"render":function(data, type, full, meta) {
return full.ip !== null ? full.ip:full.privateIpAddress;
if(full.ip === null){
if(full.privateIpAddress === null){
return '-';
}else{
return full.privateIpAddress;
}
}else{
return full.ip;
}
}
},
{"data": "state","orderable" : true },
Expand Down
4 changes: 2 additions & 2 deletions client/htmls/private/js/settingscommon.js
Original file line number Diff line number Diff line change
Expand Up @@ -3441,11 +3441,11 @@ function isFormValid(formid) {
currCtrl.focus();
}

if (!/[!@#$%^&*]/.test(str)) {
/*if (!/[!@#$%^&*]/.test(str)) {
isValid = false;
errormessageforInput(currCtrl.attr('id'), "Atleast a special char is required.");
currCtrl.focus();
}
}*/
}
break;

Expand Down
2 changes: 1 addition & 1 deletion client/htmls/public/instanceLog.html
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ <h4 class="modal-title" id="myModalLabel">
} else if (managnedData[i].status == 'stopped') {
$tdStatus = $("<img title='stopped' class ='statusIcon' src = '../private/img/aws_logo_stopped.png' alt='statusType'/>");
}else if (managnedData[i].status == 'terminated') {
$tdStatus = $("<img title='terminated' class ='statusIcon' src = '../private/img/aws_iogo_inactive.png' alt='statusType'/>");
$tdStatus = $("<img title='terminated' class ='statusIcon' src = '../private/img/aws_logo_stopped.png' alt='statusType'/>");
}else if (managnedData[i].status == 'deleted') {
$tdStatus = $("<img title='deleted' class ='statusIcon' src = '../private/img/aws_iogo_inactive.png' alt='statusType'/>");
}else if (managnedData[i].status == 'shutting-down') {
Expand Down
37 changes: 30 additions & 7 deletions client/htmls/public/js/awsCapacity.js
Original file line number Diff line number Diff line change
Expand Up @@ -254,8 +254,19 @@ $(document).ready(function() {
}
}
, {
"data": "instanceIP",
"orderable": true
"data": "",
"orderable": true,
"render":function(data, type, full, meta) {
if(full.instanceIP === null){
if(full.privateIpAddress === null){
return '-';
}else{
return full.privateIpAddress;
}
}else{
return full.instanceIP;
}
}
}, {
"data": "instanceState",
"orderable": true
Expand Down Expand Up @@ -302,11 +313,15 @@ $(document).ready(function() {
{
"data": "",
"orderable": true,
"render": function(data, type, full) {
if(full.ip && full.ip !== null){
return data;
"render": function(data, type, full,meta) {
if(full.ip === null){
if(full.privateIpAddress === null){
return '-';
}else{
return full.privateIpAddress;
}
}else{
return full.privateIpAddress;
return full.ip;
}
}
}, {
Expand Down Expand Up @@ -376,7 +391,15 @@ $(document).ready(function() {
"data": "",
"orderable": true,
"render":function(data, type, full, meta) {
return full.ip !== null ? full.ip:full.privateIpAddress;
if(full.ip === null){
if(full.privateIpAddress === null){
return '-';
}else{
return full.privateIpAddress;
}
}else{
return full.ip;
}
}
}, {
"data": "state",
Expand Down
20 changes: 11 additions & 9 deletions server/app/model/classes/instance/instance.js
Original file line number Diff line number Diff line change
Expand Up @@ -2118,18 +2118,20 @@ 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['isDeleted'] = false;
}else if (instance.state === 'terminated') {
updateObj['instanceState'] = instance.status;
updateObj['isDeleted'] = true;
}else if(instance.state === 'terminated' || instance.state === 'shutting-down'){
updateObj['instanceState'] = instance.state;
updateObj['isDeleted'] = true;
}else {
}else{
updateObj['instanceState'] = instance.state;
updateObj['isDeleted'] = false;
updateObj['subnetId']= instance.subnetId;
updateObj['instanceIP'] = instance.ip;
updateObj['vpcId'] = instance.vpcId;
updateObj['privateIpAddress'] = instance.privateIpAddress;
updateObj['tags'] = instance.tags;
}
Instances.update({
"_id": ObjectId(instanceId)
Expand Down
12 changes: 6 additions & 6 deletions server/app/model/unassigned-instances/unassigned-instances.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,15 +187,15 @@ 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'){
if(instance.state === 'terminated' || instance.state === 'shutting-down'){
updateObj['isDeleted'] = true;
}else{
updateObj['isDeleted'] = false;
updateObj['subnetId']= instance.subnetId;
updateObj['ip'] = instance.ip;
updateObj['vpcId'] = instance.vpcId;
updateObj['privateIpAddress'] = instance.privateIpAddress;
updateObj['tags'] = instance.tags;
}
UnassignedInstances.update({
"_id": ObjectId(instanceId)
Expand Down
14 changes: 7 additions & 7 deletions server/app/model/unmanaged-instance/unmanaged-instance.js
Original file line number Diff line number Diff line change
Expand Up @@ -292,15 +292,15 @@ 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'){
if(instance.state === 'terminated' || instance.state === 'shutting-down'){
updateObj['isDeleted'] = true;
}else{
updateObj['isDeleted'] = false;
updateObj['isDeleted'] = false;
updateObj['subnetId']= instance.subnetId;
updateObj['ip'] = instance.ip;
updateObj['vpcId'] = instance.vpcId;
updateObj['privateIpAddress'] = instance.privateIpAddress;
updateObj['tags'] = instance.tags;
}
UnmanagedInstance.update({
"_id": ObjectId(instanceId)
Expand Down
2 changes: 1 addition & 1 deletion server/app/routes/v1.0/routes_cloudformation.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ module.exports.setRoutes = function(app, sessionVerificationFunc) {
projectName: instance.projectName,
envName: instance.environmentName,
status: 'shutting-down',
actionStatus: "success",
actionStatus: "pending",
platformId: instance.platformId,
blueprintName: instance.blueprintData.blueprintName,
data: instance.runlist,
Expand Down
6 changes: 6 additions & 0 deletions server/app/routes/v1.0/routes_provider.js
Original file line number Diff line number Diff line change
Expand Up @@ -2162,6 +2162,9 @@ module.exports.setRoutes = function(app, sessionVerificationFunc) {
var orgId = req.body.orgId;
var s3BucketName=req.body.s3BucketName;
var plannedCost=req.body.plannedCost;
if(plannedCost === null || plannedCost ===''){
plannedCost=0.0;
}
var isDefault = (req.body.isDefault === 'true') ? true : false;
var hasDefaultProvider = false;

Expand Down Expand Up @@ -2457,6 +2460,9 @@ module.exports.setRoutes = function(app, sessionVerificationFunc) {
var orgId = req.body.orgId;
var s3BucketName = req.body.s3BucketName;
var plannedCost = req.body.plannedCost;
if(plannedCost === null || plannedCost ===''){
plannedCost=0.0;
}
if (typeof providerId === 'undefined' || providerId.length === 0) {
res.status(400).send("{Please Enter ProviderId.}");
return;
Expand Down
6 changes: 5 additions & 1 deletion server/app/services/instanceService.js
Original file line number Diff line number Diff line change
Expand Up @@ -1371,13 +1371,17 @@ function instanceSyncWithAWS(instanceId,instanceData,callback){

function createOrUpdateInstanceLogs(instance,instanceState,action,user,timestampStarted,next){
var actionLog = instancesModel.insertInstanceStatusActionLog(instance._id, user, instanceState, timestampStarted);
var actionStatus = 'success';
var logReferenceIds = [instance._id, actionLog._id];
logsDao.insertLog({
referenceId: logReferenceIds,
err: false,
log: "Instance " + instanceState,
timestamp: timestampStarted
});
if(instanceState === 'shutting-down'){
actionStatus = 'pending';
}
var instanceLog = {
actionId: actionLog._id,
instanceId: instance._id,
Expand All @@ -1386,7 +1390,7 @@ function createOrUpdateInstanceLogs(instance,instanceState,action,user,timestamp
projectName: instance.projectName,
envName: instance.environmentName,
status: instanceState,
actionStatus: "success",
actionStatus: actionStatus,
platformId: instance.platformId,
blueprintName: instance.blueprintData.blueprintName,
data: instance.runlist,
Expand Down