diff --git a/bolt/internal/internal.go b/bolt/internal/internal.go index 8d79dde745..e64dc6264c 100644 --- a/bolt/internal/internal.go +++ b/bolt/internal/internal.go @@ -199,6 +199,17 @@ func MarshalDashboard(d chronograf.Dashboard) ([]byte, error) { } } + colors := make([]*Color, len(c.CellColors)) + for j, color := range c.CellColors { + colors[j] = &Color{ + ID: color.ID, + Type: color.Type, + Hex: color.Hex, + Name: color.Name, + Value: color.Value, + } + } + axes := make(map[string]*Axis, len(c.Axes)) for a, r := range c.Axes { axes[a] = &Axis{ @@ -221,6 +232,7 @@ func MarshalDashboard(d chronograf.Dashboard) ([]byte, error) { Queries: queries, Type: c.Type, Axes: axes, + Colors: colors, } } templates := make([]*Template, len(d.Templates)) @@ -285,6 +297,17 @@ func UnmarshalDashboard(data []byte, d *chronograf.Dashboard) error { } } + colors := make([]chronograf.CellColor, len(c.Colors)) + for j, color := range c.Colors { + colors[j] = chronograf.CellColor{ + ID: color.ID, + Type: color.Type, + Hex: color.Hex, + Name: color.Name, + Value: color.Value, + } + } + axes := make(map[string]chronograf.Axis, len(c.Axes)) for a, r := range c.Axes { // axis base defaults to 10 @@ -316,15 +339,16 @@ func UnmarshalDashboard(data []byte, d *chronograf.Dashboard) error { } cells[i] = chronograf.DashboardCell{ - ID: c.ID, - X: c.X, - Y: c.Y, - W: c.W, - H: c.H, - Name: c.Name, - Queries: queries, - Type: c.Type, - Axes: axes, + ID: c.ID, + X: c.X, + Y: c.Y, + W: c.W, + H: c.H, + Name: c.Name, + Queries: queries, + Type: c.Type, + Axes: axes, + CellColors: colors, } } @@ -434,8 +458,5 @@ func UnmarshalUser(data []byte, u *chronograf.User) error { // UnmarshalUserPB decodes a user from binary protobuf data. // We are ignoring the password for now. func UnmarshalUserPB(data []byte, u *User) error { - if err := proto.Unmarshal(data, u); err != nil { - return err - } - return nil + return proto.Unmarshal(data, u) } diff --git a/bolt/internal/internal.pb.go b/bolt/internal/internal.pb.go index 02d757fdc9..e5704af71e 100644 --- a/bolt/internal/internal.pb.go +++ b/bolt/internal/internal.pb.go @@ -12,6 +12,7 @@ It has these top-level messages: Source Dashboard DashboardCell + Color Axis Template TemplateValue @@ -96,6 +97,7 @@ type DashboardCell struct { Type string `protobuf:"bytes,7,opt,name=type,proto3" json:"type,omitempty"` ID string `protobuf:"bytes,8,opt,name=ID,proto3" json:"ID,omitempty"` Axes map[string]*Axis `protobuf:"bytes,9,rep,name=axes" json:"axes,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value"` + Colors []*Color `protobuf:"bytes,10,rep,name=colors" json:"colors,omitempty"` } func (m *DashboardCell) Reset() { *m = DashboardCell{} } @@ -117,6 +119,26 @@ func (m *DashboardCell) GetAxes() map[string]*Axis { return nil } +func (m *DashboardCell) GetColors() []*Color { + if m != nil { + return m.Colors + } + return nil +} + +type Color struct { + ID string `protobuf:"bytes,1,opt,name=ID,proto3" json:"ID,omitempty"` + Type string `protobuf:"bytes,2,opt,name=Type,proto3" json:"Type,omitempty"` + Hex string `protobuf:"bytes,3,opt,name=Hex,proto3" json:"Hex,omitempty"` + Name string `protobuf:"bytes,4,opt,name=Name,proto3" json:"Name,omitempty"` + Value string `protobuf:"bytes,5,opt,name=Value,proto3" json:"Value,omitempty"` +} + +func (m *Color) Reset() { *m = Color{} } +func (m *Color) String() string { return proto.CompactTextString(m) } +func (*Color) ProtoMessage() {} +func (*Color) Descriptor() ([]byte, []int) { return fileDescriptorInternal, []int{3} } + type Axis struct { LegacyBounds []int64 `protobuf:"varint,1,rep,name=legacyBounds" json:"legacyBounds,omitempty"` Bounds []string `protobuf:"bytes,2,rep,name=bounds" json:"bounds,omitempty"` @@ -130,7 +152,7 @@ type Axis struct { func (m *Axis) Reset() { *m = Axis{} } func (m *Axis) String() string { return proto.CompactTextString(m) } func (*Axis) ProtoMessage() {} -func (*Axis) Descriptor() ([]byte, []int) { return fileDescriptorInternal, []int{3} } +func (*Axis) Descriptor() ([]byte, []int) { return fileDescriptorInternal, []int{4} } type Template struct { ID string `protobuf:"bytes,1,opt,name=ID,proto3" json:"ID,omitempty"` @@ -144,7 +166,7 @@ type Template struct { func (m *Template) Reset() { *m = Template{} } func (m *Template) String() string { return proto.CompactTextString(m) } func (*Template) ProtoMessage() {} -func (*Template) Descriptor() ([]byte, []int) { return fileDescriptorInternal, []int{4} } +func (*Template) Descriptor() ([]byte, []int) { return fileDescriptorInternal, []int{5} } func (m *Template) GetValues() []*TemplateValue { if m != nil { @@ -169,7 +191,7 @@ type TemplateValue struct { func (m *TemplateValue) Reset() { *m = TemplateValue{} } func (m *TemplateValue) String() string { return proto.CompactTextString(m) } func (*TemplateValue) ProtoMessage() {} -func (*TemplateValue) Descriptor() ([]byte, []int) { return fileDescriptorInternal, []int{5} } +func (*TemplateValue) Descriptor() ([]byte, []int) { return fileDescriptorInternal, []int{6} } type TemplateQuery struct { Command string `protobuf:"bytes,1,opt,name=command,proto3" json:"command,omitempty"` @@ -183,7 +205,7 @@ type TemplateQuery struct { func (m *TemplateQuery) Reset() { *m = TemplateQuery{} } func (m *TemplateQuery) String() string { return proto.CompactTextString(m) } func (*TemplateQuery) ProtoMessage() {} -func (*TemplateQuery) Descriptor() ([]byte, []int) { return fileDescriptorInternal, []int{6} } +func (*TemplateQuery) Descriptor() ([]byte, []int) { return fileDescriptorInternal, []int{7} } type Server struct { ID int64 `protobuf:"varint,1,opt,name=ID,proto3" json:"ID,omitempty"` @@ -198,7 +220,7 @@ type Server struct { func (m *Server) Reset() { *m = Server{} } func (m *Server) String() string { return proto.CompactTextString(m) } func (*Server) ProtoMessage() {} -func (*Server) Descriptor() ([]byte, []int) { return fileDescriptorInternal, []int{7} } +func (*Server) Descriptor() ([]byte, []int) { return fileDescriptorInternal, []int{8} } type Layout struct { ID string `protobuf:"bytes,1,opt,name=ID,proto3" json:"ID,omitempty"` @@ -211,7 +233,7 @@ type Layout struct { func (m *Layout) Reset() { *m = Layout{} } func (m *Layout) String() string { return proto.CompactTextString(m) } func (*Layout) ProtoMessage() {} -func (*Layout) Descriptor() ([]byte, []int) { return fileDescriptorInternal, []int{8} } +func (*Layout) Descriptor() ([]byte, []int) { return fileDescriptorInternal, []int{9} } func (m *Layout) GetCells() []*Cell { if m != nil { @@ -237,7 +259,7 @@ type Cell struct { func (m *Cell) Reset() { *m = Cell{} } func (m *Cell) String() string { return proto.CompactTextString(m) } func (*Cell) ProtoMessage() {} -func (*Cell) Descriptor() ([]byte, []int) { return fileDescriptorInternal, []int{9} } +func (*Cell) Descriptor() ([]byte, []int) { return fileDescriptorInternal, []int{10} } func (m *Cell) GetQueries() []*Query { if m != nil { @@ -267,7 +289,7 @@ type Query struct { func (m *Query) Reset() { *m = Query{} } func (m *Query) String() string { return proto.CompactTextString(m) } func (*Query) ProtoMessage() {} -func (*Query) Descriptor() ([]byte, []int) { return fileDescriptorInternal, []int{10} } +func (*Query) Descriptor() ([]byte, []int) { return fileDescriptorInternal, []int{11} } func (m *Query) GetRange() *Range { if m != nil { @@ -284,7 +306,7 @@ type Range struct { func (m *Range) Reset() { *m = Range{} } func (m *Range) String() string { return proto.CompactTextString(m) } func (*Range) ProtoMessage() {} -func (*Range) Descriptor() ([]byte, []int) { return fileDescriptorInternal, []int{11} } +func (*Range) Descriptor() ([]byte, []int) { return fileDescriptorInternal, []int{12} } type AlertRule struct { ID string `protobuf:"bytes,1,opt,name=ID,proto3" json:"ID,omitempty"` @@ -296,7 +318,7 @@ type AlertRule struct { func (m *AlertRule) Reset() { *m = AlertRule{} } func (m *AlertRule) String() string { return proto.CompactTextString(m) } func (*AlertRule) ProtoMessage() {} -func (*AlertRule) Descriptor() ([]byte, []int) { return fileDescriptorInternal, []int{12} } +func (*AlertRule) Descriptor() ([]byte, []int) { return fileDescriptorInternal, []int{13} } type User struct { ID uint64 `protobuf:"varint,1,opt,name=ID,proto3" json:"ID,omitempty"` @@ -306,12 +328,13 @@ type User struct { func (m *User) Reset() { *m = User{} } func (m *User) String() string { return proto.CompactTextString(m) } func (*User) ProtoMessage() {} -func (*User) Descriptor() ([]byte, []int) { return fileDescriptorInternal, []int{13} } +func (*User) Descriptor() ([]byte, []int) { return fileDescriptorInternal, []int{14} } func init() { proto.RegisterType((*Source)(nil), "internal.Source") proto.RegisterType((*Dashboard)(nil), "internal.Dashboard") proto.RegisterType((*DashboardCell)(nil), "internal.DashboardCell") + proto.RegisterType((*Color)(nil), "internal.Color") proto.RegisterType((*Axis)(nil), "internal.Axis") proto.RegisterType((*Template)(nil), "internal.Template") proto.RegisterType((*TemplateValue)(nil), "internal.TemplateValue") @@ -328,70 +351,73 @@ func init() { func init() { proto.RegisterFile("internal.proto", fileDescriptorInternal) } var fileDescriptorInternal = []byte{ - // 1028 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xbc, 0x56, 0x4f, 0x6f, 0xe3, 0x44, - 0x14, 0xd7, 0xf8, 0x4f, 0x12, 0xbf, 0x74, 0x0b, 0x1a, 0xad, 0x58, 0xb3, 0x5c, 0x82, 0x05, 0x52, - 0x40, 0x6c, 0x41, 0xbb, 0x42, 0x42, 0xdc, 0xd2, 0x06, 0xad, 0x4a, 0xbb, 0x4b, 0x99, 0xb4, 0xe5, - 0x84, 0x56, 0x13, 0xe7, 0xa5, 0xb5, 0xd6, 0x89, 0xcd, 0xd8, 0x6e, 0xe3, 0x6f, 0xc1, 0x27, 0x40, - 0x42, 0xe2, 0xc4, 0x81, 0x03, 0x5f, 0x80, 0xfb, 0x7e, 0x2a, 0xf4, 0x66, 0xc6, 0x8e, 0xc3, 0x76, - 0xd1, 0x5e, 0xe0, 0x36, 0xbf, 0xf7, 0xc6, 0x6f, 0x66, 0xde, 0xef, 0xfd, 0x7e, 0x09, 0xec, 0x27, - 0xeb, 0x12, 0xd5, 0x5a, 0xa6, 0x07, 0xb9, 0xca, 0xca, 0x8c, 0x0f, 0x1a, 0x1c, 0xfd, 0xe1, 0x40, - 0x6f, 0x96, 0x55, 0x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 0x93, 0x0b, 0x44, 0x03, 0xdb, 0x99, 0x87, - 0xce, 0xcc, 0x7f, 0x66, 0xfd, 0x70, 0xa8, 0x6f, 0x14, 0xee, 0xb6, 0xe5, 0xbf, 0xb3, 0xc1, 0x57, - 0x0c, 0xfc, 0x56, 0x30, 0x47, 0xbb, 0x82, 0x39, 0xda, 0x0a, 0x66, 0x7a, 0xd8, 0x08, 0x66, 0x7a, - 0x48, 0x58, 0x9c, 0x35, 0x82, 0x11, 0x67, 0x44, 0xd6, 0x53, 0x95, 0x55, 0xf9, 0x61, 0x6d, 0x58, - 0x0d, 0x44, 0x8b, 0x69, 0xca, 0x7e, 0xb8, 0x46, 0x65, 0x5b, 0x1d, 0x08, 0x8b, 0x68, 0x26, 0x4f, - 0xb5, 0x99, 0x98, 0xe6, 0x1a, 0xc0, 0x3f, 0x06, 0x5f, 0x50, 0xf3, 0x74, 0x87, 0x77, 0x78, 0xd1, - 0x61, 0x61, 0xb2, 0x54, 0xd4, 0xfc, 0x57, 0xb1, 0xbf, 0x27, 0x16, 0x45, 0x4f, 0xec, 0xe7, 0x54, - 0xfd, 0x22, 0xcf, 0x51, 0x59, 0x89, 0x19, 0xa0, 0xcf, 0xcc, 0x6e, 0xd1, 0xb8, 0xa3, 0x2b, 0x0c, - 0x88, 0x7e, 0x84, 0x60, 0x92, 0xa2, 0x2a, 0x45, 0x95, 0xbe, 0xee, 0xa9, 0x1c, 0xbc, 0x6f, 0x67, - 0xdf, 0x3d, 0x6f, 0x84, 0x49, 0xeb, 0xad, 0x9c, 0xdc, 0x7f, 0xc8, 0xe9, 0x44, 0xe6, 0xf2, 0x78, - 0xaa, 0xe7, 0xcc, 0x15, 0x16, 0x45, 0x9f, 0x82, 0x47, 0xb2, 0xed, 0x54, 0xf6, 0xde, 0x24, 0xf9, - 0x79, 0x4f, 0xff, 0x2b, 0x7b, 0xf2, 0x77, 0x00, 0x00, 0x00, 0xff, 0xff, 0xb7, 0x59, 0x2e, 0xc0, - 0xa7, 0x09, 0x00, 0x00, + // 1080 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xbc, 0x56, 0x51, 0x8f, 0xdb, 0x44, + 0x10, 0xd6, 0xc6, 0x76, 0x12, 0x4f, 0xda, 0xa3, 0x5a, 0x55, 0xd4, 0x94, 0x97, 0x60, 0x81, 0x08, + 0x88, 0x1e, 0xa8, 0x15, 0x12, 0xe2, 0x2d, 0x77, 0x41, 0xe5, 0xb8, 0x6b, 0x39, 0x36, 0x77, 0xc7, + 0x13, 0xaa, 0x36, 0xce, 0x24, 0x67, 0xd5, 0x89, 0xcd, 0xda, 0xbe, 0x8b, 0xff, 0x05, 0xbf, 0x00, + 0x09, 0x89, 0x67, 0x1e, 0xf8, 0x03, 0xbc, 0xf7, 0x95, 0x3f, 0x84, 0x66, 0x77, 0xed, 0x38, 0xd7, + 0x2b, 0xea, 0x03, 0xe2, 0x6d, 0xbf, 0x99, 0xf5, 0xcc, 0xec, 0xcc, 0x37, 0x5f, 0x02, 0x7b, 0xf1, + 0xba, 0x40, 0xb5, 0x96, 0xc9, 0x7e, 0xa6, 0xd2, 0x22, 0xe5, 0xfd, 0x1a, 0x87, 0x7f, 0x74, 0xa0, + 0x3b, 0x4d, 0x4b, 0x15, 0x21, 0xdf, 0x83, 0xce, 0xd1, 0x24, 0x60, 0x43, 0x36, 0x72, 0x44, 0xe7, + 0x68, 0xc2, 0x39, 0xb8, 0xcf, 0xe5, 0x0a, 0x83, 0xce, 0x90, 0x8d, 0x7c, 0xa1, 0xcf, 0x64, 0x3b, + 0xab, 0x32, 0x0c, 0x1c, 0x63, 0xa3, 0x33, 0x7f, 0x08, 0xfd, 0xf3, 0x9c, 0xa2, 0xad, 0x30, 0x70, + 0xb5, 0xbd, 0xc1, 0xe4, 0x3b, 0x95, 0x79, 0x7e, 0x9d, 0xaa, 0x79, 0xe0, 0x19, 0x5f, 0x8d, 0xf9, + 0x3d,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, 0x8a, 0x82, 0xdd, 0xb6, 0xdc, 0x14, 0xe6, + 0xff, 0x4e, 0x6f, 0x5f, 0x31, 0xf0, 0x9a, 0x85, 0x39, 0xdc, 0x5d, 0x98, 0xc3, 0xed, 0xc2, 0x4c, + 0x0e, 0xea, 0x85, 0x99, 0x1c, 0x10, 0x16, 0xa7, 0xf5, 0xc2, 0x88, 0x53, 0x1a, 0xd6, 0x53, 0x95, + 0x96, 0xd9, 0x41, 0x65, 0xa6, 0xea, 0x8b, 0x06, 0x13, 0xcb, 0x7e, 0xbc, 0x44, 0x65, 0x5b, 0xed, + 0x0b, 0x8b, 0x88, 0x93, 0x27, 0x5a, 0x4c, 0x4c, 0x73, 0x0d, 0xe0, 0x1f, 0x81, 0x27, 0xa8, 0x79, + 0xba, 0xc3, 0x3b, 0x73, 0xd1, 0x66, 0x61, 0xbc, 0x14, 0xd4, 0xfc, 0x7b, 0xb2, 0xbf, 0x70, 0x16, + 0x85, 0x4f, 0xec, 0xe7, 0x14, 0xfd, 0x3c, 0xcb, 0x50, 0xd9, 0x15, 0x33, 0x40, 0xe7, 0x4c, 0xaf, + 0xd1, 0xa8, 0xa3, 0x23, 0x0c, 0x08, 0x7f, 0x02, 0x7f, 0x9c, 0xa0, 0x2a, 0x44, 0x99, 0xe0, 0x6d, + 0xbf, 0x3a, 0xdf, 0x4d, 0xbf, 0x7f, 0x5e, 0x2f, 0x26, 0x9d, 0xb7, 0xeb, 0xe4, 0xdc, 0x58, 0xa7, + 0x63, 0x99, 0xc9, 0xa3, 0x89, 0xe6, 0x99, 0x23, 0x2c, 0x0a, 0x3f, 0x05, 0x97, 0xd6, 0xb6, 0x15, + 0xd9, 0x7d, 0xd3, 0xca, 0xcf, 0xba, 0xfa, 0x7f, 0xe2, 0x93, 0x7f, 0x02, 0x00, 0x00, 0xff, 0xff, + 0xc2, 0x18, 0x1c, 0xbe, 0x39, 0x0a, 0x00, 0x00, } diff --git a/bolt/internal/internal.proto b/bolt/internal/internal.proto index 9cd762d39d..ef37ceea60 100644 --- a/bolt/internal/internal.proto +++ b/bolt/internal/internal.proto @@ -23,15 +23,24 @@ message Dashboard { } message DashboardCell { - int32 x = 1; // X-coordinate of Cell in the Dashboard - int32 y = 2; // Y-coordinate of Cell in the Dashboard - int32 w = 3; // Width of Cell in the Dashboard - int32 h = 4; // Height of Cell in the Dashboard - repeated Query queries = 5; // Time-series data queries for Dashboard - string name = 6; // User-facing name for this Dashboard - string type = 7; // Dashboard visualization type - string ID = 8; // id is the unique id of the dashboard. MIGRATED FIELD added in 1.2.0-beta6 - map<string, Axis> axes = 9; // Axes represent the graphical viewport for a cell's visualizations + int32 x = 1; // X-coordinate of Cell in the Dashboard + int32 y = 2; // Y-coordinate of Cell in the Dashboard + int32 w = 3; // Width of Cell in the Dashboard + int32 h = 4; // Height of Cell in the Dashboard + repeated Query queries = 5; // Time-series data queries for Dashboard + string name = 6; // User-facing name for this Dashboard + string type = 7; // Dashboard visualization type + string ID = 8; // id is the unique id of the dashboard. MIGRATED FIELD added in 1.2.0-beta6 + map<string, Axis> axes = 9; // Axes represent the graphical viewport for a cell's visualizations + repeated Color colors = 10; // Colors represent encoding data values to color +} + +message Color { + string ID = 1; // ID is the unique id of the cell color + string Type = 2; // Type is how the color is used. Accepted (min,max,threshold) + string Hex = 3; // Hex is the hex number of the color + string Name = 4; // Name is the user-facing name of the hex color + string Value = 5; // Value is the data value mapped to this color } message Axis { diff --git a/bolt/internal/internal_test.go b/bolt/internal/internal_test.go index 244dd471cb..562dc004df 100644 --- a/bolt/internal/internal_test.go +++ b/bolt/internal/internal_test.go @@ -176,6 +176,22 @@ func Test_MarshalDashboard(t *testing.T) { }, }, Type: "line", + CellColors: []chronograf.CellColor{ + { + ID: "myid", + Type: "min", + Hex: "#234567", + Name: "Laser", + Value: "0", + }, + { + ID: "id2", + Type: "max", + Hex: "#876543", + Name: "Solitude", + Value: "100", + }, + }, }, }, Templates: []chronograf.Template{}, @@ -217,6 +233,22 @@ func Test_MarshalDashboard_WithLegacyBounds(t *testing.T) { LegacyBounds: [2]int64{0, 5}, }, }, + CellColors: []chronograf.CellColor{ + { + ID: "myid", + Type: "min", + Hex: "#234567", + Name: "Laser", + Value: "0", + }, + { + ID: "id2", + Type: "max", + Hex: "#876543", + Name: "Solitude", + Value: "100", + }, + }, Type: "line", }, }, @@ -250,6 +282,22 @@ func Test_MarshalDashboard_WithLegacyBounds(t *testing.T) { Scale: "linear", }, }, + CellColors: []chronograf.CellColor{ + { + ID: "myid", + Type: "min", + Hex: "#234567", + Name: "Laser", + Value: "0", + }, + { + ID: "id2", + Type: "max", + Hex: "#876543", + Name: "Solitude", + Value: "100", + }, + }, Type: "line", }, }, @@ -292,6 +340,22 @@ func Test_MarshalDashboard_WithEmptyLegacyBounds(t *testing.T) { LegacyBounds: [2]int64{}, }, }, + CellColors: []chronograf.CellColor{ + { + ID: "myid", + Type: "min", + Hex: "#234567", + Name: "Laser", + Value: "0", + }, + { + ID: "id2", + Type: "max", + Hex: "#876543", + Name: "Solitude", + Value: "100", + }, + }, Type: "line", }, }, @@ -325,6 +389,22 @@ func Test_MarshalDashboard_WithEmptyLegacyBounds(t *testing.T) { Scale: "linear", }, }, + CellColors: []chronograf.CellColor{ + { + ID: "myid", + Type: "min", + Hex: "#234567", + Name: "Laser", + Value: "0", + }, + { + ID: "id2", + Type: "max", + Hex: "#876543", + Name: "Solitude", + Value: "100", + }, + }, Type: "line", }, },