Commit 29f6283e by Torkel Ödegaard

Merge branch 'master' into external-plugins

parents 4a69de1f 396f53d2
...@@ -43,6 +43,8 @@ func NewDashboard(title string) *Dashboard { ...@@ -43,6 +43,8 @@ func NewDashboard(title string) *Dashboard {
dash.Data = make(map[string]interface{}) dash.Data = make(map[string]interface{})
dash.Data["title"] = title dash.Data["title"] = title
dash.Title = title dash.Title = title
dash.Created = time.Now()
dash.Updated = time.Now()
dash.UpdateSlug() dash.UpdateSlug()
return dash return dash
} }
...@@ -73,9 +75,12 @@ func NewDashboardFromJson(data map[string]interface{}) *Dashboard { ...@@ -73,9 +75,12 @@ func NewDashboardFromJson(data map[string]interface{}) *Dashboard {
if dash.Data["version"] != nil { if dash.Data["version"] != nil {
dash.Version = int(dash.Data["version"].(float64)) dash.Version = int(dash.Data["version"].(float64))
dash.Updated = time.Now()
} }
} else { } else {
dash.Data["version"] = 0 dash.Data["version"] = 0
dash.Created = time.Now()
dash.Updated = time.Now()
} }
return dash return dash
......
...@@ -443,7 +443,7 @@ describe('ElasticResponse', function() { ...@@ -443,7 +443,7 @@ describe('ElasticResponse', function() {
result = new ElasticResponse(targets, response).getTimeSeries(); result = new ElasticResponse(targets, response).getTimeSeries();
}); });
it.only('should return table', function() { it('should return table', function() {
expect(result.data.length).to.be(1); expect(result.data.length).to.be(1);
expect(result.data[0].type).to.be('docs'); expect(result.data[0].type).to.be('docs');
expect(result.data[0].datapoints.length).to.be(2); expect(result.data[0].datapoints.length).to.be(2);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment