Skip to content

Commit

Permalink
Fixed: Issue #70
Browse files Browse the repository at this point in the history
  • Loading branch information
Zohaib Hassan committed Apr 19, 2017
1 parent 49c3664 commit 7fe90b5
Show file tree
Hide file tree
Showing 10 changed files with 52 additions and 52 deletions.
4 changes: 2 additions & 2 deletions src/main/resources/static/js/controllers/indexController.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ app.controller('IndexCtrl', function ($document, $scope, $compile, $routeParams,
$scope.NFVOversion = response
})
.error(function (response, status) {
showError(status, response);
showError(response, status);
});
}

Expand Down Expand Up @@ -440,7 +440,7 @@ app.controller('IndexCtrl', function ($document, $scope, $compile, $routeParams,

})
.error(function (response, status) {
showError(status, response);
showError(response, status);
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ var app = angular.module('app').controller('keyPairsCtrl', function ($scope, ser
//location.reload();
})
.error(function (response, status) {
showError(status, response);
showError(response, status);
});
};
$scope.delete = function (data) {
Expand All @@ -69,7 +69,7 @@ var app = angular.module('app').controller('keyPairsCtrl', function ($scope, ser

})
.error(function (response, status) {
showError(status, response);
showError(response, status);
});
};
$scope.generateKey = function (generateKeyName) {
Expand All @@ -91,11 +91,11 @@ var app = angular.module('app').controller('keyPairsCtrl', function ($scope, ser
//location.reload();
})
.error(function (response, status) {
showError(status, response);
showError(response, status);
});
};

function showError(status, data) {
function showError(data, status) {
if (status === 500) {
$scope.alerts.push({
type: 'danger',
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/static/js/controllers/marketCtrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ var app = angular.module('app').controller('marketCtrl', function ($scope, servi
$scope.NFVOversion = response
})
.error(function (response, status) {
showError(status, response);
showError(response, status);
});
}

Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/static/js/controllers/nsdController.js
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ app.controller('NsdCtrl', function ($scope, $compile, $cookieStore, $routeParams
})
.error(function (data, status) {
console.error('STATUS: ' + status + ' DATA: ' + data);
showError(status, JSON.stringify(data));
showError(JSON.stringify(data), status);
});

};
Expand All @@ -473,7 +473,7 @@ app.controller('NsdCtrl', function ($scope, $compile, $cookieStore, $routeParams
})
.error(function (data, status) {
console.error('STATUS: ' + status + ' DATA: ' + data);
showError(status, JSON.stringify(data));
showError(JSON.stringify(data), status);
});
};

Expand Down
32 changes: 16 additions & 16 deletions src/main/resources/static/js/controllers/nsrController.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ var app = angular.module('app').controller('NsrCtrl', function ($scope, $http, $
loadTable();
})
.error(function (data, status) {
showError(status, data);
showError(data, status);
});
$scope.connection_point = {
"floatingIp": "",
Expand All @@ -106,7 +106,7 @@ var app = angular.module('app').controller('NsrCtrl', function ($scope, $http, $
loadTable();
})
.error(function (data, status) {
showError(status, data);
showError(data, status);
});
};

Expand All @@ -117,7 +117,7 @@ var app = angular.module('app').controller('NsrCtrl', function ($scope, $http, $
loadTable();
})
.error(function (data, status) {
showError(status, data);
showError(data, status);
});
};

Expand Down Expand Up @@ -217,7 +217,7 @@ var app = angular.module('app').controller('NsrCtrl', function ($scope, $http, $
loadTable();
})
.error(function (data, status) {
showError(status, data);
showError(data, status);
});
$scope.connection_pointsVDU = [];
$scope.connection_point = {
Expand Down Expand Up @@ -290,7 +290,7 @@ var app = angular.module('app').controller('NsrCtrl', function ($scope, $http, $
// window.setTimeout($scope.cleanModal(), 3000);
})
.error(function (data, status) {
showError(status, data);
showError(data, status);
});
}

Expand All @@ -302,7 +302,7 @@ var app = angular.module('app').controller('NsrCtrl', function ($scope, $http, $
// window.setTimeout($scope.cleanModal(), 3000);
})
.error(function (data, status) {
showError(status, data);
showError(data, status);
});
}
}
Expand All @@ -321,7 +321,7 @@ var app = angular.module('app').controller('NsrCtrl', function ($scope, $http, $
setTimeout(loadTable, 500);
})
.error(function (data, status) {
showError(status, data);
showError(data, status);
});
};

Expand Down Expand Up @@ -417,7 +417,7 @@ var app = angular.module('app').controller('NsrCtrl', function ($scope, $http, $
})
.error(function (data, status) {
console.error('STATUS: ' + status + ' DATA: ' + data);
showError(status, data);
showError(data, status);
});
};

Expand All @@ -429,7 +429,7 @@ var app = angular.module('app').controller('NsrCtrl', function ($scope, $http, $
})
.error(function (data, status) {
console.error('STATUS: ' + status + ' DATA: ' + data);
showError(status, data);
showError(data, status);
});
};

