Allow adding metric charts to home page

This commit is contained in:
cuigh
2018-03-26 20:44:42 +08:00
parent 10c70c8285
commit f4546d0888
16 changed files with 904 additions and 486 deletions

View File

@@ -21,17 +21,18 @@ type Chart struct {
Options data.Map `json:"options"`
}
func NewChart(name, title, label, query, unit string) *Chart {
func NewChart(dashboard, name, title, label, query, unit string) *Chart {
return &Chart{
Name: name,
Title: title,
Description: title,
Label: label,
Query: query,
Dashboard: dashboard,
Type: "line",
Unit: unit,
Width: 12,
Height: 50,
Height: 150,
}
}