Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also .

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also .
  • 7 commits
  • 28 files changed
  • 0 commit comments
  • 1 contributor
Commits on Mar 16, 2014
…network (JIN-140) . Paint failed state in red. Change ip range creation text.
@@ -185,6 +185,7 @@ angular.module('fifoApp',

.run(function($rootScope, gettextCatalog, gettext, $window, $templateCache) {


//Empty ng-table template for pagination
$templateCache.put('ng-table/pager.html', '')

@@ -217,4 +218,10 @@ angular.module('fifoApp',
setTimeout(preventHrefs, 0)
})

})
})


//Turn off ngTable logs, (while waiting for https://github.com/esvit/ng-table/issues/134)
angular.module('fifoApp').config(function($logProvider) {
$logProvider.debugEnabled(false);
});
@@ -7,7 +7,7 @@ angular.module('fifoApp')
$scope.auth = auth;

$scope.infinitScroll = function() {
$scope.tableParams.count($scope.tableParams.count() + 15);
$scope.tableParams.count($scope.tableParams.count() + 20);
}

$scope.start = function(vm) {
@@ -105,6 +105,14 @@ angular.module('fifoApp')
filterData()
})
})

$scope.$watch('searchQuery', function(val) {
filterData()

if (typeof val != 'undefined')
auth.currentUser().mdata_set({vm_searchQuery: val})
})

}

var startRequests = function() {
@@ -113,7 +121,7 @@ angular.module('fifoApp')

$scope.tableParams = new ngTableParams({
page: 1,
count: 15,
count: 30,
total: 0, //0=disable
sorting: {
'config.alias': 'desc' //Could save this in the user metadata.. :P
@@ -126,38 +134,22 @@ angular.module('fifoApp')
}
})

//When something on the table changes, i.e. infinit scroll detected.
$scope.$watch('tableParams', function() {
filterData()
}, true);

$scope.$watch('searchQuery', function(val) {
filterData()

if (typeof val != 'undefined')
auth.currentUser().mdata_set({vm_searchQuery: val})
})

$scope.vmsFiltered = []

$scope.vms = wiggle.vms.queryFull()

$scope.vms.$promise.then(function(vms) {
vms.forEach(vmService.updateCustomFields)
defered.resolve()
listenEvents()
})

listenEvents()

return defered.promise

}

var requestsPromise = startRequests()

requestsPromise.then(function() {
auth.userPromise().then(function() {
$scope.searchQuery = auth.currentUser().mdata('vm_searchQuery');
filterData()
});

})
});
@@ -38,8 +38,6 @@ angular.module('fifoApp')

}

// $cookies["x-snarl-token"] && $scope.show()

/* Update data on memory change */
$scope.$on('memorychange', $scope.show);

@@ -28,10 +28,11 @@ angular.module('fifoApp')
};

$scope.remove_iprange = function(iprange, idx) {
var uuid = $scope.network.ipranges[idx]
wiggle.networks.delete({
id: $scope.network.uuid,
controller: 'ipranges',
controller_id: iprange},
controller_id: uuid},
function ok(){
$scope.network._ipranges.splice(idx, 1)
$scope.network.ipranges.splice(idx, 1)
@@ -69,9 +69,12 @@ angular.module('fifoApp')
user.keys = user.keys || []
user.groups = user.groups || []

// console.log('seteando el cookie...', $cookies, res)

//We dont want cookies, becouse pointing to a different datacenter requires to change the endpoint, cannot save cookies on different endpoints.
//But we will use it anyway to read the value and store it on wiggle headers calls. Localstorage would work also...
$cookies["x-snarl-token"] = res.session
//Wiggle see to read the cookie, now so setting the header is not neccesary anymore.
//$http.defaults.headers.common['x-snarl-token'] = res.session || 'test_Session';

$rootScope.$broadcast('auth:login_ok', user, res.session)
$location.path('/')
},
@@ -108,6 +111,7 @@ angular.module('fifoApp')
user = new wiggle.users({status: 'waiting for login validation'})

var token = $cookies["x-snarl-token"]
// console.log('checkIfLogged', token)
if (!token)
return $rootScope.$broadcast('auth:login_needed')

@@ -139,6 +143,7 @@ angular.module('fifoApp')
$rootScope.$on('auth:login_ok', function() {

userLoggedDefer.resolve(user)
wiggle.setUp(); //Setup the token in the headers.

/* Pass the token to autenticate, and a list of vms to monitor */
if ('WebSocket' in window) {
@@ -49,6 +49,11 @@ angular.module('fifoApp')
vm._name = (vm.config && vm.config.alias) || vm.uuid && vm.uuid.split('-')[0]

switch (vm.state) {
case 'failed':
vm.state_description = "Could not create the VM with vmadm.";
vm.state = 'failed';
vm._state_label = 'danger';
break;
case 'failed-get_ips':
vm.state_description = "No IP address for the machine could be obtained.";
vm.state = 'failed';

No commit comments for this range

You can’t perform that action at this time.