From fa5a48bc3a76b109f6611620b6e56f3024def029 Mon Sep 17 00:00:00 2001 From: manzerbredes Date: Wed, 2 Mar 2016 17:41:04 +0100 Subject: Correct bugs --- client/partials/nav.html | 26 +++++++------------------- 1 file changed, 7 insertions(+), 19 deletions(-) (limited to 'client/partials') diff --git a/client/partials/nav.html b/client/partials/nav.html index b3ef76a..01b9079 100644 --- a/client/partials/nav.html +++ b/client/partials/nav.html @@ -8,7 +8,7 @@ - Status + Status @@ -18,24 +18,12 @@ - +
  • User : {{ profile.username }}
  • +
  • Project Name : {{ profile.projectname }}
  • + - - + + -- cgit v1.2.3 From e2be86814e8ac92778bfa9fc49e1d02946a7efbc Mon Sep 17 00:00:00 2001 From: manzerbredes Date: Wed, 2 Mar 2016 20:46:24 +0100 Subject: Clean some things --- client/index.html | 27 +++++++++++++------------- client/js/controllers/home/machineDetails.js | 10 ++++++---- client/partials/home/machineDetails.html | 2 +- client/partials/nav.html | 29 ---------------------------- client/partials/status.html | 29 ++++++++++++++++++++++++++++ 5 files changed, 50 insertions(+), 47 deletions(-) delete mode 100644 client/partials/nav.html create mode 100644 client/partials/status.html (limited to 'client/partials') diff --git a/client/index.html b/client/index.html index 8ca2b9f..ca6bbe6 100644 --- a/client/index.html +++ b/client/index.html @@ -11,27 +11,28 @@ - + - + + +
    +
    +
    + + +
    - -
    - -
    -
    - - -
    + +
    @@ -56,7 +57,7 @@
    - + diff --git a/client/js/controllers/home/machineDetails.js b/client/js/controllers/home/machineDetails.js index 24fac42..c015eaa 100644 --- a/client/js/controllers/home/machineDetails.js +++ b/client/js/controllers/home/machineDetails.js @@ -6,23 +6,25 @@ mainApp.controller('machineDetailsCtrl', [ '$scope', 'Compute', '$rootScope', '$timeout', function ($scope, Compute, $rootScope, $timeout) { + // Init scope $scope.machine={}; - $("#waitingForToggleMachine").hide(); + $scope.machineIsStarting=false; // For loading icon + $scope.$on('showMachineDetailsEvent', function(eventName ,machine, axioms){ $scope.machine=machine; $scope.axioms=axioms; - console.log(machine); $('#machineDetailsModal').modal({backdrop: false, keyboard: true}); }); $scope.toggleMachineState=function(){ - $("#waitingForToggleMachine").show(); + // Display gif + $scope.machineIsStarting=true; // Fake timeout $timeout(function(){ - $("#waitingForToggleMachine").hide(); + $scope.machineIsStarting=false; }, 3000); $timeout(function(){ $scope.machine.online=!$scope.machine.online; diff --git a/client/partials/home/machineDetails.html b/client/partials/home/machineDetails.html index 47a65fb..c4c8a38 100644 --- a/client/partials/home/machineDetails.html +++ b/client/partials/home/machineDetails.html @@ -26,7 +26,7 @@   -   +   diff --git a/client/partials/nav.html b/client/partials/nav.html deleted file mode 100644 index 01b9079..0000000 --- a/client/partials/nav.html +++ /dev/null @@ -1,29 +0,0 @@ - diff --git a/client/partials/status.html b/client/partials/status.html new file mode 100644 index 0000000..01b9079 --- /dev/null +++ b/client/partials/status.html @@ -0,0 +1,29 @@ + -- cgit v1.2.3 From 96094547dd793868092dda4c2699a839287fa175 Mon Sep 17 00:00:00 2001 From: manzerbredes Date: Sun, 6 Mar 2016 14:51:50 +0100 Subject: Add image view, controller. --- client/index.html | 1 + client/js/app.js | 8 ++++++-- client/js/controllers/image/image.js | 9 +++++++++ client/partials/home/home.html | 12 ++++++++++++ client/partials/home/main.html | 12 ------------ client/partials/image/image.html | 8 ++++++++ client/partials/menu.html | 3 ++- client/partials/network/main.html | 8 -------- client/partials/network/network.html | 8 ++++++++ 9 files changed, 46 insertions(+), 23 deletions(-) create mode 100644 client/js/controllers/image/image.js create mode 100644 client/partials/home/home.html delete mode 100644 client/partials/home/main.html create mode 100644 client/partials/image/image.html delete mode 100644 client/partials/network/main.html create mode 100644 client/partials/network/network.html (limited to 'client/partials') diff --git a/client/index.html b/client/index.html index 48ea4a0..a06994c 100644 --- a/client/index.html +++ b/client/index.html @@ -89,6 +89,7 @@ + diff --git a/client/js/app.js b/client/js/app.js index e2d5b9b..1602e65 100644 --- a/client/js/app.js +++ b/client/js/app.js @@ -13,12 +13,16 @@ mainApp.config(['$routeProvider', function($routeProvider){ $routeProvider. when('/home',{ - templateUrl: 'partials/home/main.html', + templateUrl: 'partials/home/home.html', controller: 'homeCtrl' }). when('/network',{ - templateUrl: 'partials/network/main.html', + templateUrl: 'partials/network/network.html', controller: 'networkCtrl' + }). + when('/image',{ + templateUrl: 'partials/image/image.html', + controller: 'imageCtrl' }).otherwise({ redirectTo: '/home' }); diff --git a/client/js/controllers/image/image.js b/client/js/controllers/image/image.js new file mode 100644 index 0000000..036dec3 --- /dev/null +++ b/client/js/controllers/image/image.js @@ -0,0 +1,9 @@ +/** + * The image controller + * + * @param {$scope} $scope The $scope service from angular + */ +mainApp.controller('imageCtrl', function ($scope) +{ + $scope.title="Test"; +}); diff --git a/client/partials/home/home.html b/client/partials/home/home.html new file mode 100644 index 0000000..f9f8878 --- /dev/null +++ b/client/partials/home/home.html @@ -0,0 +1,12 @@ +
    +
    + Home +
    +
    + + Pour charger les machines, recharger la page (temporaire)
    + Selectionner une machine: + + +
    +
    diff --git a/client/partials/home/main.html b/client/partials/home/main.html deleted file mode 100644 index f9f8878..0000000 --- a/client/partials/home/main.html +++ /dev/null @@ -1,12 +0,0 @@ -
    -
    - Home -
    -
    - - Pour charger les machines, recharger la page (temporaire)
    - Selectionner une machine: - - -
    -
    diff --git a/client/partials/image/image.html b/client/partials/image/image.html new file mode 100644 index 0000000..586f003 --- /dev/null +++ b/client/partials/image/image.html @@ -0,0 +1,8 @@ +
    +
    + Image +
    +
    + Main Content +
    +
    diff --git a/client/partials/menu.html b/client/partials/menu.html index dfd5842..a473fd8 100644 --- a/client/partials/menu.html +++ b/client/partials/menu.html @@ -1,4 +1,5 @@ \ No newline at end of file + Images + diff --git a/client/partials/network/main.html b/client/partials/network/main.html deleted file mode 100644 index 8b779be..0000000 --- a/client/partials/network/main.html +++ /dev/null @@ -1,8 +0,0 @@ -
    -
    - Network -
    -
    - Main Content -
    -
    diff --git a/client/partials/network/network.html b/client/partials/network/network.html new file mode 100644 index 0000000..8b779be --- /dev/null +++ b/client/partials/network/network.html @@ -0,0 +1,8 @@ +
    +
    + Network +
    +
    + Main Content +
    +
    -- cgit v1.2.3 From b0b2dc9a6451fc1a2d41b255600094da1ece6485 Mon Sep 17 00:00:00 2001 From: manzerbredes Date: Sun, 6 Mar 2016 15:04:47 +0100 Subject: Avalaible images can be display --- client/js/controllers/image/image.js | 10 +++++++--- client/js/services/Image.js | 29 +++++++++++++++++++++++++++-- client/partials/image/image.html | 8 +++++--- 3 files changed, 39 insertions(+), 8 deletions(-) (limited to 'client/partials') diff --git a/client/js/controllers/image/image.js b/client/js/controllers/image/image.js index 036dec3..a8346b3 100644 --- a/client/js/controllers/image/image.js +++ b/client/js/controllers/image/image.js @@ -3,7 +3,11 @@ * * @param {$scope} $scope The $scope service from angular */ -mainApp.controller('imageCtrl', function ($scope) +mainApp.controller('imageCtrl', ['$scope', 'Image', function ($scope, Image) { - $scope.title="Test"; -}); + var callbackTest=function(){ + $scope.images=Image.getData().images; + }; + + Image.getImages(callbackTest); +}]); diff --git a/client/js/services/Image.js b/client/js/services/Image.js index eccd4af..2e8c56f 100644 --- a/client/js/services/Image.js +++ b/client/js/services/Image.js @@ -1,10 +1,31 @@ mainApp.factory('Image',[ '$http', 'Identity', function($http, Identity){ + var data={}; + data.images=null; var parseUploadImageAnswer=function(response, failedToSendRequest){ - console.log(response.data.Images[0]) + + // Defined return object + var requestParserResult={}; + requestParserResult.status=1; + requestParserResult.failReason=null; + + + if (typeof response.data.Images !== 'undefined') { + // Set status code + requestParserResult.status=0; + data.images=response.data.Images; + + } + else if(failedToSendRequest){ + requestParserResult.failReason="Failed to send request"; + } + else{ + requestParserResult.failReason="Error"; + } + return requestParserResult; }; @@ -24,10 +45,14 @@ mainApp.factory('Image',[ '$http', 'Identity', function($http, Identity){ }; + var getData=function(response){ + return data; + }; // Return services objects return { - getImages:getImages + getImages:getImages, + getData:getData }; diff --git a/client/partials/image/image.html b/client/partials/image/image.html index 586f003..8af8af5 100644 --- a/client/partials/image/image.html +++ b/client/partials/image/image.html @@ -1,8 +1,10 @@ -
    +
    - Image + Images disponibles
    - Main Content +
    + {{image.name}} +
    -- cgit v1.2.3