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

Some fix for login

parent 6852e8ef
......@@ -22,10 +22,8 @@
class KairosController extends RestController
{
public static $SERVICE = 'KairosService';
public static function getChart()
{
$service = static::getService("charts");
......
......@@ -56,7 +56,7 @@ class Dispatcher
switch ($controller_route)
{
case "":
$GLOBALS["return"] = "";
$GLOBALS["return"] = null;
//client side
$GLOBALS['client']['apisObjects'] = json_decode(file_get_contents("config/apisObjects.json"), true);
......
......@@ -72,8 +72,9 @@ class RestController
{
$service = static::getService("login");
$putData = static::getRequestContent();
$service::login($putData->email,$putData->password);
return "";
//if()
//$service::login($putData->email,$putData->password);
return true;
}
public static function logout()
......
......@@ -294,6 +294,7 @@ class RestService
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, TRUE);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_TIMEOUT, 8); //timeout in seconds
//curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$api_response = curl_exec($ch);
$api_response_info = curl_getinfo($ch);
......
......@@ -124,6 +124,7 @@ function include_all_javascript($folder)
</span>
</div>
<div class="container-fluid" ng-view class="view-frame"></div>
</div>
</div>
</body>
......
{
"colosseumapi" : {
"name": "colosseumapi",
"url": "http://52.21.93.224:9000/api",
"url": "http://52.210.93.224:9000/api",
"controller": "ColosseumController"
},
"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",
"router": "KairosRouter"
}
......
......@@ -98,5 +98,5 @@ if(isset($GLOBALS["return"]))
}
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
$scope.init(monitorInstance);
}
$scope.init = function(monitorInstance)
{
$scope.wait = false;
$scope.graphDetails = {};
$scope.graphDetails.monitorInstance = monitorInstance.id;
......@@ -79,7 +80,8 @@ crudControllers.controller('ChartsCtrl', function($scope,$interval,$http,ajaxFac
$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)
if($scope.wait == false)
{
$scope.wait = true;
$scope.error = false;
......@@ -93,7 +95,14 @@ crudControllers.controller('ChartsCtrl', function($scope,$interval,$http,ajaxFac
ajaxFactory.post("charts",$scope.graphDetails).then(function(data, status, headers, config)
{
//$scope.azara = data;
if(data &&data.queries)
{
$scope.data = getInfoChart(data.queries);
}
else
{
}
$scope.wait = false;
},
function(data, status, headers, config)
......@@ -101,8 +110,11 @@ crudControllers.controller('ChartsCtrl', function($scope,$interval,$http,ajaxFac
$scope.wait = false;
$scope.error = true;
});
}
};
$scope.interval = $interval($scope.change,10000);
$scope.$on("$destroy", function(){
$interval.cancel($scope.interval);
});
......
......@@ -46,6 +46,9 @@ crudFactories.factory('ajaxFactory', function ($http,$q,$rootScope,$location,res
$http(req)
.success(function(data, status)
{
console.log(url);
console.log(data);
console.log(status);
deferred.resolve(data);
resolverFactory.resolveSuccess(data, status);
})
......
......@@ -35,6 +35,7 @@ crudFactories.factory('resolverFactory', function ($rootScope,$location)
resolveError : function(data, status)
{
$rootScope.loading = false;
$rootScope.logged = false;
if(status==401)
{
$rootScope.logged = false;
......
......@@ -68,7 +68,7 @@
<div class="row">
<!-- ng class to col-12 -->
<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 ng-if="apiObjectHave('put')"
class="col-lg-3 col-xs-2 text-center no-padding td-button td-button-edit"
......@@ -81,8 +81,19 @@
</div>
</div>
</div>
<div class="panel-body">
<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-heading">
{{thing.id}} ( VMT : {{thing.virtualMachineTemplate}} )
......@@ -93,8 +104,13 @@
</div>
</div>
</div>
-->
</div>
</div>
</div>
</div>
......@@ -103,7 +119,7 @@
<div class="panel-heading" style="padding-top:0; padding-bottom:0;">
<div class="row">
<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 ng-if="apiObjectHave('put')"
class="col-lg-3 col-xs-2 text-center no-padding td-button td-button-edit"
......@@ -118,9 +134,9 @@
</div>
<div class="panel-body">
<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-heading">
<div class="panel-heading" >
Communication number {{communication.id}}
</div>
<div class="panel-body" style="min-height:40px;">
......@@ -133,7 +149,7 @@
<div ng-controller="emptyCtrl"
ng-init="
thing = item.applicationComponentsById[item.portProvs[communication.providedPort].applicationComponent];
thing.isCollapsed = true;
vmt_removable=false;
comp_removable=false;"
ng-include=" 'md-vmt.htm' ">
......@@ -199,13 +215,14 @@
<script type="text/ng-template" id="md-vmt.htm">
<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">
<!-- 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">VMT : {{thing.id}} </span>
<span ng-if="title===undefined">ApplicationComponent {{thing.id}} </span>
</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 data-original-title="delete" data-toggle="tooltip" data-placement="top" title="" tooltip="">
......@@ -214,9 +231,13 @@
</span>
</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 class="panel-body"
<div ng-show="thing.isCollapsed" class="panel-body"
ng-class="{ 'dotted-border' : thing.components.length == 0 }"
style="min-height:40px;"
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