diff --git a/app/files/css/copy.scss b/app/files/css/copy.scss index b006626..b614e32 100644 --- a/app/files/css/copy.scss +++ b/app/files/css/copy.scss @@ -15,5 +15,7 @@ &.highlight { opacity: 1; color: $success; + height: 1.8em; + width: 1.8em; } } diff --git a/app/files/css/networks.scss b/app/files/css/networks.scss index d5aab3a..35b7382 100644 --- a/app/files/css/networks.scss +++ b/app/files/css/networks.scss @@ -29,7 +29,7 @@ th { padding-right: 1em; - text-align: center; + text-align: left; } th span.aliases { @@ -37,8 +37,21 @@ } + td.aliases { + text-align: left; + width: 100%; + padding-left: 2em; + } + tbody tr.networked-service { - border-top: 1px solid $outline-dark; + line-height: 1em; + + &:hover { + td { + text-decoration: underline; + text-decoration-color: $info; + } + } } .alias { diff --git a/app/files/js/networks.jsx b/app/files/js/networks.jsx index bc5a4c5..679480c 100644 --- a/app/files/js/networks.jsx +++ b/app/files/js/networks.jsx @@ -88,7 +88,7 @@ const Content = (props) => { {network.name} - + {([service.name].concat(service.aliases[network.id] || [])).map( (alias, index) => ( diff --git a/app/files/js/stack.jsx b/app/files/js/stack.jsx index e5365c6..03ba0bd 100644 --- a/app/files/js/stack.jsx +++ b/app/files/js/stack.jsx @@ -76,19 +76,33 @@ class ConnectedStack extends React.Component { const { services, name } = this.props.stack; const { nodes } = this.props.manifest; + const getRunningCount = (service) => service.tasks.filter(task => task.state === 'running').length; + const getExpectedCount = (service) => service.replicas === null ? Object.values(nodes).length : service.replicas; + const getServiceLevel = (service) => { + const runningCount = getRunningCount(service); + return runningCount === getExpectedCount(service) ? 2 : (runningCount === 0 ? 0 : 1); + }; + + const serviceLevels = ['danger', 'warning', 'success']; + const summary = services.map( service => { - const runningCount = service.tasks.filter(task => task.state === 'running').length; - const expectedCount = service.replicas === null ? Object.values(nodes).length : service.replicas; - const level = runningCount === expectedCount ? 'success' : (runningCount === 0 ? 'danger' : 'warning'); - return `
${service.name}: ${runningCount}/${expectedCount} replicas running.
`; + const level = serviceLevels[getServiceLevel(service)]; + return `
${service.name}: ${getRunningCount(service)}/${getExpectedCount(service)} replicas running.
`; } - ).join("
"); + ).join("\n"); + + const stackLevel = serviceLevels[services.reduce( + (level, service) => { + const serviceLevel = getServiceLevel(service); + return Math.min(serviceLevel, level); + }, + 2)]; return (