Expand All @@ -440,7 +440,7 @@ var app = angular.module('app').controller('NsrCtrl', function ($scope, $http, $
window.setTimeout(loadTable, 500);
})
.error(function (data, status) {
showError(status, data);
showError(data, status);
});
};

Expand All @@ -451,7 +451,7 @@ var app = angular.module('app').controller('NsrCtrl', function ($scope, $http, $
window.setTimeout(loadTable, 500);
})
.error(function (data, status) {
showError(status, data);
showError(data, status);
});
};

Expand Down Expand Up @@ -513,7 +513,7 @@ var app = angular.module('app').controller('NsrCtrl', function ($scope, $http, $
$scope.selection.ids = {};
/* -- multiple delete functions END -- */

function showError(status, data) {
function showError(data, status) {
if (status === 500) {
$scope.alerts.push({
type: 'danger',
Expand Down Expand Up @@ -568,7 +568,7 @@ var app = angular.module('app').controller('NsrCtrl', function ($scope, $http, $
console.log(response);
})
.error(function (data, status) {
showError(status, data);
showError(data, status);

});
else
Expand All @@ -581,7 +581,7 @@ var app = angular.module('app').controller('NsrCtrl', function ($scope, $http, $
//topologiesAPI.Jsplumb(response);
})
.error(function (data, status) {
showError(status, data);
showError(data, status);
//var destinationUrl = '#';
//$window.location.href = destinationUrl;
});
Expand All @@ -604,7 +604,7 @@ var app = angular.module('app').controller('NsrCtrl', function ($scope, $http, $
showOk("Stopped VNFCI with id" + vnfci.id);
})
.error(function (data, status) {
showError(status, data);
showError(data, status);
});
};

Expand All @@ -617,7 +617,7 @@ var app = angular.module('app').controller('NsrCtrl', function ($scope, $http, $
showOk("Stopped VNFCI with id" + vnfci.id);
})
.error(function (data, status) {
showError(status, data);
showError(data, status);
});
};
$scope.cleanmodal = function () {
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/static/js/controllers/userController.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ app.controller('UserCtrl', function ($scope, serviceAPI, $routeParams, http, $co
$scope.currentUser = response
})
.error(function (response, status) {
showError(status, response);
showError(response, status);
});
};

Expand Down
24 changes: 12 additions & 12 deletions src/main/resources/static/js/controllers/vimInstanceController.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ angular.module('app').controller('vimInstanceCtrl', function ($scope, $routePara
})
.error(function (data, status) {
console.error('STATUS: ' + status + ' DATA: ' + JSON.stringify(data));
showError(status, JSON.stringify(data));
showError(JSON.stringify(data), status);
});
}

Expand Down Expand Up @@ -122,9 +122,9 @@ function checkKey() {
})
.error(function (data, status) {
if (status === 400)
showError(status, {message:"Something went wrong"});
showError({message:"Something went wrong"}, status);
else
showError(status, data);
showError(data, status);

});
} else if (fileInput) {
Expand All @@ -137,7 +137,7 @@ function checkKey() {
loadVIM();
})
.error(function (data, status) {
showError(status, data);
showError(data, status);

});
} else if ($scope.textTopologyJson !== '') {
Expand All @@ -149,7 +149,7 @@ function checkKey() {
loadVIM();
})
.error(function (data, status) {
showError(status, data);
showError(data, status);

});
}
Expand Down Expand Up @@ -200,7 +200,7 @@ function checkKey() {
$scope.vimInstanceJson = {};
})
.error(function (data, status) {
showError(status, data);
showError(data, status);
});

};
Expand Down Expand Up @@ -233,7 +233,7 @@ function checkKey() {
$scope.upDatacenter = data;
})
.error(function (data, status) {
showError(status, data);
showError(data, status);
});
};
$scope.closeAlert = function (index) {
Expand All @@ -249,7 +249,7 @@ function checkKey() {

})
.error(function (data, status) {
showError(status, data);
showError(data, status);
});
};

Expand All @@ -262,15 +262,15 @@ function checkKey() {
$scope.vimInstanceJSON = JSON.stringify(response, undefined, 4);

}).error(function (data, status) {
showError(status, data);
showError(data, status);
});
else {
http.get(url)
.success(function (response) {
$scope.vimInstances = response;
})
.error(function (data, status) {
showError(status, data);
showError(data, status);
});
}
}
Expand All @@ -289,13 +289,13 @@ function checkKey() {

})
.error(function (data, status) {
showError(status, data);
showError(data, status);
});

}


function showError(status, data) {
function showError(data, status) {
if (status === 500) {
$scope.alerts.push({
type: 'danger',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,20 +43,20 @@ angular.module('app').
$scope.vnfcomponentJSON = JSON.stringify(response, undefined, 4);

}).error(function (data, status) {
showError(status, data);
showError(data, status);
});
else {
http.get(url)
.success(function (response) {
$scope.vnfcomponents = response;
})
.error(function (data, status) {
showError(status, data);
showError(data, status);
});
}
}

function showError(status, data) {
function showError(data, status) {
if (status === 500) {
$scope.alerts.push({
type: 'danger',
Expand Down
Loading

0 comments on commit 7fe90b5

Please sign in to comment.