Merge "add id to metics node"

This commit is contained in:
Jenkins 2014-10-25 01:19:20 +00:00 committed by Gerrit Code Review
commit 3ad1a4e8d2
4 changed files with 33 additions and 7 deletions

View File

@ -2,7 +2,7 @@ define([
'angular',
'login',
'services',
//'appDev',
// 'appDev',
'clusterList',
'cluster',
'monitoring',

File diff suppressed because one or more lines are too long

View File

@ -113,7 +113,33 @@ define(['angularAnimate', 'angularUiTree', 'nvd3Directive','ngSpinner'], functio
$scope.clickedHashTable = {};
$scope.metricsTree = [];
$scope.loading = 0;
dataPreprocessing = function(data,name){
angular.forEach(data.nodes,function(node){
if(node.nodes.length == 0)
{
var start = 0;
if((start = node.title.indexOf("(")) > -1)
{
var end = node.title.indexOf(")");
var insideWord = node.title.substring(start+1,end);
node.id = name +"."+node.title.substring(0,start-1)+"."+insideWord;
// console.log(node.title);
}
else
{
node.id = name+"."+node.title;
}
return;
}
dataPreprocessing(node,name+"."+node.title);
})
}
dataService.monitorMetricsTree().success(function(data) {
angular.forEach(data,function(node){
dataPreprocessing(node,node.title);
});
$scope.metricsTree = data;
$scope.loading++;
}).error(function(response) {

View File

@ -1,5 +1,5 @@
<div class="chosen-container chosen-container-multi" style="width: 100%;" title="">
<ul class="chosen-choices">
<ul class="chosen-choices" style="overflow-x:auto;">
<li class="btn btn-info search-choice" ng-repeat=" data in metricsDataKey" ng-click="removeSelected(this)">
<span>{{data}}</span>
<a class="search-choice-close" data-option-array-index="{{data}}"></a>
@ -10,9 +10,9 @@
</ul>
<div class="chosen-drop">
<ul class="chosen-results">
<li ng-repeat = "name in filtered = (names |filter: searchText)|limitTo: 1000" ng-class="{ 'active-result':metricsDataKey.indexOf(name) < 0,'result-selected': metricsDataKey.indexOf(name) >= 0}" data-option-array-index="{{name}}">{{name}}</li>
<li ng-if="filtered.length > 1000" class="result-selected" style="background-color:blue;">Showing the first 1000/{{filtered.length}} records</li>
<li ng-if="filtered.length <= 1000" class="result-selected" style="background-color:blue;">Showing {{filtered.length}} records</li>
<li ng-repeat = "name in filtered = (names |filter: searchText)|limitTo: 200" ng-class="{ 'active-result':metricsDataKey.indexOf(name) < 0,'result-selected': metricsDataKey.indexOf(name) >= 0}" data-option-array-index="{{name}}">{{name}}</li>
<li ng-if="filtered.length > 200" class="result-selected" style="background-color:blue;">Showing the first 200/{{filtered.length}} records</li>
<li ng-if="filtered.length <= 200" class="result-selected" style="background-color:blue;">Showing {{filtered.length}} records</li>
</ul>
</div>
</div>