updated report UI

Change-Id: I82bbccef6a6eaba56de21ab58fe561f649f42fb5
This commit is contained in:
sharonlucong 2015-01-12 12:13:56 -08:00
parent 3bf9d0c557
commit 28a5c69873
4 changed files with 27 additions and 26 deletions

View File

@ -2,7 +2,7 @@ define([
'angular',
'login',
'services',
// 'appDev',
// 'appDev',
'clusterList',
'cluster',
'monitoring',
@ -18,7 +18,7 @@ define([
var compassModule = ng.module('app', [
'compass.login',
'compass.services',
// 'compassAppDev',
// 'compassAppDev',
'compass.clusterlist',
'compass.cluster',
'compass.wizard',

View File

@ -2,18 +2,17 @@
<i class='class="ace-icon fa fa-spinner fa-spin bigger-300 orange'></i>
<span>loading...</span>
</div>
<div ng-if="showData" class="widget-box transparent" style = "border-radius: 7px;"ng-repeat="(categoryName, categoryValue) in categories">
<div ng-if="isTimeout" class="centerLoading">
<i class='class="ce-icon fa fa-times bigger-300 red'></i>
<span>Timeout Error</span>
</div>
<div ng-if="showData && !isTimeout" class="widget-box transparent" style = "border-radius: 7px;"ng-repeat="(categoryName, categoryValue) in categories">
<div class="widget-header">
<h4 class="widget-title">{{categoryName}}</h4>
</div>
<div class="widget-body">
<div class="widget-main">
<div class="panel-group" id="accordion" role="tablist" aria-multiselectable="true">
<div ng-if="isTimeout" class="centerLoading">
<i class='class="ce-icon fa fa-times bigger-300 red'></i>
<span>Timeout Error</span>
</div>
<span ng-if = "showData && !isTimeout">
<div class="panel panel-default" ng-repeat = "report in reports | filter: categoryName">
<div class="panel-heading" role="tab" id="headingOne">
@ -58,12 +57,12 @@
<td>
<span ng-if="detail.duration.summary.errors.count == 0">{{detail.duration.summary.errors.count}}</span>
<span ng-if="detail.duration.summary.errors.count!= 0">
<button id="popover" data-trigger="hover" style = "border-radius:20px!important" class="btn btn-xs btn-danger popover-hide"
<button id="popover" data-trigger="hover" style = "border-radius:20px!important" class="btn btn-xs btn-danger popover-hide"
title='{{detail.duration.summary.errors.details[0][0]}}'
type="button"
data-toggle="modal"
data-toggle="modal"
data-placement="right"
data-target="#{{createModalId(key,report.name)}}"
data-target="#{{createModalId(key,report.name)}}"
data-content='{{detail.duration.summary.errors.details[0][1]}}'>
{{detail.duration.summary.errors.count}}
</button>
@ -79,16 +78,16 @@
<div class="modal-body">
<table class="table">
<tr>
<td>Exception Type</td>
<td><strong>Exception Type</strong></td>
<td>{{detail.duration.summary.errors.details[0][0]}}</td>
</tr>
<tr>
<td>Exception Message</td>
<td><strong>Exception Message</strong></td>
<td>{{detail.duration.summary.errors.details[0][1]}}</td>
</tr>
<tr>
<td></td>
<td>{{detail.duration.summary.errors.details[0][2]}}</td>
<td><p ng-bind-html = "detail.duration.summary.errors.details[0][2] | nl2br"></p></td>
</tr>
</table>
</div>

View File

@ -74,7 +74,7 @@ define(['angular'], function() {
$scope.details = {};
$scope.modalId = {};
$scope.errorActions = {};
var pormise;
var promise;
var progressTimer;
var fireTimer = true;
$scope.notFinished = true;
@ -103,10 +103,7 @@ define(['angular'], function() {
if(!isEmpty(data)){
$scope.reports = data;
$scope.showData = true;
$scope.$on('$destroy', function(){
$timeout.cancel(promise);
});
$timeout.cancel(promise);
angular.forEach(data, function(dt){
if(!isEmpty($scope.categories) && !isEmpty($scope.categories[dt.category])){
$scope.categories[dt.category].push(dt.name);
@ -114,7 +111,7 @@ define(['angular'], function() {
else{
$scope.categories[dt.category] = [];
$scope.categories[dt.category].push(dt.name);
}
}
});
var getClusterReport= function(){
@ -129,13 +126,13 @@ define(['angular'], function() {
$scope.modalId[i+rd.name] = str.replace(".","-");
$scope.createModalId = function(action,name){
return $scope.modalId[action+name];
};
};
}
$scope.reportStates[rd.name] = dt.state;
}
else{
$scope.reportStates[rd.name] = dt.state;
$scope.showDetails = false;
$scope.showDetails = false;
$timeout(getResults,2000);
}
});
@ -143,7 +140,7 @@ define(['angular'], function() {
getResults();
}
});
if(fireTimer){
if(fireTimer){
progressTimer = $timeout(getClusterReport, 3000);
};
}
@ -154,17 +151,23 @@ define(['angular'], function() {
});
}
else{
pormise = $timeout(timeoutAlert,600000);
promise = $timeout(timeoutAlert,600000);
$timeout(getAllReports,2000);
$scope.showData = false;
}
});
}
}
getAllReports();
});
clusterModule.filter('nl2br', function($sce){
return function(text) {
return text ? $sce.trustAsHtml(text.replace(/\n/g, '<br/>')) : '';
};
});
clusterModule.controller('clusterCtrl', function($scope, $state, dataService, $stateParams) {
$scope.clusterId = $stateParams.id;

View File

@ -41,7 +41,6 @@ define(['uiRouter'], function() {
loginModule.directive('setFocus', function() {
return function(scope, element) {
console.log(element);
element[0].focus();
};
});