Browse Source

Fix the server-graphs

They did not display anything if it was the first of the month. Plus some style-fixes.
tags/2.2.0RC2
Safihre 8 years ago
parent
commit
28d4f527b8
  1. 9
      interfaces/Config/templates/config_server.tmpl
  2. 9
      interfaces/Config/templates/staticcfg/css/style.css

9
interfaces/Config/templates/config_server.tmpl

@ -116,7 +116,7 @@
var serverData = {}
var chartOptions = {
fullWidth: true,
showPoint: false,
showArea: true,
axisX: {
labelOffset: {
x: -5
@ -149,7 +149,7 @@
<!--#set min_date = datetime.date.today()#-->
<!--#for date in $server['amounts'][4]#-->
<!--#set split_date = $date.split('-')#-->
<!--#set min_date = min(min_date, datetime.date(int(split_date[0]), int(split_date[1]), int(split_date[2])))#-->
<!--#set min_date = min(min_date, datetime.date(int(split_date[0]), int(split_date[1]), 1))#-->
<!--#end for#-->
<!--#set months_recorded = int((datetime.date.today()-min_date).days / (365/12))#-->
<select class="chart-selector" name="chart-selector-${id}" id="chart-selector-${id}" data-id="${id}">
@ -378,15 +378,16 @@
// Show the chart
chart = new Chartist.Line('#server-chart-'+server_id, data, chartOptions);
chart.on('created', function(context) {
// Make sure to add this as the first child so it's at the bottom
context.svg.elem('rect', {
x: context.chartRect.x1,
y: context.chartRect.y2,
y: context.chartRect.y2-1,
width: context.chartRect.width(),
height: context.chartRect.height()+2,
fill: 'none',
stroke: '#B9B9B9',
'stroke-width': '1px'
})
}, '', context.svg, true)
\$('#server-chart-'+server_id+' .ct-label.ct-vertical').each(function(index, elmn) {
elmn.innerHTML += axisLabel
})

9
interfaces/Config/templates/staticcfg/css/style.css

@ -1010,6 +1010,15 @@ input[type="checkbox"] {
stroke: #666666;
}
.Servers .ct-series-a .ct-point {
stroke: #666666;
stroke-width: 4px;
}
.Servers .ct-series-a .ct-area {
fill: #666666
}
.Servers .ct-label {
font-size: 1em;
color: black;

Loading…
Cancel
Save