Commit 551172fd authored by Ahmed Zarioh's avatar Ahmed Zarioh

Some fix for login

parent 6852e8ef
...@@ -22,10 +22,8 @@ ...@@ -22,10 +22,8 @@
class KairosController extends RestController class KairosController extends RestController
{ {
public static $SERVICE = 'KairosService'; public static $SERVICE = 'KairosService';
public static function getChart() public static function getChart()
{ {
$service = static::getService("charts"); $service = static::getService("charts");
......
...@@ -56,7 +56,7 @@ class Dispatcher ...@@ -56,7 +56,7 @@ class Dispatcher
switch ($controller_route) switch ($controller_route)
{ {
case "": case "":
$GLOBALS["return"] = ""; $GLOBALS["return"] = null;
//client side //client side
$GLOBALS['client']['apisObjects'] = json_decode(file_get_contents("config/apisObjects.json"), true); $GLOBALS['client']['apisObjects'] = json_decode(file_get_contents("config/apisObjects.json"), true);
......
...@@ -72,8 +72,9 @@ class RestController ...@@ -72,8 +72,9 @@ class RestController
{ {
$service = static::getService("login"); $service = static::getService("login");
$putData = static::getRequestContent(); $putData = static::getRequestContent();
$service::login($putData->email,$putData->password); //if()
return ""; //$service::login($putData->email,$putData->password);
return true;
} }
public static function logout() public static function logout()
......
...@@ -294,6 +294,7 @@ class RestService ...@@ -294,6 +294,7 @@ class RestService
curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, TRUE); curl_setopt($ch, CURLOPT_HEADER, TRUE);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_TIMEOUT, 8); //timeout in seconds
//curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); //curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$api_response = curl_exec($ch); $api_response = curl_exec($ch);
$api_response_info = curl_getinfo($ch); $api_response_info = curl_getinfo($ch);
......
...@@ -124,6 +124,7 @@ function include_all_javascript($folder) ...@@ -124,6 +124,7 @@ function include_all_javascript($folder)
</span> </span>
</div> </div>
<div class="container-fluid" ng-view class="view-frame"></div> <div class="container-fluid" ng-view class="view-frame"></div>
</div> </div>
</div> </div>
</body> </body>
......
{ {
"colosseumapi" : { "colosseumapi" : {
"name": "colosseumapi", "name": "colosseumapi",
"url": "http://52.21.93.224:9000/api", "url": "http://52.210.93.224:9000/api",
"controller": "ColosseumController" "controller": "ColosseumController"
}, },
"kairosapi" : { "kairosapi" : {
"name": "kairosapi", "name": "kairosapi",
"url": "http://52.21.93.224:8080/api/v1/datapoints/query", "url": "http://52.210.93.224:8080/api/v1/datapoints/query",
"controller": "KairosController", "controller": "KairosController",
"router": "KairosRouter" "router": "KairosRouter"
} }
......
...@@ -98,5 +98,5 @@ if(isset($GLOBALS["return"])) ...@@ -98,5 +98,5 @@ if(isset($GLOBALS["return"]))
} }
else else
{ {
echo "error return"; //echo "error return";
} }
\ No newline at end of file
...@@ -34,9 +34,10 @@ crudControllers.controller('ChartsCtrl', function($scope,$interval,$http,ajaxFac ...@@ -34,9 +34,10 @@ crudControllers.controller('ChartsCtrl', function($scope,$interval,$http,ajaxFac
$scope.init(monitorInstance); $scope.init(monitorInstance);
} }
$scope.init = function(monitorInstance) $scope.init = function(monitorInstance)
{ {
$scope.wait = false;
$scope.graphDetails = {}; $scope.graphDetails = {};
$scope.graphDetails.monitorInstance = monitorInstance.id; $scope.graphDetails.monitorInstance = monitorInstance.id;
...@@ -79,7 +80,8 @@ crudControllers.controller('ChartsCtrl', function($scope,$interval,$http,ajaxFac ...@@ -79,7 +80,8 @@ crudControllers.controller('ChartsCtrl', function($scope,$interval,$http,ajaxFac
$scope.change = function() $scope.change = function()
{ {
//TODO add a protection like a synchronized thread (a variable that is false durring the ajax and would hide/enabled the inputs) //TODO add a protection like a synchronized thread (a variable that is false durring the ajax and would hide/enabled the inputs)
if($scope.wait == false)
{
$scope.wait = true; $scope.wait = true;
$scope.error = false; $scope.error = false;
...@@ -93,7 +95,14 @@ crudControllers.controller('ChartsCtrl', function($scope,$interval,$http,ajaxFac ...@@ -93,7 +95,14 @@ crudControllers.controller('ChartsCtrl', function($scope,$interval,$http,ajaxFac
ajaxFactory.post("charts",$scope.graphDetails).then(function(data, status, headers, config) ajaxFactory.post("charts",$scope.graphDetails).then(function(data, status, headers, config)
{ {
//$scope.azara = data; //$scope.azara = data;
if(data &&data.queries)
{
$scope.data = getInfoChart(data.queries); $scope.data = getInfoChart(data.queries);
}
else
{
}
$scope.wait = false; $scope.wait = false;
}, },
function(data, status, headers, config) function(data, status, headers, config)
...@@ -101,8 +110,11 @@ crudControllers.controller('ChartsCtrl', function($scope,$interval,$http,ajaxFac ...@@ -101,8 +110,11 @@ crudControllers.controller('ChartsCtrl', function($scope,$interval,$http,ajaxFac
$scope.wait = false; $scope.wait = false;
$scope.error = true; $scope.error = true;
}); });
}
}; };
$scope.interval = $interval($scope.change,10000); $scope.interval = $interval($scope.change,10000);
$scope.$on("$destroy", function(){ $scope.$on("$destroy", function(){
$interval.cancel($scope.interval); $interval.cancel($scope.interval);
}); });
......
...@@ -46,6 +46,9 @@ crudFactories.factory('ajaxFactory', function ($http,$q,$rootScope,$location,res ...@@ -46,6 +46,9 @@ crudFactories.factory('ajaxFactory', function ($http,$q,$rootScope,$location,res
$http(req) $http(req)
.success(function(data, status) .success(function(data, status)
{ {
console.log(url);
console.log(data);
console.log(status);
deferred.resolve(data); deferred.resolve(data);
resolverFactory.resolveSuccess(data, status); resolverFactory.resolveSuccess(data, status);
}) })
......
...@@ -35,6 +35,7 @@ crudFactories.factory('resolverFactory', function ($rootScope,$location) ...@@ -35,6 +35,7 @@ crudFactories.factory('resolverFactory', function ($rootScope,$location)
resolveError : function(data, status) resolveError : function(data, status)
{ {
$rootScope.loading = false; $rootScope.loading = false;
$rootScope.logged = false;
if(status==401) if(status==401)
{ {
$rootScope.logged = false; $rootScope.logged = false;
......
...@@ -68,7 +68,7 @@ ...@@ -68,7 +68,7 @@
<div class="row"> <div class="row">
<!-- ng class to col-12 --> <!-- ng class to col-12 -->
<div class="col-lg-9 col-xs-10" style="padding-top : 10px;padding-bottom : 10px;"> <div class="col-lg-9 col-xs-10" style="padding-top : 10px;padding-bottom : 10px;">
<h3 class="no-margin-v">applicationComponent List</h3> <h3 class="no-margin-v">applicationComponents</h3>
</div> </div>
<div ng-if="apiObjectHave('put')" <div ng-if="apiObjectHave('put')"
class="col-lg-3 col-xs-2 text-center no-padding td-button td-button-edit" class="col-lg-3 col-xs-2 text-center no-padding td-button td-button-edit"
...@@ -81,8 +81,19 @@ ...@@ -81,8 +81,19 @@
</div> </div>
</div> </div>
</div> </div>
<div class="panel-body"> <div class="panel-body">
<div class="col-md-3" ng-repeat="thing in item.applicationComponents" > <div class="col-md-3" ng-repeat="thing in item.applicationComponents" >
<div ng-controller="emptyCtrl"
ng-init="
thing.isCollapsed = true;
vmt_removable=false;
comp_removable=false;"
ng-include=" 'md-vmt.htm' ">
</div>
<!--
<div class="panel panel-primary"> <div class="panel panel-primary">
<div class="panel-heading"> <div class="panel-heading">
{{thing.id}} ( VMT : {{thing.virtualMachineTemplate}} ) {{thing.id}} ( VMT : {{thing.virtualMachineTemplate}} )
...@@ -93,8 +104,13 @@ ...@@ -93,8 +104,13 @@
</div> </div>
</div> </div>
</div> </div>
-->
</div> </div>
</div> </div>
</div> </div>
</div> </div>
...@@ -103,7 +119,7 @@ ...@@ -103,7 +119,7 @@
<div class="panel-heading" style="padding-top:0; padding-bottom:0;"> <div class="panel-heading" style="padding-top:0; padding-bottom:0;">
<div class="row"> <div class="row">
<div class="col-lg-9 col-xs-10" style="padding-top : 10px;padding-bottom : 10px;"> <div class="col-lg-9 col-xs-10" style="padding-top : 10px;padding-bottom : 10px;">
<h3 class="no-margin-v">Communications List</h3> <h3 class="no-margin-v">Communications</h3>
</div> </div>
<div ng-if="apiObjectHave('put')" <div ng-if="apiObjectHave('put')"
class="col-lg-3 col-xs-2 text-center no-padding td-button td-button-edit" class="col-lg-3 col-xs-2 text-center no-padding td-button td-button-edit"
...@@ -118,9 +134,9 @@ ...@@ -118,9 +134,9 @@
</div> </div>
<div class="panel-body"> <div class="panel-body">
<div class="row"> <div class="row">
<div class="col-md-12" ng-repeat="communication in item.communications"> <div class="col-md-12 col-lg-6" ng-repeat="communication in item.communications">
<div class="panel panel-info"> <div class="panel panel-info">
<div class="panel-heading"> <div class="panel-heading" >
Communication number {{communication.id}} Communication number {{communication.id}}
</div> </div>
<div class="panel-body" style="min-height:40px;"> <div class="panel-body" style="min-height:40px;">
...@@ -133,7 +149,7 @@ ...@@ -133,7 +149,7 @@
<div ng-controller="emptyCtrl" <div ng-controller="emptyCtrl"
ng-init=" ng-init="
thing = item.applicationComponentsById[item.portProvs[communication.providedPort].applicationComponent]; thing = item.applicationComponentsById[item.portProvs[communication.providedPort].applicationComponent];
thing.isCollapsed = true;
vmt_removable=false; vmt_removable=false;
comp_removable=false;" comp_removable=false;"
ng-include=" 'md-vmt.htm' "> ng-include=" 'md-vmt.htm' ">
...@@ -199,13 +215,14 @@ ...@@ -199,13 +215,14 @@
<script type="text/ng-template" id="md-vmt.htm"> <script type="text/ng-template" id="md-vmt.htm">
<div class="panel panel-primary panel-xs"> <div class="panel panel-primary panel-xs">
<div class="panel-heading" style="padding-top:0; padding-bottom:0;"> <div class="panel-heading" style="padding-top:0; padding-bottom:0;" ng-click="thing.isCollapsed = !thing.isCollapsed">
<div class="row"> <div class="row">
<!-- ng class to col-12 --> <!-- ng class to col-12 -->
<div class="col-md-9" style="padding-top : 10px;padding-bottom : 10px;"> <div class="col-md-12" style="padding-top : 8px;padding-bottom : 8px;">
<span ng-if="title!==undefined">{{title}}</span> <span ng-if="title!==undefined">{{title}}</span>
<span ng-if="title===undefined">VMT : {{thing.id}} </span> <span ng-if="title===undefined">ApplicationComponent {{thing.id}} </span>
</div> </div>
<div ng-if="vmt_removable" class="col-md-3 text-center no-padding td-button td-button-delete" ng-click="currentList.splice($index, 1)"> <div ng-if="vmt_removable" class="col-md-3 text-center no-padding td-button td-button-delete" ng-click="currentList.splice($index, 1)">
<div data-original-title="delete" data-toggle="tooltip" data-placement="top" title="" tooltip=""> <div data-original-title="delete" data-toggle="tooltip" data-placement="top" title="" tooltip="">
...@@ -214,9 +231,13 @@ ...@@ -214,9 +231,13 @@
</span> </span>
</div> </div>
</div> </div>
<div ng-show="thing.isCollapsed" class="col-md-12" style="background:#49d;padding-top : 8px;padding-bottom : 8px;">
<span ng-if="title!==undefined">{{title}}</span>
<span ng-if="title===undefined"> VMT-{{thing.virtualMachineTemplate}} </span>
</div>
</div> </div>
</div> </div>
<div class="panel-body" <div ng-show="thing.isCollapsed" class="panel-body"
ng-class="{ 'dotted-border' : thing.components.length == 0 }" ng-class="{ 'dotted-border' : thing.components.length == 0 }"
style="min-height:40px;" style="min-height:40px;"
dnd-list="thing.components" dnd-list="thing.components"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment