diff --git a/.gitignore b/.gitignore
index 9b10a1b..cfc5a8c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,4 @@
gin-bin
mondash
+
+*.sh
diff --git a/structs.go b/structs.go
index ea9d295..df78bbd 100644
--- a/structs.go
+++ b/structs.go
@@ -120,11 +120,11 @@ func (dm *dashboardMetric) Update(m *dashboardMetric) {
if m.Freshness != 0 {
dm.Freshness = m.Freshness
}
- dm.HistoricalData = append(dashboardMetricHistory{dashboardMetricStatus{
+ dm.HistoricalData = append(dm.HistoricalData, dashboardMetricStatus{
Time: time.Now(),
Status: m.Status,
Value: m.Value,
- }}, dm.HistoricalData...)
+ })
countStatus := make(map[string]float64)
diff --git a/templates/dashboard.html b/templates/dashboard.html
index f6c51c2..90414e5 100644
--- a/templates/dashboard.html
+++ b/templates/dashboard.html
@@ -13,6 +13,20 @@
+
@@ -91,6 +105,10 @@
]
};
+ for (var i = 0; i < data.labels.length; i++) {
+ data.labels[i] = timeConverter(data.labels[i]);
+ }
+
new Chartist.Line('.{{metric.MetricID}}', data);