diff --git a/app/api_topologies.go b/app/api_topologies.go index 5618a6d9de..25df445550 100644 --- a/app/api_topologies.go +++ b/app/api_topologies.go @@ -43,8 +43,8 @@ var ( ID: "pseudo", Default: "hide", Options: []APITopologyOption{ - {Value: "show", Label: "Show Unmanaged", filter: nil, filterPseudo: false}, - {Value: "hide", Label: "Hide Unmanaged", filter: render.IsNotPseudo, filterPseudo: true}, + {Value: "show", Label: "Show unmanaged", filter: nil, filterPseudo: false}, + {Value: "hide", Label: "Hide unmanaged", filter: render.IsNotPseudo, filterPseudo: true}, }, } ) @@ -151,8 +151,8 @@ func MakeRegistry() *Registry { Default: "application", Options: []APITopologyOption{ {Value: "all", Label: "All", filter: nil, filterPseudo: false}, - {Value: "system", Label: "System Containers", filter: render.IsSystem, filterPseudo: false}, - {Value: "application", Label: "Application Containers", filter: render.IsApplication, filterPseudo: false}}, + {Value: "system", Label: "System containers", filter: render.IsSystem, filterPseudo: false}, + {Value: "application", Label: "Application containers", filter: render.IsApplication, filterPseudo: false}}, }, { ID: "stopped", @@ -167,8 +167,8 @@ func MakeRegistry() *Registry { ID: "pseudo", Default: "hide", Options: []APITopologyOption{ - {Value: "show", Label: "Show Uncontained", filter: nil, filterPseudo: false}, - {Value: "hide", Label: "Hide Uncontained", filter: render.IsNotPseudo, filterPseudo: true}, + {Value: "show", Label: "Show uncontained", filter: nil, filterPseudo: false}, + {Value: "hide", Label: "Hide uncontained", filter: render.IsNotPseudo, filterPseudo: true}, }, }, } @@ -178,8 +178,8 @@ func MakeRegistry() *Registry { ID: "unconnected", Default: "hide", Options: []APITopologyOption{ - {Value: "show", Label: "Show Unconnected", filter: nil, filterPseudo: false}, - {Value: "hide", Label: "Hide Unconnected", filter: render.IsConnected, filterPseudo: false}, + {Value: "show", Label: "Show unconnected", filter: nil, filterPseudo: false}, + {Value: "hide", Label: "Hide unconnected", filter: render.IsConnected, filterPseudo: false}, }, }, } @@ -236,7 +236,7 @@ func MakeRegistry() *Registry { id: kubeControllersID, parent: podsID, renderer: render.KubeControllerRenderer, - Name: "controllers", + Name: "Controllers", Options: []APITopologyOptionGroup{unmanagedFilter}, HideIfEmpty: true, }, @@ -244,7 +244,7 @@ func MakeRegistry() *Registry { id: servicesID, parent: podsID, renderer: render.PodServiceRenderer, - Name: "services", + Name: "Services", Options: []APITopologyOptionGroup{unmanagedFilter}, HideIfEmpty: true, }, @@ -260,14 +260,14 @@ func MakeRegistry() *Registry { id: ecsServicesID, parent: ecsTasksID, renderer: render.ECSServiceRenderer, - Name: "services", + Name: "Services", Options: []APITopologyOptionGroup{unmanagedFilter}, HideIfEmpty: true, }, APITopologyDesc{ id: swarmServicesID, renderer: render.SwarmServiceRenderer, - Name: "services", + Name: "Services", Rank: 3, Options: []APITopologyOptionGroup{unmanagedFilter}, HideIfEmpty: true, diff --git a/app/api_topologies_test.go b/app/api_topologies_test.go index a1b44cbd1c..c8d117914c 100644 --- a/app/api_topologies_test.go +++ b/app/api_topologies_test.go @@ -51,7 +51,7 @@ func TestAPITopology(t *testing.T) { } // TODO: add ECS nodes in report fixture - if topology.Name == "Tasks" || topology.Name == "services" { + if topology.Name == "Tasks" || topology.Name == "Services" { continue } diff --git a/client/app/scripts/charts/nodes-grid.js b/client/app/scripts/charts/nodes-grid.js index 6bff51b29e..af81b37f66 100644 --- a/client/app/scripts/charts/nodes-grid.js +++ b/client/app/scripts/charts/nodes-grid.js @@ -2,11 +2,13 @@ import React from 'react'; import { connect } from 'react-redux'; import { List as makeList, Map as makeMap } from 'immutable'; +import capitalize from 'lodash/capitalize'; import NodeDetailsTable from '../components/node-details/node-details-table'; import { clickNode, sortOrderChanged } from '../actions/app-actions'; import { shownNodesSelector } from '../selectors/node-filters'; import { trackAnalyticsEvent } from '../utils/tracking-utils'; +import { findTopologyById } from '../utils/topology-utils'; import { TABLE_VIEW_MODE } from '../constants/naming'; import { windowHeightSelector } from '../selectors/canvas'; @@ -18,7 +20,15 @@ const IGNORED_COLUMNS = ['docker_container_ports', 'docker_container_id', 'docke 'docker_container_command', 'docker_container_networks']; -function getColumns(nodes) { +function topologyLabel(topologies, id) { + const topology = findTopologyById(topologies, id); + if (!topology) { + return capitalize(id); + } + return topology.get('fullName'); +} + +function getColumns(nodes, topologies) { const metricColumns = nodes .toList() .flatMap((n) => { @@ -43,11 +53,12 @@ function getColumns(nodes) { .toList() .sortBy(m => m.get('label')); + const relativesColumns = nodes .toList() .flatMap((n) => { const metadata = (n.get('parents') || makeList()) - .map(m => makeMap({ id: m.get('topologyId'), label: m.get('topologyId') })); + .map(m => makeMap({ id: m.get('topologyId'), label: topologyLabel(topologies, m.get('topologyId')) })); return metadata; }) .toSet() @@ -108,7 +119,7 @@ class NodesGrid extends React.Component { render() { const { - nodes, gridSortedBy, gridSortedDesc, searchNodeMatches, searchQuery, windowHeight + nodes, gridSortedBy, gridSortedDesc, searchNodeMatches, searchQuery, windowHeight, topologies } = this.props; const height = this.tableRef ? windowHeight - this.tableRef.getBoundingClientRect().top - 30 : 0; @@ -131,7 +142,7 @@ class NodesGrid extends React.Component { .toList() .filter(n => !(searchQuery && searchNodeMatches.get(n.get('id'), makeMap()).isEmpty())) .toJS(), - columns: getColumns(nodes) + columns: getColumns(nodes, topologies) }; return ( @@ -167,6 +178,7 @@ function mapStateToProps(state) { searchQuery: state.get('searchQuery'), selectedNodeId: state.get('selectedNodeId'), windowHeight: windowHeightSelector(state), + topologies: state.get('topologies'), }; } diff --git a/client/app/scripts/components/node-details/node-details-image-status.js b/client/app/scripts/components/node-details/node-details-image-status.js index 167333691d..bc51f57afb 100644 --- a/client/app/scripts/components/node-details/node-details-image-status.js +++ b/client/app/scripts/components/node-details/node-details-image-status.js @@ -91,7 +91,7 @@ class NodeDetailsImageStatus extends React.PureComponent { return (
- Container Image Status + Container image status {containers &&