mirror of
https://github.com/weaveworks/scope.git
synced 2026-03-03 02:00:43 +00:00
Merge pull request #94 from weaveworks/stabilize-detail-pane-order
Stabilize order of rows in origin node
This commit is contained in:
@@ -33,13 +33,13 @@ func originNodeForProcess(node report.NodeMetadata) OriginNode {
|
||||
{Key: "PID", ValueMajor: node["pid"], ValueMinor: ""},
|
||||
{Key: "Process name", ValueMajor: node["name"], ValueMinor: ""},
|
||||
}
|
||||
for key, human := range map[string]string{
|
||||
"docker_id": "Container ID",
|
||||
"docker_name": "Container name",
|
||||
"cgroup": "cgroup",
|
||||
for _, tuple := range []struct{ key, human string }{
|
||||
{"docker_id", "Container ID"},
|
||||
{"docker_name", "Container name"},
|
||||
{"cgroup", "cgroup"},
|
||||
} {
|
||||
if val, ok := node[key]; ok {
|
||||
rows = append(rows, report.Row{Key: human, ValueMajor: val, ValueMinor: ""})
|
||||
if val, ok := node[tuple.key]; ok {
|
||||
rows = append(rows, report.Row{Key: tuple.human, ValueMajor: val, ValueMinor: ""})
|
||||
}
|
||||
}
|
||||
return OriginNode{
|
||||
|
||||
Reference in New Issue
Block a user