Use rank to determine color in details

This commit is contained in:
David Kaltschmidt
2015-11-20 13:01:09 +01:00
parent 7ad7778965
commit 0cae3541fa
3 changed files with 5 additions and 1 deletions

View File

@@ -61,7 +61,7 @@ const NodeDetails = React.createClass({
return this.renderLoading();
}
const nodeColor = this.getNodeColorDark(details.label_major);
const nodeColor = this.getNodeColorDark(details.rank);
const styles = {
controls: {
'backgroundColor': this.brightenColor(nodeColor)

View File

@@ -26,6 +26,7 @@ type DetailedNode struct {
ID string `json:"id"`
LabelMajor string `json:"label_major"`
LabelMinor string `json:"label_minor,omitempty"`
Rank string `json:"rank,omitempty"`
Pseudo bool `json:"pseudo,omitempty"`
Tables []Table `json:"tables"`
Controls []ControlInstance `json:"controls"`
@@ -115,6 +116,7 @@ func MakeDetailedNode(r report.Report, n RenderableNode) DetailedNode {
ID: n.ID,
LabelMajor: n.LabelMajor,
LabelMinor: n.LabelMinor,
Rank: n.Rank,
Pseudo: n.Pseudo,
Tables: tables,
Controls: controls(r, n),

View File

@@ -88,6 +88,7 @@ func TestMakeDetailedHostNode(t *testing.T) {
ID: render.MakeHostID(fixture.ClientHostID),
LabelMajor: "client",
LabelMinor: "hostname.com",
Rank: "hostname.com",
Pseudo: false,
Controls: []render.ControlInstance{},
Tables: []render.Table{
@@ -155,6 +156,7 @@ func TestMakeDetailedContainerNode(t *testing.T) {
ID: fixture.ServerContainerID,
LabelMajor: "server",
LabelMinor: fixture.ServerHostName,
Rank: "imageid456",
Pseudo: false,
Controls: []render.ControlInstance{},
Tables: []render.Table{