Correct bug
This commit is contained in:
parent
cddd9682e6
commit
a9e8c8e664
4 changed files with 35 additions and 30 deletions
|
@ -6,20 +6,35 @@
|
|||
mainApp.controller('machineCreationCtrl', ['$scope', 'Compute', '$rootScope', '$timeout', 'Identity', function ($scope, Compute, $rootScope, $timeout, Identity)
|
||||
{
|
||||
|
||||
|
||||
$scope.name = "loic"
|
||||
$scope.name = "";
|
||||
$('#pleaseChooseAnImage').hide();
|
||||
// When we need to show details of machine
|
||||
$scope.$on('showMachineCreationEvent', function (eventName, axioms) {
|
||||
$scope.axioms=axioms;
|
||||
$scope.axioms = axioms;
|
||||
$('#machineCreationModal').modal({backdrop: false, keyboard: true});
|
||||
});
|
||||
|
||||
$scope.createMachine=function(){
|
||||
machine={}
|
||||
machine.name="loicTest"
|
||||
machine.flavorId=1
|
||||
machine.imageId="fd1ea580-a83e-4dc8-833c-96ce2b6f1358"
|
||||
Compute.createMachine(function(){console.log("done")}, machine)
|
||||
|
||||
var callMeAfterMachineCreation=function(response){
|
||||
Compute.pullData(function(){});
|
||||
};
|
||||
|
||||
$scope.createMachine = function () {
|
||||
if ($scope.selectedImage == null) {
|
||||
$('#pleaseChooseAnImage').show();
|
||||
} else {
|
||||
$('#pleaseChooseAnImage').hide();
|
||||
$('#machineCreationModal').modal("hide");
|
||||
|
||||
machine = {}
|
||||
machine.name = $scope.name
|
||||
machine.flavorId = 1
|
||||
machine.imageId = $scope.selectedImage
|
||||
|
||||
|
||||
Compute.createMachine(callMeAfterMachineCreation, machine)
|
||||
$scope.name="";
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
}]);
|
||||
|
|
|
@ -42,7 +42,7 @@ mainApp.controller('machineDetailsCtrl', ['$scope', 'Compute', '$rootScope', '$t
|
|||
};
|
||||
|
||||
$scope.deleteMachine=function(){
|
||||
Compute.deleteMachine(function(){console.log("deleted")},$scope.machine.id);
|
||||
Compute.deleteMachine(function(){Compute.pullData(function(){});},$scope.machine.id);
|
||||
}
|
||||
|
||||
}]);
|
||||
|
|
|
@ -112,8 +112,9 @@ mainApp.factory('Compute', ['$http', 'Identity', function ($http, Identity) {
|
|||
|
||||
// Wait and handle the response
|
||||
result.then(function (response) {
|
||||
callback();
|
||||
console.log(response.data.Error)
|
||||
console.log(response.data)
|
||||
callback();
|
||||
|
||||
}, function (response) {
|
||||
console.log("error")
|
||||
callback();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue