Permalink
Comparing changes
Open a pull request
- 7 commits
- 28 files changed
- 0 commit comments
- 1 contributor
Commits on Mar 16, 2014
Unified
Split
Showing
with
179 additions
and 173 deletions.
- +8 −1 app/scripts/app.js
- +13 −21 app/scripts/controllers/machines.js
- +0 −2 app/scripts/controllers/main.js
- +2 −1 app/scripts/controllers/network.js
- +7 −2 app/scripts/services/auth.js
- +5 −0 app/scripts/services/vm.js
- +76 −59 app/scripts/services/wiggle.js
- +20 −20 app/styles/custom/animations.less
- +0 −23 app/styles/main.css
- +1 −1 app/views/ip-range-new.html
- +2 −0 app/views/server.html
- +1 −1 dist/console.html
- +4 −4 dist/index.html
- +0 −3 dist/scripts/1f69a46e.vnc_lib.js
- +3 −3 dist/scripts/{166e54bc.console.js → 2e7f404f.console.js}
- +2 −2 dist/scripts/{90492b24.vnc.js → 3012d626.vnc.js}
- +0 −15 dist/scripts/4bea0a84.bower_components.js
- +15 −0 dist/scripts/5d0b108f.bower_components.js
- +3 −0 dist/scripts/8199e600.vnc_lib.js
- +4 −0 dist/scripts/afb32dd0.main.js
- +5 −0 dist/scripts/c1af14c1.vendor.js
- +0 −4 dist/scripts/c2804158.main.js
- +0 −5 dist/scripts/ce98c266.vendor.js
- +1 −1 dist/styles/{32eab2de.app.css → 27a928e3.app.css}
- +1 −1 dist/styles/{19f23255.vnc.css → f8f71f5c.vnc.css}
- +1 −1 dist/views/ip-range-new.html
- +2 −0 dist/views/server.html
- +3 −3 dist/vnc.html
| @@ -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'; | ||
Oops, something went wrong.