[Status] Some code cleanup, added server less to watch adnd less, adjsted some css for proper display, updated code to work again

This commit is contained in:
Khalah Jones-Golden 2015-06-25 11:12:18 -04:00
parent 270cd5c659
commit 61193f893c
6 changed files with 17 additions and 16 deletions

View file

@ -44,7 +44,7 @@ module.exports = function (grunt) {
'<%= src %>/kibana/components/*/*.less',
'<%= src %>/kibana/styles/main.less',
'<%= src %>/kibana/components/vislib/styles/main.less',
'<%= src %>/hapi/plugins/status/styles/main.less',
'<%= src %>/server/plugins/status/public/styles/main.less',
'<%= plugins %>/dashboard/styles/main.less',
'<%= plugins %>/discover/styles/main.less',
'<%= plugins %>/settings/styles/main.less',

View file

@ -53,6 +53,7 @@
},
"devDependencies": {},
"resolutions": {
"angular": "1.2.28"
"angular": "1.2.28",
"d3": "3.5.5"
}
}

View file

@ -42,10 +42,10 @@
<p>Interval of 5 seconds, with a max history of 5 minutes.</p>
<div id="chart_cont" class="row">
<div ng-repeat="(key, chart) in ui.charts" class="status_chart_wrapper col-md-4">
<h2 class="title">{{chart.niceName}}</h2>
<h1 class="average">
<h3 class="title">{{chart.niceName}}</h2>
<h4 class="average">
<span ng-repeat="average in chart.average track by $index"><span ng-if="$index">, </span>{{average}}</span>
</h1>
</h4>
<nvd3 options="chart.options" data="chart.data"></nvd3>
</div>
<div class="clearfix"></div>

View file

@ -124,11 +124,8 @@ window.define(['angular', 'jquery', 'lodash', 'moment', 'numeral', 'nvd3_directi
return getStatus(status);
};
}()),
charts: [],
plugins: [],
chartAverages: [],
chartOptions: {
}
charts: {},
plugins: []
};
var windowHasFocus = true;
@ -165,16 +162,18 @@ window.define(['angular', 'jquery', 'lodash', 'moment', 'numeral', 'nvd3_directi
var metricList = [];
var metricNumberType = numberType(name);
// convert the [x,y] into {x: x, y: y}
metric.forEach(function (vector) {
var _vector = _(vector).flatten();
var x = _vector.shift();
_vector.forEach(function (yValue, idx) {
vector = _.flatten(vector);
var x = vector.shift();
vector.forEach(function (yValue, idx) {
if (!metricList[idx]) {
metricList[idx] = {
key: name + idx,
values: []
};
}
// unshift to make sure they're in the correct order
metricList[idx].values.unshift({x: x, y: yValue});
});
});

View file

@ -84,8 +84,8 @@
border-top:1px solid #ebebeb;
border-left:1px solid #ebebeb;
.average {
font-size:51px;
line-height:48px;
font-size: 42px;
line-height:45px;
margin-top:0;
font-weight:bold;
}

View file

@ -6,7 +6,8 @@ module.exports = function (grunt) {
'<%= plugins %>/*/styles/**/*.less',
'<%= plugins %>/*/*.less',
'<%= app %>/**/components/**/*.less',
'<%= app %>/**/components/vislib/components/styles/**/*.less'
'<%= app %>/**/components/vislib/components/styles/**/*.less',
'<%= src %>/server/plugins/status/public/styles/**/*.less'
],
tasks: ['less:dev']
},