Merge branch 'Eole' into develop
Conflicts: client/js/controllers/home/home.js
This commit is contained in:
commit
d3fc2ab36c
6 changed files with 38 additions and 7 deletions
|
@ -24,7 +24,7 @@ mainApp.config(['$routeProvider', function($routeProvider){
|
||||||
templateUrl: 'partials/image/image.html',
|
templateUrl: 'partials/image/image.html',
|
||||||
controller: 'imageCtrl'
|
controller: 'imageCtrl'
|
||||||
}).otherwise({
|
}).otherwise({
|
||||||
redirectTo: '/home'
|
redirectTo: '/'
|
||||||
});
|
});
|
||||||
}]);
|
}]);
|
||||||
|
|
||||||
|
|
23
client/js/controllers/home/home.js
Normal file → Executable file
23
client/js/controllers/home/home.js
Normal file → Executable file
|
@ -9,16 +9,31 @@ mainApp.controller('homeCtrl', [ '$scope', 'Compute', '$rootScope', 'Loading','I
|
||||||
var callMeAfterPullData=function(data){
|
var callMeAfterPullData=function(data){
|
||||||
$scope.machines=Compute.getData().machines;
|
$scope.machines=Compute.getData().machines;
|
||||||
Loading.stop();
|
Loading.stop();
|
||||||
};
|
}
|
||||||
|
|
||||||
|
;
|
||||||
|
if(Compute.getData().machines == null && Identity.isAlreadyLogin()){
|
||||||
|
Loading.start();
|
||||||
|
Compute.pullData(callMeAfterPullData);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
if(Identity.isAlreadyLogin()){
|
||||||
|
callMeAfterPullData();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Image.getImages(function(){});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$scope.raiseShowMachineDetailsEvent=function(id){
|
$scope.raiseShowMachineDetailsEvent=function(id){
|
||||||
|
|
||||||
var callback=function(){
|
var callback=function(){
|
||||||
Loading.stop();
|
Loading.stop();
|
||||||
var data=Compute.getData();
|
var data=Compute.getData();
|
||||||
$rootScope.$broadcast("showMachineDetailsEvent", data.machines[id], data.axioms);
|
$rootScope.$broadcast("showMachineDetailsEvent", data.machines[id], data.axioms);
|
||||||
|
|
||||||
}
|
}
|
||||||
Loading.start();
|
Loading.start();
|
||||||
Compute.pullMachines(callback);
|
Compute.pullMachines(callback);
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
|
|
||||||
$config["modules_enabled"] = "";
|
$config["modules_enabled"] = "";
|
||||||
$config["urlAuth"] = "http://148.60.11.31:5000/v3";
|
$config["urlAuth"] = "http://148.60.11.31:5000/v3";
|
||||||
|
$config["tokenTime"] = 60 //miunte = 60 //miuntess
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -37,6 +37,10 @@ class App{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function checkToken(){
|
||||||
|
$this->tokenClass->checkToken();
|
||||||
|
}
|
||||||
|
|
||||||
public function getLibClass($service){
|
public function getLibClass($service){
|
||||||
|
|
||||||
switch($service){
|
switch($service){
|
||||||
|
|
|
@ -49,6 +49,12 @@ class genTokenOptions
|
||||||
$stack->push(GuzzleMiddleware::log($options['logger'], $options['messageFormatter']));
|
$stack->push(GuzzleMiddleware::log($options['logger'], $options['messageFormatter']));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function checkToken(){
|
||||||
|
|
||||||
|
return $this->backup['time'] > time();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
public function genIdentityToken(){
|
public function genIdentityToken(){
|
||||||
$options = $this->optionsGlobal['Common'];
|
$options = $this->optionsGlobal['Common'];
|
||||||
|
@ -271,6 +277,7 @@ class genTokenOptions
|
||||||
$path = "core/LibOverride/projectTokenData/".$token['saved']["project"]["name"];
|
$path = "core/LibOverride/projectTokenData/".$token['saved']["project"]["name"];
|
||||||
//error_log(print_r($path, true), 0);
|
//error_log(print_r($path, true), 0);
|
||||||
file_put_contents("core/LibOverride/projectTokenData/".$token['saved']["project"]["name"], serialize($token['saved']));
|
file_put_contents("core/LibOverride/projectTokenData/".$token['saved']["project"]["name"], serialize($token['saved']));
|
||||||
|
$this->backup['time'] = $token['time'];
|
||||||
$this->backup["roles"] = $token["roles"];
|
$this->backup["roles"] = $token["roles"];
|
||||||
$this->backup["project"] = $token['saved']["project"]["name"];
|
$this->backup["project"] = $token['saved']["project"]["name"];
|
||||||
$this->backup["user"] = $token["user"];
|
$this->backup["user"] = $token["user"];
|
||||||
|
@ -284,7 +291,7 @@ class genTokenOptions
|
||||||
public function loadBackup($back){
|
public function loadBackup($back){
|
||||||
|
|
||||||
$backup = unserialize($back);
|
$backup = unserialize($back);
|
||||||
|
$this->backup['time'] = $backup['time'];
|
||||||
$this->backup["roles"] = $backup["roles"];
|
$this->backup["roles"] = $backup["roles"];
|
||||||
$this->backup["project"] = $backup["project"];
|
$this->backup["project"] = $backup["project"];
|
||||||
$this->backup["user"] = $backup["user"];
|
$this->backup["user"] = $backup["user"];
|
||||||
|
@ -343,6 +350,7 @@ class genTokenOptions
|
||||||
$tokenSerialized["user"]["name"] = serialize($token->user->name);
|
$tokenSerialized["user"]["name"] = serialize($token->user->name);
|
||||||
$tokenSerialized["token"]["issued"] = serialize($token->issued);
|
$tokenSerialized["token"]["issued"] = serialize($token->issued);
|
||||||
$tokenSerialized["token"]["id"] = serialize($token->id);
|
$tokenSerialized["token"]["id"] = serialize($token->id);
|
||||||
|
$tokenSerialized['time'] = time()+$config['tokenTime']*60;
|
||||||
|
|
||||||
return $tokenSerialized;
|
return $tokenSerialized;
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
$App->deauthenticate();
|
$App->deauthenticate();
|
||||||
$App->show();
|
$App->show();
|
||||||
|
|
||||||
}else{
|
}else if($App->checkToken()){
|
||||||
switch($task)
|
switch($task)
|
||||||
{
|
{
|
||||||
case "identity":
|
case "identity":
|
||||||
|
@ -54,6 +54,9 @@
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}else{
|
||||||
|
$App->setOuptut("Error", "Token Invalide");
|
||||||
|
$App->show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue