summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authormanzerbredes <loic.guegan_secondary@yahoo.fr>2016-02-22 17:30:25 +0100
committermanzerbredes <loic.guegan_secondary@yahoo.fr>2016-02-22 17:30:25 +0100
commitff1832adcfe10fadb6cbf738c874611f77f6dd43 (patch)
treeb5a669023c1b19244f674fd459558b75f153dbd4 /client
parent0c31cbdbd4aaf41c5f24f96e1ee0ae79a8baee24 (diff)
Edit Compute service and home controller
Diffstat (limited to 'client')
l---------client/js/controllers/.#status.js1
-rw-r--r--client/js/controllers/home/main.js9
-rw-r--r--client/js/controllers/status.js5
-rw-r--r--client/js/services/Compute.js14
4 files changed, 24 insertions, 5 deletions
diff --git a/client/js/controllers/.#status.js b/client/js/controllers/.#status.js
deleted file mode 120000
index e6c258f..0000000
--- a/client/js/controllers/.#status.js
+++ /dev/null
@@ -1 +0,0 @@
-loic@Manzerbredes.home.30343:1455008378 \ No newline at end of file
diff --git a/client/js/controllers/home/main.js b/client/js/controllers/home/main.js
index d42e413..d25bfad 100644
--- a/client/js/controllers/home/main.js
+++ b/client/js/controllers/home/main.js
@@ -5,6 +5,13 @@
*/
mainApp.controller('homeCtrl', [ '$scope', 'Compute', function ($scope, Compute)
{
-
+
+
+ var updatePage=function(){
+ // TODO Update graph etc...
+ }
+
+ // Retrieve all Data
+ Compute.pullData(updatePage);
}]);
diff --git a/client/js/controllers/status.js b/client/js/controllers/status.js
index 6bc602a..e01df34 100644
--- a/client/js/controllers/status.js
+++ b/client/js/controllers/status.js
@@ -8,8 +8,11 @@
*/
mainApp.controller('statusCtrl', ['$scope','Identity', '$rootScope', function ($scope, Identity, $rootScope)
{
+
+ // Give profile to model
$scope.profile=Identity.profile;
-
+
+ // Function to logout
$scope.logout=function(){
Identity.logout();
$rootScope.$broadcast('logoutEvent');
diff --git a/client/js/services/Compute.js b/client/js/services/Compute.js
index 748510e..c5c8da9 100644
--- a/client/js/services/Compute.js
+++ b/client/js/services/Compute.js
@@ -2,6 +2,10 @@
mainApp.factory('Compute',[ '$http', 'Identity', function($http, Identity){
+
+ var data={};
+ data.machines={};
+
// Parser
var parseGetMachinesAnswer=function(response, failedToSendRequest){
@@ -13,17 +17,23 @@ mainApp.factory('Compute',[ '$http', 'Identity', function($http, Identity){
var getMachines=function(callback){
var result=$http.post('../server/index.php',
- $.param({"token" : Identity.profile.token, "task" : "Compute"}));
+ $.param({"token" : Identity.profile.token, "task" : "Compute"}));
-
};
+
+
+ var pullData=function(callback){
+ // TODO call getMachines etc...
+ }
// Return services objects
return {
getMachines: getMachines
+ pullData: pullData
+ data:data
};